1

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?

1 Answer 1

1

As it turns out, PPP is affecting it's own serial port, and since that's the one that's used to configure the GPS, that's what's causing the problem.

By comparing the results of stty -F /dev/ttyUSB3 before and after running PPP, it became apparent that PPP was configuring the serial port in raw mode, which meant I couldn't use it to configure the GPS port. What's interesting is that these settings persisted even after the ttyUSBx device nodes were removed and recreated due to the modem being reset.

Simply running stty sane -F /dev/ttyUSB3 to revert back to default settings allowed me to configure the GPS port without issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.