PINE64
pinephone drops cellular network - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: PinePhone (https://forum.pine64.org/forumdisplay.php?fid=120)
+--- Forum: PinePhone Hardware (https://forum.pine64.org/forumdisplay.php?fid=122)
+--- Thread: pinephone drops cellular network (/showthread.php?tid=13885)

Pages: 1 2 3


RE: pinephone drops cellular network - Line - 07-07-2021

This is still a problem, not related to temperature. Psensor said ~25C on all when the SIM or the modem (I’m too n00b to know what or why) fell out. It’s back on after reboot, for an unknown amount of time before it falls out again.


RE: pinephone drops cellular network - zetabeta - 07-08-2021

(07-07-2021, 10:12 AM)Line Wrote: This is still a problem, not related to temperature. Psensor said ~25C on all when the SIM or the modem (I’m too n00b to know what or why) fell out. It’s back on after reboot, for an unknown amount of time before it falls out again.
i have this issue as well. and is partially reported https://gitlab.com/mobian1/issues/-/issues/251 . i use mobian.

i noticed that some sunxi kernels were removed from repositories but i still had them installed. i removed those kernels and see it if it improves it.

kernels i removed: 5.11 sunxi
kernels i run now: 5.10 sunxi


RE: pinephone drops cellular network - mouffa - 07-08-2021

the USB hub restarts randomly because the modem has sudden fluctuations of energy consumption, it specifically happens when you are issuing AT commands for the GPS or other configurations, you can write a script to check the modem in regular intervals and bring it back online with D-Bus and ofonoctl commands


RE: pinephone drops cellular network - ragreenburg - 07-25-2021

(07-08-2021, 06:43 AM)mouffa Wrote: the USB hub restarts randomly because the modem has sudden fluctuations of energy consumption, it specifically happens when you are issuing AT commands for the GPS or other configurations, you can write a script to check the modem in regular intervals and bring it back online with D-Bus and ofonoctl commands

What would a script like that look like?


RE: pinephone drops cellular network - mouffa - 07-25-2021

an easy way to check the modem is to use grep or awk to check the output of ofonoctl, if the modem is down it depends on how exactly it is down and then take the necessary steps according to the situation


RE: pinephone drops cellular network - 3Gluddite - 08-26-2021

(07-25-2021, 04:47 PM)ragreenburg Wrote: What would a script like that look like?

Sorry no one helped you at the time, but here's a thread with examples: https://forum.pine64.org/showthread.php?tid=14099

And here's a slightly modified/excessively commented version that I made a few days ago. You'll need to change the path of the logfile to something that makes sense for your setup, of course. Also, if you're using a non-systemd distro, the "systemctl" commands will be different. For example, in pmOS, "systemctl stop eg25-manager" would be replaced with "service eg25-manager stop".

Code:
#!/bin/bash

sleep 30s #Gives modem time to boot (in case this is run at startup)
modem=/dev/ttyUSB2 #Defines a variable representing the modem's USB connection

while : #Infinite loop
do
if test -c "$modem"; then #If the modem is accessible
  sleep 15s
  else #If the modem is inaccessible
  echo "Modem disconnected at" $(date -u) >> /home/alarm/Scripts/ModemSentinel.log #Prints GMT timestamped message to the logfile
  systemctl stop eg25-manager
  sleep 15s #Instantly restarting eg25-manager doesn't always work
  systemctl start eg25-manager
  sleep 40s #Modem takes a while to wake up
  if test ! -c "$modem"; then #If the modem is still not visible
    echo "Modem reconnection failed; rebooting system." >> /home/alarm/Scripts/ModemSentinel.log #Record failure to the logfile
    shutdown -r now #Reboot. If you're using Megi's multiboot image, reboots will get stuck at the boot menu. To avoid this, go to the boot menu, select your primary OS, and hold down the power button. This will make it so you boot directly to your primary OS, but the boot menu can still be accessed by holding volume down while turning the Pinephone on.
    else
    echo "Modem reconnected successfully." >> /home/alarm/Scripts/ModemSentinel.log #Record success to the logfile
  fi
fi
done



RE: pinephone drops cellular network - ragreenburg - 08-26-2021

(08-26-2021, 09:52 AM)3Gluddite Wrote:
(07-25-2021, 04:47 PM)ragreenburg Wrote: What would a script like that look like?

Sorry no one helped you at the time, but here's a thread with examples: https://forum.pine64.org/showthread.php?tid=14099

And here's a slightly modified/excessively commented version that I made a few days ago. You'll need to change the path of the logfile to something that makes sense for your setup, of course.

Code:
#!/bin/bash

sleep 30s #Gives modem time to boot (in case this is run at startup)
modem=/dev/ttyUSB2 #Defines a variable representing the modem's USB connection

while : #Infinite loop
do
if test -c "$modem"; then #If the modem is accessible
  sleep 15s
  else #If the modem is inaccessible
  echo "Modem disconnected at" $(date -u) >> /home/alarm/Scripts/ModemSentinel.log #Prints GMT timestamped message to the logfile
  systemctl stop eg25-manager
  sleep 15s #Instantly restarting eg25-manager doesn't always work
  systemctl start eg25-manager
  sleep 40s #Modem takes a while to wake up
  if test ! -c "$modem"; then #If the modem is still not visible
    echo "Modem reconnection failed; rebooting system." >> /home/alarm/Scripts/ModSent.log #Record failure to the logfile
    shutdown -r now #Reboot. If you're using Megi's multiboot image, reboots will get stuck at the boot menu. To avoid this, go to the boot menu, select your primary OS, and hold down the power button. This will make it so you boot directly to your primary OS, but the boot menu can still be accessed by holding volume down while turning the Pinephone on.
    else
    echo "Modem reconnected successfully." >> /home/alarm/Scripts/ModemSentinel.log #Record success to the logfile
  fi
fi
done

Thank you for this!


RE: pinephone drops cellular network - 3Gluddite - 08-26-2021

My pleasure. I've been having the same problem for a while, and workaround information is surprisingly difficult to find.

Feel free to share the script, of course. Hopefully, someone much smarter than me will see it and add a similar watchdog function directly to eg25-manager.


RE: pinephone drops cellular network - 3Gluddite - 09-02-2021

Reddit user Atticus83 has shared a modem resetting script that launches a GUI from the app drawer. His version is a one-shot instead of a watchdog and uses mmcli to check for the modem (probably more elegant than monitoring USB ports?), but it's the same general idea with the benefit of a pretty launcher.

A question to anyone who actually knows what he's doing: assuming that monitoring the modem's USB connections and running mmcli -m both work to detect a modem malfunction, does that give us any clues about what's actually going wrong with the modem?


RE: pinephone drops cellular network - eoj - 09-08-2021

I think I may be having this same issue. I have been playing with the GPS in my PinePhone, and have noticed in the past two days that my modem does not stay active for more than about 10 seconds. I don't have a SIM card in my phone, so I have been using screen to interact with the modem over ttyUSB2

Code:
sudo screen /dev/ttyUSB2 115200

I then issue the following command to turn GPS on and check the status of GPS

Code:
AT+QGPS?
+QGPS: 0

OK
AT+QGPS=1
OK
AT+QGPS?
+QGPS: 1

OK
AT+QGPS?
+QGPS: 0

OK

As can be seen above, the GPS status is 1 momentarily, and then returns to 0. During this time, NMEA messages are delivered on ttyUSB1, but then cease

I am using Manjaro ARM Plasma

Edit: I think my issue may be related to https://gitlab.manjaro.org/manjaro-arm/packages/community/phosh/eg25-manager/-/blob/master/26-fix.patch as sudo systemctl status eg25-manager shows it falls into the codepath linked here: https://gitlab.com/mobian1/devices/eg25-manager/-/blob/master/src/gnss.c#L225