eg25manager always turns on GPS when waking up from sleep
#1
Hi,

I've just realised eg25manager always turns GPS on using the command:

AT+QGPS=1

when resuming from sleep.

You can check via:

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

1 is on, 0 off.

To turn off use the command:

Code:
mmcli -m any --command="AT+QGPSEND"

I've spotted this bug report:
https://gitlab.com/mobian1/devices/eg25-...-/issues/2

I don't understand the "GPS management is now disabled by default with 79974bc9 and can be activated with the -g command line option.
Leaving this issue open as it's just a workaround, I'll have to come up with a better solution later on."

That would suggest GPS should be OFF, no?

I tried to use systemd system-sleep by adding a shell script to send the OFF command to the modem but eg25manager always runs after system-sleep. Adding sleep 5 or 10 or 20 seconds just delays eg25manager running so modem is not found and the OFF command fails. eg25manager would turn it on anyway.

Note that Privacy -> Location Services is switched OFF. I assumed that meant the GPS was OFF too....
It doesn't help battery life, has this just changed explaining the larger battery drain noticed recently? Or is that something else?

How can I prevent eg25manager from sending the GPS ON command (other than running a script manually every time I wake up the Pinephone)?

Command to see eg25manager log from systemd:
Code:
sudo journalctl -b | grep eg25

Just did a few IMS tests.

Reboot phone, IMS is on, check via command:
Code:
mmcli -m any --command='AT+QCFG="IMS"'

If you disable it via:
Code:
mmcli -m any --command='AT+QCFG="IMS",0'
then the setting is kept when the phone wakes from sleep.

No idea why eg25manager would enable IMS by default. Guess phone still works with a non-IMS enable operator (no VoLTE).

Here is systemd log from boot showing the IMS on part:

Feb 17 16:34:56 mobian eg25manager[362]: Response: [+QCFG: "ims",0,0
Feb 17 16:34:56 mobian eg25manager[362]: Got a different result than expected, changing value...
Feb 17 16:34:56 mobian eg25manager[362]: (null)
Feb 17 16:34:56 mobian eg25manager[362]: Sending command: AT+QCFG="ims",1
Feb 17 16:34:56 mobian eg25manager[362]: Response: [OK]

Further look at eg25manager logs, at least the GPS is turned OFF when it suspends:

eg25manager[362]: system is about to suspend
eg25manager[362]: Sending command: AT+QGPSEND
eg25manager[362]: Response: [OK]
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
#2
it's all in at.c ...

I had the same problem because my phone works better with ims set to 0. I just recompiled my own eg25-manager with my own settings ...

It seems that lately voice is more reliable with ims set to 1 than before. Maybe because of the latest gnome-calls or the updates in callaudio ... I just received a new pp and am testing ims=1 on it, so far it hasn't failed
  Reply
#3
@fdlamotte

Yes, sure, recompile, but surely both IMS and GPS should be left alone, i.e. leave the modem as is? No doubt you agree, too.
And why should IMS be enabled by eg25manager? There should be a toggle in phosh. How many operators have VoLTE enabled?

Presumably you want GPS to stay on while you move around / have it on, even after the phone goes to sleep, no? Otherwise you turn GPS off. Should be a toggle in phosh like the Android location services toggle - presume that turns GPS on / off?! As it is the GPS is switched off as soon as the phone sleeps....

I understand the Privacy Location Services is simply supposed to control whether or not apps have access to location data, not technically whether the GPS is on or off. Hence missing GPS on / off toggle.

Annoying systemd system-sleep runs *before* eg25manager daemon - any idea how to overcome that? Other than modifying the code and recompiling my local version?

Thinking about the GPS a bit more, I presume there is no point in it being on when the phone is asleep as there is no buffer in the modem? Does it just return the GPS fix when queried at a given time? Not sure.
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
#4
in my opinion current eg25manager is just a workaround.

It seems that sometimes, modem parameters are lost and so a-wai idea is to force a consistent set of parameters to overcome the problem (and I think it was also megi's take but done in the kernel).

There should be a global consensus to do that (store and restore parameters) in a convenient way. eg25manager should in no way be tied to phosh as there are other UIs around (and official pinephone ui will be based on kde), phosh should not be tied to eg25 since it is used with other modems Wink

From latest pine64 news, it seems there is a work in progress that should make the modem work reliably. Maybe they are waiting on that before going further (that's what I would do)

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
  Reply
#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
#6
Update: Excellent work from eg25-manager author, there is now a configuration file for eg25-manager that can be used for this, see:
https://gitlab.com/mobian1/issues/-/issues/254
https://gitlab.com/mobian1/devices/eg25-manager

I've used

{ cmd = "QGPSEND" }

to turn GPS off (end) and

{ cmd = "QCFG", subcmd = "ims", value = "0" }

to turn off IMS / VoLTE.

I renamed the toml files in /usr/share/eg25-manager
and copied the 1.2.toml file to /etc/eg25-manager (create the directory)
and edited it as required.

I did a
Code:
sudo service eg25-manager restart
to make sure new settings are read.
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


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

Forum Jump:


Users browsing this thread: 1 Guest(s)