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 in Canada using Shaw mobile provider RRman 0 65 06-19-2021, 06:35 PM
Last Post: RRman
  Reboot Modem on Pinephone in Mobian eggmatters 5 539 06-17-2021, 02:08 PM
Last Post: eggmatters
  mobile data on mobian not working synaption 1 185 06-02-2021, 03:16 PM
Last Post: Aberts10
  How to access GPS data in Mobian ragreenburg 3 617 05-09-2021, 08:23 PM
Last Post: 8bit
  Pinephone not receiving SMS. SMS not showing on modem either. norbear 4 1,051 03-27-2021, 11:43 AM
Last Post: norbear
  Issues with Mobian 20210314 (data and updates) IMSAI8080 5 1,612 03-20-2021, 04:14 AM
Last Post: IMSAI8080
  Deep sleep shutdown the phone bitsandnumbers 7 1,064 03-09-2021, 07:01 AM
Last Post: yanikd
  lightdm-mobile-greeter mobian dawg161 0 430 03-08-2021, 08:59 PM
Last Post: dawg161
  Sylpheed, Nextcloud Screensize not for Mobile Franze_m 6 698 02-25-2021, 09:55 AM
Last Post: C0ffeeFreak
  eg25manager always turns on GPS when waking up from sleep dcinoz 5 731 02-21-2021, 05:06 PM
Last Post: dcinoz

Forum Jump:


Users browsing this thread: 1 Guest(s)