02-18-2021, 06:44 PM
(This post was last modified: 02-18-2021, 06:53 PM by dcinoz.
Edit Reason: file paths
)
(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
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.
Manjaro Plasma Mobile on EMMC.