Howto - automatically recover your modem and mobile data after deep sleep
#1
As many of you know, there are problems with Mobile Data connection and modem waking up in a different state after deep sleep.
So I have come up with a solution that is automatic and does not require rebooting the phone.

Find it here --> https://gitlab.com/as400l/pp-modem-guard

Yes, I know it's nasty but the modem behaviour is so painfully unpredictable.
  Reply
#2
I have been using script that does "echo 0 > /sys/class/modem-power/modem-power/device/powered" to stop modem and then echo 1 to start it, just manually in case data stops working.

But having it restored to working state automatically is better, i will test and see how well your script works.

Edit: I have been testing this script on both mobian and arch, it does work so that makes it better but i have seen modem actually completely disappear, in that case running my script manually restores it to working state.
  Reply
#3
Hello AS400,

Sorry for the question, but what is the "connection name" ? How to identify it ?

If I try : "nmcli", I found :

        cdc-wdm0: déconnecté
        "cdc-wdm0"
        gsm (qmi_wwan, option1), hw
  Reply
#4
Hello @Gribouille,

It's the name you define in Settings --> Mobile --> Access point names.
Usually something like internet.

If you don't trust settings app, try "nmcli" when the modem is connected to mobile data. It will tell you the name of the connection.
I suggest one word name.
  Reply
#5
(11-23-2020, 03:25 AM)as400 Wrote: Yes, I know it's nasty but the modem behaviour is so painfully unpredictable.
Thank you very much. I was just starting to write a similar script to enable GPS on wakeup.

I don't know why you think it is nasty. It may not be optimal but there will be many ugly hacks required for systems integration on the Pinephone

Thanks once again.
LF
  Reply
#6
@Lousy Fisherman - well, maybe not exactly how it should look like Smile But as I said - this modem is absolutely unpredictable.

I just pushed a minor change to fix mobile data connection bring up problems.
  Reply
#7
(11-24-2020, 08:24 AM)as400 Wrote: Hello @Gribouille,

It's the name you define in Settings --> Mobile --> Access point names.
Usually something like internet.

If you don't trust settings app, try "nmcli" when the modem is connected to mobile data. It will tell you the name of the connection.
I suggest one word name.

Hello @as400,

In France, with Bouygues Telecom the 'Access point names' are detected. The following 'Access point names' proposed are :
  • Contrat Pro Data Illimité / a2bouygtel.com
  • B2Bouygtel / b2bouygtel.com
  • Forfait Data / ebouygtel.com
The last is the usual 'Acces point name', for Internet.

But for send or receive some SMS, I've added :
  • Bouygesmms / mmsbouygtel.com

As example, with 'Forfait Data ' with 'nmcli' :

Code:
cdc-wdm0: connecté à Forfait Data
    "cdc-wdm0"
    gsm (qmi_wwan, option1), hw, iface wwan0, mtu 1500
    ip6 par défaut

With my definition for MMS :

Code:
cdc-wdm0: connecté à Bouyguesmms
        "cdc-wdm0"
        gsm (qmi_wwan, option1), hw, iface wwan0, mtu 1500
        ip6 par défaut


So you have right to recommend only one word for define the 'Access point name', it's simpler to use in a script.
  Reply
#8
@Gribouille - I think I don't fully follow you. Is there some kind of problem ?
  Reply
#9
(12-04-2020, 06:28 AM)as400 Wrote: @Gribouille - I think I don't fully follow you. Is there some kind of problem ?

Dont't worry @as400, all is fine Smile

I've added the details for the Access Points, because is not clear with my phone provider.
  Reply
#10
Thank you for sharing this, its my favorite solution for downloading mms out of the ones I've seen.

If anyone has a problem downloading the files try adding the following the curl command in the donwload_messages function. This is definitely required for t-mobile and setting the dns-interface might be useful for other carriers.
Code:
-6 --dns-interface $INTERFACE


Also if the modem number keeps increasing due to crust you can use this line
Code:
MODEM_NUM=$(mmcli --list-modems | grep -oP "(?<=Modem/)[0-9]+")
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Amberol Mobile Music player(flatpak) biketool 0 53 06-19-2022, 07:16 AM
Last Post: biketool
  DNS Problems with Mobile Data arno_nuehm 27 4,095 05-16-2022, 04:14 PM
Last Post: henrythemouse
  Cellular data is working! drh 0 154 05-15-2022, 09:02 AM
Last Post: drh
  Mobile internet via cellular network mostly not working Anna 17 2,250 02-28-2022, 02:51 PM
Last Post: TRS-80
  sharing mobile data through usb tethering deb75 7 996 02-26-2022, 08:52 AM
Last Post: Zebulon Walton
  Phosh modem on/off effectiveness? Zebulon Walton 0 319 01-24-2022, 09:21 AM
Last Post: Zebulon Walton
  Reskinning Apps for Mobile biketool 6 754 12-05-2021, 02:30 PM
Last Post: biketool
  Mobile network mode setting not saved Zebulon Walton 3 1,310 12-05-2021, 12:12 AM
Last Post: bcnaz
  Mobian and Deep Sleep Crust some_pinephone_user 1 817 11-14-2021, 07:05 AM
Last Post: some_pinephone_user
  Modem suddenly not enabled when booting from eMMC Zebulon Walton 3 1,073 10-23-2021, 01:55 PM
Last Post: Zebulon Walton

Forum Jump:


Users browsing this thread: 2 Guest(s)