There was such a problem: there is a modem 3g / dev / ttyUSB1 I want to write a script that wakes up to take all data from the modem like a signal, mode 3g and so on.

> a=`echo -e "at+zrssi\r" > /dev/ttyUSB1 | sleep 3 | head -n 1 /dev/ttyUSB1 | grep RSSI` 

But, such a request is triggered, well, it happens less often after about time, it hangs. Can anyone explain what can be or how else you can send requests.

In minicom everything works well, the craftsmen write that php is also ok.

    1 answer 1

    Thank you all figured out

     echo -e "at+zrssi\r" > /dev/ttyUSB1 && sleep 1| head -n 2 < /dev/ttyUSB1 | tail -n 2|grep ZRSSI: