Velvet Star Monitor

Standout celebrity highlights with iconic style.

general

trying to send a command list through serial port but only the first line is taken by the device others are ignored

Writer Matthew Barrera

I am trying to send a message including carriage returns (represented without pressing enter) over a serial connection. It works if i press enter with an open serial connection, but I have not found a way to represent the carriage return character successfully within the message body. Need to represent the "CR" in txt file.

Commands are listed in text file. I’m using:

while read line ; do echo "$line" | picocom -b 115200 --omap crcrlf /dev/ttyACM0
done < file.txt

Note: the modem documentation say n order to successfully communicate with modem device, the “$WP” or “$wp” prefix is required when issuing command and the "CR" is required for terminating the command line.

5

1 Answer

I succeeded using minicom with script. It was necessary to consider answers sent by the modem to be able to proceed to the following command. What I managed to do with "expect" as following:

send <command>
expect "OK"
send <command>
expect "OK"
....

You can refer to minicom man page

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy