In Linux I need to send a sequence of AT commands to a serial port on e.g. /dev/ttyS0
, which has to wait for an OK
answer before the next command is sent. I could imagine doing something like
echo 'AT' > /dev/ttyS0
echo 'ATS0=0' > dev/ttyS0
...
but this does not evaluate the answer from the device on that port.
Is there a very simple way to automate this within a bash script, probably with the help of socat
and/or microcom
but no tools which cannot found on the most simple linux system.