Modem disconnect - serial breaks etc.

Tim Small tim at seoss.co.uk
Mon Jul 24 17:09:46 UTC 2017


I'm seeing an issue where the ppp connection exits, but the modem seems
to be left in connected state (I can verify that by sending mm SIGSTOP,
then opening a serial terminal window - I'm able to then manually hangup
the modem using the +++ escape sequence).

Although it doesn't say so explicitly, I think "Flashing data port" is
intended to reset the modem.

Looking at this code it attempt to set the serial baud rate to zero for
1 second (i.e. what is commonly known as a serial "break" I believe).
However this isn't working correctly since the debug output shows the
next command being executed in less than a second:

<debug> [006603.496836] Flashing data port (ttyUSB0)...
<debug> [006603.498142] (ttyUSB0): port attributes not fully set
<debug> [006603.498209] (ttyUSB0): --> 'ATE0<CR>'

I've also confirmed this by taping the serial transmit line from the
host to the modem into the serial RX line of a "Bus Pirate" - this shows
that a serial break is sent (it report a UART framing error) when I use
the serial break function of "GNU screen" (ctrl-a followed by ctrl-b),
but not with modem manager.

If I alter the mm-port-serial to run tcsendbreak() on the serial line
fd, then the bus pirate does show a serial break on the line - so
assuming a break is the intended behaviour here, I think the code should
be altered to use tcsendbreak instead of setting the baud rate to 0.


However... this won't help much with Telit modems since, they don't
respond to serial breaks by going back into command mode, but probably
will with other modems which do respond to this I suppose.



445.026597] loading access technology (Telit)...
445.026619] Couldn't refresh access technologies: 'No AT port available
to run command'
445.026631] Periodic signal quality checks scheduled in 30s
461.016638] Disconnecting bearer '/org/freedesktop/ModemManager1/Bearer/0'
461.016710] Modem /org/freedesktop/ModemManager1/Modem/0: state changed
(connected -> disconnecting)
461.016866] Reopening data port (ttyUSB0)...
461.016886] (ttyUSB0) reopening port (2)
461.016897] (ttyUSB0) device open count is 1 (close)
461.016906] (ttyUSB0) device open count is 0 (close)
461.016916] (ttyUSB0) closing serial port...
461.016927] (ttyUSB0): port now disconnected
461.016944] (ttyUSB0) serial port closed
462.017906] (ttyUSB0) opening serial port...
462.018649] (ttyUSB0): couldn't set serial port closing_wait to none:
Inappropriate ioctl for device
462.018674] (ttyUSB0): setting up baudrate: 115200
462.018797] (ttyUSB0) device open count is 1 (open)
462.018812] (ttyUSB0): running init sequence...
462.018833] (ttyUSB0) device open count is 2 (open)
462.018851] Flashing data port (ttyUSB0)...
462.019024] (ttyUSB0): port attributes not fully set
462.019049] (ttyUSB0): --> 'ATE0<CR>'
463.020724] (ttyUSB0) device open count is 1 (close)
463.020889] Sending PDP context deactivation in primary/data port...
463.020938] (ttyUSB0) device open count is 2 (open)
465.021902] (ttyUSB0): --> 'ATV1<CR>'
468.025315] (ttyUSB0): --> 'AT+CMEE=1<CR>'
471.024933] (ttyUSB0): --> 'ATX4<CR>'
474.025394] (ttyUSB0): --> 'AT&C1<CR>'
475.025866] loading signal quality...
475.026092] (ttyUSB0) device open count is 3 (open)
477.023131] (ttyUSB0): --> 'AT+CGACT=0,1<CR>'
487.029913] PDP context deactivation failed (not fatal): Serial command
timed out



-- 
South East Open Source Solutions Limited
Registered in England and Wales with company number 06134732.
Registered Office: 2 Powell Gardens, Redhill, Surrey, RH1 1TQ
VAT number: 900 6633 53  http://seoss.co.uk/ +44-(0)1273-808309


More information about the ModemManager-devel mailing list