pinephone drops cellular network
#17
(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!
  Reply


Messages In This Thread
pinephone drops cellular network - by Rainer - 05-12-2021, 08:52 AM
RE: pinephone drops cellular network - by Rainer - 05-13-2021, 09:02 AM
RE: pinephone drops cellular network - by rushop - 05-29-2021, 12:45 AM
RE: pinephone drops cellular network - by mouffa - 05-26-2021, 05:05 AM
RE: pinephone drops cellular network - by mudflap - 05-31-2021, 07:32 PM
RE: pinephone drops cellular network - by mouffa - 05-31-2021, 03:42 AM
RE: pinephone drops cellular network - by Line - 07-07-2021, 10:12 AM
RE: pinephone drops cellular network - by mouffa - 07-08-2021, 06:43 AM
RE: pinephone drops cellular network - by mouffa - 07-25-2021, 04:54 PM
RE: pinephone drops cellular network - by ragreenburg - 08-26-2021, 01:56 PM
RE: pinephone drops cellular network - by eoj - 09-08-2021, 04:22 PM
RE: pinephone drops cellular network - by goku499 - 09-13-2021, 04:28 AM
RE: pinephone drops cellular network - by goku499 - 09-14-2021, 02:00 PM
RE: pinephone drops cellular network - by bcnaz - 09-14-2021, 02:04 PM
RE: pinephone drops cellular network - by goku499 - 09-14-2021, 02:05 PM
RE: pinephone drops cellular network - by bcnaz - 09-14-2021, 03:11 PM
RE: pinephone drops cellular network - by goku499 - 09-14-2021, 04:03 PM
RE: pinephone drops cellular network - by bcnaz - 09-14-2021, 04:16 PM
RE: pinephone drops cellular network - by bcnaz - 09-17-2021, 03:49 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Bug PinePhone modem keeps "disappearing" Kevin Kofler 21 23,991 09-11-2026, 09:18 AM
Last Post: idice
  Pinephone + Keyboard for sale, little use ruemoo 18 15,918 08-23-2026, 12:17 AM
Last Post: Nambo
  Pinephone - broken power button rorus 14 26,506 05-17-2026, 03:52 PM
Last Post: EuvzO8
  PinePhone 16 GB – Free to a Good Home Anna 2 2,656 01-20-2026, 01:43 PM
Last Post: Anna
Sad PinePhone USB-C port and audio jack failure Kevin Kofler 4 9,127 12-11-2025, 08:57 AM
Last Post: jakfish
  Recycling pinephone as home server mdk 6 4,710 12-01-2025, 02:57 AM
Last Post: mdk
  PinePhone, PinePhone Pro, Keyboard/Accessories for sale brb78 5 3,714 11-30-2025, 05:45 AM
Last Post: biketool
  Modem Issues with the Pinephone Temmie19 5 7,284 07-02-2025, 12:50 PM
Last Post: biketool
Question Third-party cheap touchscreen/LCD for the Pinephone - lost knowledge? mikeb 2 5,415 06-21-2025, 05:19 PM
Last Post: mikeb
  Pinephone not booting sd card... bruv 1 3,978 03-25-2025, 08:51 PM
Last Post: Kevin Kofler

Forum Jump:


Users browsing this thread: 1 Guest(s)