ModemManager can't open serial port after previously opening it successfully
Matthew Starr
mstarr at hedonline.com
Mon Aug 20 21:51:02 UTC 2018
> -----Original Message-----
> From: Aleksander Morgado [mailto:aleksander at aleksander.es]
> Sent: Monday, August 20, 2018 4:33 PM
>
> > I did some further testing and while ModemManager is continually
> reporting the serial port can't be opened, I was able to connect to the port
> and send AT commands to the modem and the modem responded. This
> means there is something in ModemManager that is triggering these
> messages and not the modem itself
> >
> > I have also been able to regularly reproduce this issue with
> ModemManager 1.8.0 by just connecting a data connection, disconnecting
> my antennas for about 5-10 minutes (simulates loss of signal in a poor signal
> area), and reconnecting the antennas (simulates moving into a good signal
> area). ModemManager never recovers until the ModemManager process is
> restarted.
> >
> > I see that ModemManager is reporting "(ttyACM0) unexpected port
> hangup!" and then "(ttyACM0) forced to close port". After that
> ModemManager is unable to connect again to ttyACM0. It looks like the
> issue may be in the serial port force close code or whatever caused the force
> close to occur.
> >
>
> This look like a modem crash actually. When this previous issue
> happens, do you see the ttyACM0 port going away from the system? (e.g.
> in dmesg output)
>
The /dev/ttyACM0 interface does not go away, nor do any of the other ttyACM interfaces for the modem. The problem will persist until ModemManager is restarted. While ModemManager cannot communicate with the modem over /dev/ttyACM0, I am able to use minicom or picocom to talk to the modem using /dev/ttyACM0. Immediately on restarting ModemManager there is no longer an issue until the next time there is a long period of no signal while a data connection is established.
I did some digging through the code and added some of my own debug statements to track down what was going on. I found that in src/mm-port-serial.c when the port_serial_close_force() function is called and self->priv->forced_close is set to TRUE, that is when the port stops working in ModemManager. At that point the forced_close value is never reset to FALSE.
Best regards,
Matthew Starr
More information about the ModemManager-devel
mailing list