![]() HOWEVER, this didn't work for me until I also used the cat command ( cat > $SERIAL_COMM_PORTĪgain, for printf, start cat < /dev/ttyS0 before sending the command. ![]() Or it is easier to use an editor to type into a script file. which you can construct on the command line by typing Ctrl V Ctrl R and Ctrl V Ctrl B. Plus, you don't have to type echo and quotes every time.įollow praetorian droid's answer. will not be interpreted, and will literally write the string \x12\x02 (and append a newline) to the specified serial port. (Change the above to fit your needs for speed, parity, stop bits, etc.) I realize screen isn't the "linux command line" as the post specifically asks for, but I think it's in the same spirit. ![]() You can issue this command to open a screen session, then anything you type will be sent to the port, plus the return values will be printed below it: screen /dev/ttyS0 19200,cs8 (I put easier in quotes, because screen has a really weird interface, IMO, and takes some further reading to figure it out.) I found that using screen is an "easier" solution, since it opens a terminal session directly with that port. I was using the suggestions in this post to write to a serial port, then using the info from another post to read from the port, with mixed results. NOTE: screen is actually not able to send hex, as far as I know.
0 Comments
Leave a Reply. |