Hello everyone
I have one question, how to pass to serial enter character from url?
I have serial server that passing commands to little device controling leds
and this device need enter after each command
when serial server used from socat its working fine but when tried to switch to url, not working
http://ip/control?cmd=serialsend,rgb,10 ... ,100%0D%0A as you can see %0D%0A and also only one of them and no effect. Maybe you have idea how to do it. I search google and nothing worked
when i use socat
rgb,0,60,100,4,100
rgb,100,60,0,4,100
when i use url
rgb,100,60,100,4,100rgb,100,60,100,4,100rgb,100,60,100,4,100rgb,100,60,100,4,100rgb,100,60,100,4,100
on serial monitor
Serial Server from url question
Moderators: grovkillen, Stuntteam, TD-er
Re: Serial Server from url question
Have you also tried "\n" (without the quotes)?
or %CR% or %N% ?
or %CR% or %N% ?
Re: Serial Server from url question
yes \n\r was tested before just passing this characters to serial
rgb,100,60,100,4,100\n\r
%CR% gives rgb,100,60,100,4,100♀%
%N% gives rgb,100,60,100,4,100rgb,100,60,100,4,100rgb,100,60,100,4,100
rgb,100,60,100,4,100\n\r
%CR% gives rgb,100,60,100,4,100♀%
%N% gives rgb,100,60,100,4,100rgb,100,60,100,4,100rgb,100,60,100,4,100
Re: Serial Server from url question
You can use the "serialsendmix" command, that allows interspersing the (text)data to send with hexadecimal values (including 0x00 if desired). Documentation for that command is not published yet, though the command is currently available, but still in an open pull request and can be read here from the source. (deciphered maybe )
In short, your command should then look like this:
The difference here is that for the serialsendmix command, any content item (separated by commas) that starts with 0x is interpreted as the hexadecimal value for a character, or sequence of characters. These can be appended in multiples of 2 characters, as explained in the link above, and separators can also be used.
You can prefix that command, like all commands, with the regular url syntax "http://ip/control?cmd=".
In short, your command should then look like this:
Code: Select all
serialsendmix,rgb,0,60,100,4,100,0x0a,rgb,100,60,0,4,100,0x0a
You can prefix that command, like all commands, with the regular url syntax "http://ip/control?cmd=".
/Ton (PayPal.me)
Re: Serial Server from url question
Thank you!
Who is online
Users browsing this forum: Google [Bot] and 1 guest