Reseting mobile connection - Librem 5

But I mean seriously how is this supposed to be useful when the friggin modem is not reliable in the slightest? It might be telekom but it is frustrating to the max.

1 Like

I know what you mean and I shared your sentiment.

In practice this problem affects me not any more or extremely seldom.

But this is the reason I supposed to put all this into a package and install it by default - until the root cause is fixed.

I thought so too, but after testing it I found that much more frequent pings are needed to avoid suspend. Even 5 seconds between pings is still too much, it will suspend during those 5 seconds, then resume to do the next ping, and then the modem problem sometimes happens. I found that one ping every 2 seconds is frequent enough, then it does not try to suspend. The threshold is somewhere between 2 and 5 seconds, I did not find out more precisely than that.

What network are you on here in Germany? It might really be just Telekom.

One thing I am noticing is that I keep getting new APN entries. I have about 10 now. Is this normal?

I was thinking it might be an APN issue, but I’ve had mixed success trying to nail those down. Have you tried looking at what Telekom says the settings should be? Or if they even offer to?

That’s strange… I dunno, seems like the modem should be able to handle minutes of not doing anything. If you were to set it to 5 second pings at, say, 1400, when would you say the modem ends up suspending? Is it some minutes later?

Sorry to say: Telekom.

No, it is not only the provider. I didn’t really look into it, but there is an issue with a lot of information around concerning this problem:

When I set it to do a ping every 5 seconds, then it will suspend every time, and then resume when it is time for the ping. So it repeats the suspend+resume operation every 5 seconds then. And it almost always works, it is just rarely that the modem gets reset.

When I was testing that, with different ping scenarios to make it resume, I was hoping to at least be able to trigger the problem more often, to make it more reproducible. But it seems like no matter what I do, the probability per hour of the modem being reset is about the same, the problem seems to happen about once a day on average. Except if I do pings often enough so that it never suspends, then the problem does not happen.

It’s a difficult thing to debug because it happens so rarely. You have to wait many hours, sometimes several days, for the next time it happens.

If there was a way to provoke it to happen more frequently, that would make it much easier to debug.

1 Like

Ok so if Telekom is the problem what network is recommended? I’m leaning towards Aldi Talk myself.

I reworked my solution to reset the modem automatically when it vanishes and had this package build:

I’m actually testing it and so far it seems to do the same as my former manually installed version.

If you’d like to join the test… :wink:


Sure! Could you walk me through cleaning up the service I manually added?

From memory (do not have the stuff installed anymore :face_with_raised_eyebrow:):

  • Remove what you added to /etc/sudoers or /etc/sudoers.d/ by using visudo to uncomment/delete it
    • if you had the changes in its own file under /etc/sudoers.d/ it is save to delete it after uncommenting its content using visudo.
  • sytemctl --user stop watchmodem (or whatever you called the users service to watch the journal
  • delete the systemd service file in ~/.config/systemd/user/
  • systemctl --user daemon-reload to let systemd catch up with the missing file
  • remove the scripts and wherever you stored them - mine were in ~/bin/.

That should be all.

1 Like

done. Thanks! Got it installed. The installation should already start the service and enable it to auto start right?

I hope so. At least it happened in my L5.

If something isn’t working as before (with the manual install) any feedback would be very welcome!

1 Like

@chrichri A couple of improvement suggestions:

  1. ignore when modem hardware switch is toggled on or off - i think it should only watch for non user initiated disconnects,
  2. when toggling hardware switch it also tries to remount the sdcard when installed and unmounted, problem is when encrypted it now requires the user to enter the password when all the user wanted is enable modem, - can these actions be separated?
  1. maybe solved with 1.


Could you try ?


see comments on - so far no issues to report

Same here. No issues. Thanks for the efforts!


I wanted to test it again after having uninstalled it but after reinstall doesnt seem to work fyi:

sudo systemctl --user enable watchmodemFailed to connect to bus: $DBUS_SESSION_BUS_ADDRESS and $XDG_RUNTIME_DIR not defined (consider using --user to connect to bus of other user)

Mostly i had noticed a possible issue with the script where it would interfere possibly with the suspend-wakeup logic, the phone would end up not waking up properly after suspend (restart resolved the issue) bm818-tools uninstall or service stop also didnt cause wake from suspend to hang.

  • after installing the latest package the service should be enabled already and running
  • if you want to change it you need to sudo systemctl <command> without --user, because the service is now running as a --system service.