I've got a Buildroot-based embedded system that uses a 3G modem (Cinterion PH8-P) and PPP to connect to the internet. The 3G modem is a USB device that provides 4 ttyUSB ports. One of these is used for PPP, whereas another is used for GPS.
Occasionally, the 3G modem will stop working and will need to be restarted. I do this by first stopping the PPP and GPSd daemons, then restarting the modem, and then restarting the daemons again. Unfortunately, it seems that if PPP is run beforehand, it seems to affect the serial ports in some way so that other programs can no longer use them.
For example, if I run the following on a freshly booted system where PPP has not been run yet:
cat /dev/ttyUSB3&
echo "AT" > /dev/ttyUSB3
I get the expected OK
AT response back. If I then run PPP for a bit (by calling pon), then stop it (by calling poff), restart the modem and try to send the same AT command again, the terminal just seems to echo back exactly what I sent to the modem and I don't get the OK
response. As a result, the GPS won't work, since I stop receiving NMEA messsages from the GPS tty port. It's almost like PPP is configuring all the serial ports to redirect their outputs somewhere else. Despite this, PPP has no problem at all starting up again after the modem has rebooted - according to the logs, the chat scripts happily send their AT commands and get the expected responses back.
What could be causing this issue?