trying to send a command list through serial port but only the first line is taken by the device others are ignored
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.txtNote: 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.
51 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