serialsend does no write to serial pins
Moderators: grovkillen, Stuntteam, TD-er
serialsend does no write to serial pins
Hello all,
I am very confused now.
Using 80210802 version.
What is the intention of serialsend ? Just a write to the tcp port ?
What I want is write the time via serial line to an Arduino.
I 've done everything written on the internet: setup a serial device and in the tools section : serial on ( not sure that is necessary )
When I connect with putty on the tcp port , data is coming through on the usb port ( monitoring with arduino ide ) AND on the serial pins to Arduino ( nice ! )
But when giving the command serialsend nothing appears on the arduino. Then I give a longer string and some garbage comes in ( just 2 bytes or so )
Looks like serialsend only writes to tcp port, or to serial pins with wrong baud rate ??
Greetings,
Gert
I am very confused now.
Using 80210802 version.
What is the intention of serialsend ? Just a write to the tcp port ?
What I want is write the time via serial line to an Arduino.
I 've done everything written on the internet: setup a serial device and in the tools section : serial on ( not sure that is necessary )
When I connect with putty on the tcp port , data is coming through on the usb port ( monitoring with arduino ide ) AND on the serial pins to Arduino ( nice ! )
But when giving the command serialsend nothing appears on the arduino. Then I give a longer string and some garbage comes in ( just 2 bytes or so )
Looks like serialsend only writes to tcp port, or to serial pins with wrong baud rate ??
Greetings,
Gert
Last edited by Soulman on 13 Sep 2021, 10:55, edited 1 time in total.
Re: serialwrite does no write to serial pins
I searched through the source code but I cannot find the "serialwrite" command.
Where did you find this suggestion?
Where did you find this suggestion?
Re: serialsend does no write to serial pins
Sorry , abuse must be serialsend
Re: serialsend does no write to serial pins
"serialsend" is a command belonging to the "Ser2Net" plugin.
It does allow to send data from the TCP port to the serial port.
There is however a rather "strange" part in this code, as it does send whatever is put in the command string starting at position 11 and further. ("serialsend," is 11 chars)
But strictly speaking sending "serialsend ,...." (thus space and a comma) is valid too and what if you try to wrap the command argument in quotes, then those are sent too.
A task with the Ser2Net plugin assigned to it must be present and enabled, to send something to the serial port.
You don't need to have it connected to another host.
Currently the only way to send something to the serial port, without using the Ser2Net plugin, is sending via the "logitem" command. But this will add some clutter like the uptime in msec, whether it is an "info" logentry, etc. (along with all other log items)
It does allow to send data from the TCP port to the serial port.
Code: Select all
case PLUGIN_WRITE:
{
String command = parseString(string, 1);
P020_Task *task = static_cast<P020_Task *>(getPluginTaskData(event->TaskIndex));
if (nullptr == task) {
break;
}
if (command == F("serialsend")) {
task->ser2netSerial->write(string.substring(11).c_str());
task->ser2netSerial->flush();
success = true;
}
if ((command == F("ser2netclientsend")) && (task->hasClientConnected())) {
task->ser2netClient.print(string.substring(18));
task->ser2netClient.flush();
success = true;
}
break;
}
But strictly speaking sending "serialsend ,...." (thus space and a comma) is valid too and what if you try to wrap the command argument in quotes, then those are sent too.
A task with the Ser2Net plugin assigned to it must be present and enabled, to send something to the serial port.
You don't need to have it connected to another host.
Currently the only way to send something to the serial port, without using the Ser2Net plugin, is sending via the "logitem" command. But this will add some clutter like the uptime in msec, whether it is an "info" logentry, etc. (along with all other log items)
Re: serialsend does no write to serial pins
So you say "it can"A task with the Ser2Net plugin assigned to it must be present and enabled, to send something to the serial port.
"It can't "Currently the only way to send something to the serial port....
I'll try later with "logitem"
Re: serialsend does no write to serial pins
Please read the original sentence again, you missed the "without using the Ser2Net plugin" part. So it can, as that plugin is included in the normal and test builds (and some hardware specific ones too)
/Ton (PayPal.me)
Re: serialsend does no write to serial pins
Sorry, my posts are almost always a memory-dump and I often have to go through them several times to make them more readable for others that don't fork their thoughts into another thread on every other word, like I do ![Lach :)](./images/smilies/icon_e_smile.gif)
But like Ath already suggested, it can be done with the Ser2Net plugin active and enabled.
If you don't want to use that one, or can't use it (e.g. due to all task slots already used), you can still send out logs.
TL;DR
In order to use that command, you have to have the Ser2Net plugin assigned to a task and have it enabled.
![Lach :)](./images/smilies/icon_e_smile.gif)
But like Ath already suggested, it can be done with the Ser2Net plugin active and enabled.
If you don't want to use that one, or can't use it (e.g. due to all task slots already used), you can still send out logs.
TL;DR
In order to use that command, you have to have the Ser2Net plugin assigned to a task and have it enabled.
Re: serialsend does no write to serial pins
Hmmmm,
So I have plugin assigned !
Then start putty and send some data -> Succes data comes in in Arduino ( So baudrate , wiring tx/rx pins all are okay )
Send some data with serialsend -> Bad Luck No data !!!
bij writing that in the 1st post I meant the Ser2Net plugin assigned to a task and have it enabled.setup a serial device
So I have plugin assigned !
Then start putty and send some data -> Succes data comes in in Arduino ( So baudrate , wiring tx/rx pins all are okay )
Send some data with serialsend -> Bad Luck No data !!!
Re: serialsend does no write to serial pins
I have the same issue, the command serialsend doesn't work, no data in the TX pin, I tryed both configuration on the Communication - Serial Server with HW Serial0 and SoftwareSerial and got nothing.Soulman wrote: ↑13 Sep 2021, 13:30 Hmmmm,bij writing that in the 1st post I meant the Ser2Net plugin assigned to a task and have it enabled.setup a serial device
So I have plugin assigned !
Then start putty and send some data -> Succes data comes in in Arduino ( So baudrate , wiring tx/rx pins all are okay )
Send some data with serialsend -> Bad Luck No data !!!
The hardware it's ok because when I use the command ser2netclientsend it's work fine. Only whith this way I can send data to TX pins.
Who is online
Users browsing this forum: Google [Bot] and 40 guests