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
  Pinephone seems tobe using 4G data instead of Wifi data grump_fiddle_reinstall 1 797 06-25-2024, 10:38 AM
Last Post: mikehenson
  Mobile internet via cellular network mostly not working Anna 18 13,585 01-19-2024, 02:59 AM
Last Post: anonymous
  MODEM - Usb problem & couldn't query SIM slots: QMI protocol freelectro 5 4,372 06-06-2023, 06:36 AM
Last Post: freelectro
  4G data on default startup / boot dcinoz 1 1,191 04-29-2023, 11:24 PM
Last Post: dcinoz
  ModemManager debug mode? (Needed to flash modem) calinb 1 1,638 02-27-2023, 04:18 PM
Last Post: calinb
  Block firefix-esr-mobile-config from (re)installing itself grump_fiddle_reinstall 3 2,223 01-07-2023, 09:36 AM
Last Post: dcarvil
Exclamation No modems were found: No mobile data, no 2G anonymous 2 1,964 12-26-2022, 06:46 PM
Last Post: anonymous
  very slow processing of MMS received via Ting (T-Mobile) treebeard 6 3,674 12-01-2022, 09:18 AM
Last Post: traut
  DNS Problems with Mobile Data arno_nuehm 29 21,128 10-29-2022, 09:16 AM
Last Post: treebeard
  Modem Firmware Upgrade - Modem Busy - USB Issues biketool 10 6,372 09-23-2022, 05:15 AM
Last Post: biketool

Forum Jump:


Users browsing this thread: 3 Guest(s)