I'm trying to write a shell script to send an AT command to serial port and store it's response to a file.
I'm able to send the AT command as shown below, but not sure how to save the output from the ttyUSB1 to a file.
echo -e "AT+CSQ\r" > /dev/ttyUSB1
Is there a way to do it using shell script apart from atinout? I cannot use atinout because the atinout command to save the AT response to a file doesn't work for me.
expectutility for automating interactive programs is a solution. It can send and expect strings matching regular expressions.