eg25manager always turns on GPS when waking up from sleep
#5
(02-17-2021, 03:24 AM)fdlamotte Wrote: To force your settings "above" eg25manager, as you say, you need to run your script after ... don't know exactly how to do it, but I presume udev has some priority mecanism in the executions at wakeup, I would dig that way

I've created a systemd service to run a script after resume from suspend:

/usr/lib/systemd/system/afterresume.service:
Code:
[Unit]
Description=After resume from suspend
After=suspend.target

[Service]
Type=simple
ExecStart=/usr/bin/aftersuspend.sh
Restart=on-failure

[Install]
WantedBy=suspend.target

Not sure about the Restart. I tried using eg25-manager.service in After but that doesn't run it when eg25manager runs after coming out of suspend.

As a 'hack' the script aftersuspend.sh has a 10 s sleep to make sure it runs the commands after eg25manager has sent its command.

/usr/bin/aftersuspend.sh:
Code:
#!/bin/sh

logger "After suspend script"
sleep 10
# send GPS off command
logger "After EG25-manager service: sending AT+QGSPEND"
mmcli -m any --command="AT+QGPSEND"
# send IMS off command
logger 'After EG25-manager service: sending AT+QCFG="ims",0'
mmcli -m any --command='AT+QCFG="ims",0'

Not exactly elegant, wish there was a way to run it after coming out of suspend and after eg25manager is run.

Chech GPS using:
Code:
mmcli -m any --command="AT+QGPS?"

Check IMS / VoLTE using:
Code:
mmcli -m any --command='AT+QCFG="ims"'

Systemd logs using:
Code:
sudo journalctl --since "2 minutes ago"
sudo journalctl -b (since boot)

You also have:
Code:
systemctl daemon-reload
systemctl enable afterresume.service
not sure if you also need
Code:
systemctl start afterresume.service
Pinephone v1.2 UBports CE. Adelaide, Australia using Amaysim SIM (Optus network, VoLTE enabled) with Mobian SD card. VoLTE working also with Felix / Vodafone AU and Aldimobile / Telstra AU.
Manjaro Plasma Mobile on EMMC.
  Reply


Messages In This Thread
RE: eg25manager always turns on GPS when waking up from sleep - by dcinoz - 02-18-2021, 06:44 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  no wakeup from deep-sleep jsch 8 3,903 09-05-2022, 03:03 AM
Last Post: jsch
  Mobian and Deep Sleep Crust some_pinephone_user 1 1,914 11-14-2021, 07:05 AM
Last Post: some_pinephone_user
  Deep sleep shutdown the phone bitsandnumbers 19 12,478 10-22-2021, 07:04 AM
Last Post: kqlnut
  Eliminate swiping/logging in when waking up from suspend? Zebulon Walton 5 3,964 08-13-2021, 06:15 PM
Last Post: Zebulon Walton
  SMS notification inconsistent and Wifi issue (waking up?) dcinoz 12 9,036 01-21-2021, 04:20 AM
Last Post: dcinoz
  Howto - automatically recover your modem and mobile data after deep sleep as400 23 18,314 01-05-2021, 08:14 AM
Last Post: scholbert
Information Receiving Call During Sleep Experiment/Experience RTP 1 2,839 11-05-2020, 03:47 PM
Last Post: dukla2000
  Proximity sensor always active - screen turns off randomly? bitnick 10 9,965 09-12-2020, 03:58 AM
Last Post: a-wai

Forum Jump:


Users browsing this thread: 1 Guest(s)