<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi Matthew,<div class=""><br class=""></div><div class="">Thanks for chiming in. I hadn’t found your thread before. Would you mind sharing that dispatcher script? Is that working out satisfactory as a workaround?</div><div class=""><br class=""></div><div class="">Best regards,</div><div class="">Sven<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 22 Oct 2018, at 16:52, Matthew Starr <<a href="mailto:mstarr@hedonline.com" class="">mstarr@hedonline.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">Aleksander,</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">This is the exact same issue I reported a couple months ago:</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><a href="https://lists.freedesktop.org/archives/modemmanager-devel/2018-August/006593.html" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">https://lists.freedesktop.org/archives/modemmanager-devel/2018-August/006593.html</a><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">I am currently working around it by adding a NetworkManager dispatcher script that on ppp0 going down, I restart ModemManager.</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">I never did find a solution to the issue even after trying some modifications to the serial force close code (src/mm-port-serial.c) in ModemManager.  It looks like the force_closed boolean gets set and is never reset, which causes the serial port to never retry communications over the serial port again.</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">Regards,</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">Matthew Starr</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">Date: Mon, 22 Oct 2018 11:39:37 +0200<br class="">From: Sven Schwermer <<a href="mailto:sven@svenschwermer.de" class="">sven@svenschwermer.de</a>><br class="">To: Aleksander Morgado <<a href="mailto:aleksander@aleksander.es" class="">aleksander@aleksander.es</a>><br class="">Cc:<span class="Apple-converted-space"> </span><a href="mailto:modemmanager-devel@lists.freedesktop.org" class="">modemmanager-devel@lists.freedesktop.org</a><br class="">Subject: Re: Infinite connection loop<br class="">Message-ID: <41689DBE-1755-4F85-BFA7-<br class=""><a href="mailto:97CF6E588F41@svenschwermer.de" class="">97CF6E588F41@svenschwermer.de</a>><br class="">Content-Type: text/plain; charset="utf-8"<br class=""><br class="">I looked a little closer into this now.<br class=""><br class="">Here’s what I think is happening:<br class="">1. My cell operator terminates the LCP after some time of inactivity. This is<br class="">confirmed by my operator.<br class="">2. pppd receives the termination request, acknowledges it and the modem<br class="">hangs up the connection.<br class="">3. ModemManager fails to re-acquire serial port lock because of the hangup.<br class="">4. ModemManager sets the connection state to ‘registered’.<br class="">5. ModemManager force-closes the serial port.<br class="">6. NetworkManager registers the lost connection and tries to re-establish it.<br class="">7. The ModemManager fails to re-open serial port because it had been force-<br class="">closed.<br class=""><br class="">pppd doesn’t appear to be re-launched. How is this all supposed to work?<br class="">I’m sure the software stack should be able to handle a terminated<br class="">connection and re-dial it?<br class=""><br class="">Please find attached the debug-level log. The LCP termination happens at Oct<br class="">21 14:53:51.<br class=""><br class="">Best regards,<br class="">Sven<br class=""><br class="">-------------- next part --------------<br class="">A non-text attachment was scrubbed...<br class="">Name: excerpt.long.gz<br class="">Type: application/x-gzip<br class="">Size: 53662 bytes<br class="">Desc: not available<br class="">URL: <<a href="https://lists.freedesktop.org/archives/modemmanager-" class="">https://lists.freedesktop.org/archives/modemmanager-</a><br class="">devel/attachments/20181022/1e9e348d/attachment.bin><br class="">-------------- next part --------------<br class=""><br class=""><br class=""><blockquote type="cite" class="">On 20 Oct 2018, at 16:26, Sven Schwermer <<a href="mailto:sven@svenschwermer.de" class="">sven@svenschwermer.de</a>><br class=""></blockquote>wrote:<br class=""><blockquote type="cite" class=""><br class="">Hi again,<br class=""><br class="">I now managed to capture the event in the journal. I limited the auto<br class=""></blockquote>connect retried to 4 in order to keep the log size manageable. I didn’t have<br class="">debug-level logging active for NetworkManager at the time. I’ll enable that<br class="">now and try to reproduce. Please find the log attached. The error seems to<br class="">be happening at Oct 20 07:44:26.<br class=""><blockquote type="cite" class=""><br class="">Best regards,<br class="">Sven<br class=""><br class=""><ed6e56cf2ac5b6bdb2e3ca97276ebd6d.journal.log><br class=""><br class=""><blockquote type="cite" class="">On 20 Oct 2018, at 13:47, Aleksander Morgado<br class=""></blockquote></blockquote><<a href="mailto:aleksander@aleksander.es" class="">aleksander@aleksander.es</a>> wrote:<br class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><br class="">Hey,<br class=""><br class=""><blockquote type="cite" class="">I am running an embedded system with a u-blox SARA-U270 modem and<br class=""></blockquote></blockquote></blockquote>NetworkManager 1.12.2 / ModemManager 1.8.0. For some reason, the<br class="">modem connection seems to break over time. I am not quite sure why that’s<br class="">the case, but when I look into the journal, I see NetworkManager and<br class="">ModemManager spewing out log messages at a very high rate. This actually<br class="">causes significant system load (mostly by dbus-daemon). Here’s an excerpt<br class="">of the messages:<br class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><br class="">Oct 17 12:54:29 cf352c1 ModemManager[1385]: Simple connect started...<br class="">Oct 17 12:54:29 cf352c1 ModemManager[1385]: Simple connect state<br class=""></blockquote></blockquote></blockquote>(4/8): Wait to get fully enabled<br class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><blockquote type="cite" class="">Oct 17 12:54:29 cf352c1 ModemManager[1385]: Simple connect state<br class=""></blockquote></blockquote></blockquote>(5/8): Register<br class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><blockquote type="cite" class="">Oct 17 12:54:29 cf352c1 ModemManager[1385]: Simple connect state<br class=""></blockquote></blockquote></blockquote>(6/8): Bearer<br class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><blockquote type="cite" class="">Oct 17 12:54:29 cf352c1 ModemManager[1385]: Simple connect started...<br class="">Oct 17 12:54:29 cf352c1 ModemManager[1385]: Simple connect state<br class=""></blockquote></blockquote></blockquote>(4/8): Wait to get fully enabled<br class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><blockquote type="cite" class="">Oct 17 12:54:29 cf352c1 ModemManager[1385]: Simple connect state<br class=""></blockquote></blockquote></blockquote>(5/8): Register<br class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><blockquote type="cite" class="">Oct 17 12:54:29 cf352c1 ModemManager[1385]: Simple connect state<br class=""></blockquote></blockquote></blockquote>(6/8): Bearer<br class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><blockquote type="cite" class="">Oct 17 12:54:29 cf352c1 NetworkManager[677]: <warn><br class=""></blockquote></blockquote></blockquote>[1539780869.7776] modem-broadband[ttyACM0]: failed to connect modem:<br class="">Could not open serial device ttyACM0: it has been forced close<br class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><blockquote type="cite" class="">Oct 17 12:54:29 cf352c1 NetworkManager[677]: <info><br class=""></blockquote></blockquote></blockquote>[1539780869.7778] device (ttyACM0): state change: prepare -> failed (reason<br class="">'unknown', sys-iface-state: 'managed')<br class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><blockquote type="cite" class="">Oct 17 12:54:29 cf352c1 NetworkManager[677]: <info><br class=""></blockquote></blockquote></blockquote>[1539780869.7807] manager: NetworkManager state is now<br class="">CONNECTED_LOCAL<br class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><blockquote type="cite" class="">Oct 17 12:54:29 cf352c1 NetworkManager[677]: <warn><br class=""></blockquote></blockquote></blockquote>[1539780869.7840] device (ttyACM0): Activation: failed for connection<br class="">'gprsconnection'<br class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><blockquote type="cite" class="">Oct 17 12:54:29 cf352c1 NetworkManager[677]: <info><br class=""></blockquote></blockquote></blockquote>[1539780869.7860] device (ttyACM0): state change: failed -> disconnected<br class="">(reason 'none', sys-iface-state: 'managed')<br class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><blockquote type="cite" class="">Oct 17 12:54:29 cf352c1 NetworkManager[677]: <info><br class=""></blockquote></blockquote></blockquote>[1539780869.7923] policy: auto-activating connection 'gprsconnection'<br class="">(14e02637-0ffb-3a28-806f-ad60904afe7f)<br class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><blockquote type="cite" class="">Oct 17 12:54:29 cf352c1 NetworkManager[677]: <info><br class=""></blockquote></blockquote></blockquote>[1539780869.8005] device (ttyACM0): Activation: starting connection<br class="">'gprsconnection' (14e02637-0ffb-3a28-806f-ad60904afe7f)<br class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><blockquote type="cite" class="">Oct 17 12:54:29 cf352c1 NetworkManager[677]: <info><br class=""></blockquote></blockquote></blockquote>[1539780869.8015] device (ttyACM0): state change: disconnected -> prepare<br class="">(reason 'none', sys-iface-state: 'managed')<br class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><blockquote type="cite" class="">Oct 17 12:54:29 cf352c1 NetworkManager[677]: <info><br class=""></blockquote></blockquote></blockquote>[1539780869.8043] manager: NetworkManager state is now CONNECTING<br class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><blockquote type="cite" class="">Oct 17 12:54:29 cf352c1 ModemManager[1385]: Simple connect started...<br class="">Oct 17 12:54:29 cf352c1 ModemManager[1385]: Simple connect state<br class=""></blockquote></blockquote></blockquote>(4/8): Wait to get fully enabled<br class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><blockquote type="cite" class="">Oct 17 12:54:29 cf352c1 ModemManager[1385]: Simple connect state<br class=""></blockquote></blockquote></blockquote>(5/8): Register<br class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><blockquote type="cite" class="">Oct 17 12:54:29 cf352c1 ModemManager[1385]: Simple connect state<br class=""></blockquote></blockquote></blockquote>(6/8): Bearer<br class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><blockquote type="cite" class="">Oct 17 12:54:29 cf352c1 ModemManager[1385]: Simple connect started...<br class="">Oct 17 12:54:29 cf352c1 ModemManager[1385]: Simple connect state<br class=""></blockquote></blockquote></blockquote>(4/8): Wait to get fully enabled<br class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><blockquote type="cite" class="">Oct 17 12:54:29 cf352c1 ModemManager[1385]: Simple connect state<br class=""></blockquote></blockquote></blockquote>(5/8): Register<br class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><blockquote type="cite" class="">Oct 17 12:54:29 cf352c1 ModemManager[1385]: Simple connect state<br class=""></blockquote></blockquote></blockquote>(6/8): Bearer<br class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><blockquote type="cite" class="">Oct 17 12:54:29 cf352c1 NetworkManager[677]: <warn><br class=""></blockquote></blockquote></blockquote>[1539780869.9321] modem-broadband[ttyACM0]: failed to connect modem:<br class="">Could not open serial device ttyACM0: it has been forced close<br class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><blockquote type="cite" class="">Oct 17 12:54:29 cf352c1 NetworkManager[677]: <info><br class=""></blockquote></blockquote></blockquote>[1539780869.9323] device (ttyACM0): state change: prepare -> failed (reason<br class="">'unknown', sys-iface-state: 'managed')<br class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><blockquote type="cite" class="">Oct 17 12:54:29 cf352c1 NetworkManager[677]: <info><br class=""></blockquote></blockquote></blockquote>[1539780869.9350] manager: NetworkManager state is now<br class="">CONNECTED_LOCAL<br class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><blockquote type="cite" class="">Oct 17 12:54:29 cf352c1 NetworkManager[677]: <warn><br class=""></blockquote></blockquote></blockquote>[1539780869.9399] device (ttyACM0): Activation: failed for connection<br class="">'gprsconnection'<br class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><blockquote type="cite" class="">Oct 17 12:54:29 cf352c1 NetworkManager[677]: <info><br class=""></blockquote></blockquote></blockquote>[1539780869.9430] device (ttyACM0): state change: failed -> disconnected<br class="">(reason 'none', sys-iface-state: 'managed')<br class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><blockquote type="cite" class="">Oct 17 12:54:29 cf352c1 NetworkManager[677]: <info><br class=""></blockquote></blockquote></blockquote>[1539780869.9490] policy: auto-activating connection 'gprsconnection'<br class="">(14e02637-0ffb-3a28-806f-ad60904afe7f)<br class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><blockquote type="cite" class="">Oct 17 12:54:29 cf352c1 NetworkManager[677]: <info><br class=""></blockquote></blockquote></blockquote>[1539780869.9569] device (ttyACM0): Activation: starting connection<br class="">'gprsconnection' (14e02637-0ffb-3a28-806f-ad60904afe7f)<br class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><blockquote type="cite" class="">Oct 17 12:54:29 cf352c1 NetworkManager[677]: <info><br class=""></blockquote></blockquote></blockquote>[1539780869.9585] device (ttyACM0): state change: disconnected -> prepare<br class="">(reason 'none', sys-iface-state: 'managed')<br class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><blockquote type="cite" class="">Oct 17 12:54:29 cf352c1 NetworkManager[677]: <info><br class=""></blockquote></blockquote></blockquote>[1539780869.9653] manager: NetworkManager state is now CONNECTING<br class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><br class="">It continues like that forever. My modem network connection config is<br class=""></blockquote></blockquote></blockquote>as follows:<br class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><br class="">[connection]<br class="">id=gprsconnection<br class="">type=gsm<br class="">autoconnect=true<br class="">autoconnect-retries=0<br class="">[gsm]<br class="">number=*99#<br class="">[ipv4]<br class="">dns-search=<br class="">method=auto<br class="">may-fail=false<br class=""><br class="">I have been looking through the code and what I don’t understand is<br class=""></blockquote></blockquote></blockquote>why the ttyACM0 would ever be forcefully closed. What could be an<br class="">explanation for this?<br class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><br class="">Any insight is appreciated.<br class=""><br class=""></blockquote><br class="">Do you have a full log of when this issue happens? If you can<br class="">reproduce this more or less frequently, could you setup both<br class="">ModemManager and NetworkManager to dump debug logs and try to get<br class=""></blockquote></blockquote>it<br class=""><blockquote type="cite" class=""><blockquote type="cite" class="">reproduced? This issue could be to a wrong synchronization between MM<br class="">and NM/pppd, in particular related to the CLOCAL settings in each case<br class="">(i.e. MM shouldn't get HUPs in the serial port unless for the cases<br class="">where the port is going away).<br class=""><br class="">--<br class="">Aleksander<br class=""><a href="https://aleksander.es" class="">https://aleksander.es</a></blockquote></blockquote></blockquote></div></blockquote></div><br class=""></div></body></html>