Quectel in the documentation for other Qualcomm-based modem explains
in details DPO (Dynamic Power Optimization), that is enabled on EG25-G
currently. One of requirements for DPO is, that XTRA almanac must be
less that 3.5 days old. [1]
Additionally SIMCOM says, that information predicted by XTRA is very
accurate within 24 hours, but its effectiveness decreases over time. [2]
Xtra3 files are available for 1 day (xtra3grc_24h.bin), 3
days (xtra3grc_72h.bin) and 7 days (xtra3grc.bin). Currently 7 days
variant is used.
Based on recommendations from Quectel and SIMCOM to slightly improve
GNSS performance switch default configuration to 24h XTRA variant.
1. https://sixfab.com/wp-content/uploads/2018/09/Quectel_UC20_GNSS_AT_Commands_Manual_V1.1.pdf
2. https://cdn.geekfactory.mx/sim7000g/SIM7000%20Series_GNSS_Application%20Note_V1.03.pdf
SUPL (Secure User-Plane Location) is protocol for A-GPS to receive
assistance data over Internet.
EG25-G has integrated SUPL client, that uses mobile data to
communicate with SUPL server and feed assisted data into GNSS
receiver. SUPL drastically improves TTFF (time to first fix) and is
much more effective than XTRA. To configure it user has to set SUPL
version (latest supported version is 2.0), select whether or not use
SSL, set address for SUPL server.
There are more tuning options in Quectel's documentation, but default
values are good to make SUPL work:
- AT+QGPSCFG="agpsposmode" Configure AGPS Positioning Mode
- AT+QGPSCFG="lbsapn" Configure AGNSS Positioning AP
- AT+QGPSCFG="agnssprotocol" Configure AGNSS Positioning Protocols
There are some usage aspects of SUPL to be aware of:
* modem uses mobile data to get information from SUPL server
* mobile data is used even if it's disabled in operating system
* firmware seems to try TLS 1.1, that is deprecated and not used in
production anymore. See [1].
* IMSI (International Mobile Subscriber Identity) of your SIM-card,
current cell Id and public IP are leaked to SUPL server.
It's recommended to setup proxy server to hide IMSI and IP from
SUPL server [2].
* all this information is visible in trafic dumps for network nodes
in between since there is no SSL
* SUPL requests with this information are not sent constantly, when
geolocation is enabled. They are sent, when information in GNSS
receiver is outdated.
SUPL servers that could be found on the Internet:
- supl.google.com (widely used, supports SSL and non-SSL)
- supl.grapheneos.org (supports only SSL, AFAIK just proxy to supl.google.com)
- supl.vodafone.com (resolves to supl.google.com)
- supl.qxwz.com (probably doesn't provide data outside of China, Chinese company)
- supl.nokia.com (is shutdown down)
The only working SUPL server is supl.google.com.
Support in ModemManager and Geoclue is already in
place. ModemManager shows agps-msb capability and Geoclue enables
agps-msb, when it's available. When precise geolocation is requested
and assisted information is missing in the modem (cold start), when
modem requests SUPL server for new assisted data.
SUPL was successfully tested with stock modem firmware 30.007.30.007
and community firmware v0.7.4.
For testing it was often needed to delete assistance data and enforce
cold start. Following script was used for this, it requires
ModemManager run in debug mode (--debug).
```
sudo mmcli -m any --command="AT+QGPSEND"
sleep 1
sudo mmcli -m any --command="AT+QGPSDEL=0"
sleep 1
sudo mmcli -m any --command="AT+QGPSDEL=3"
sleep 1
sudo mmcli -m any --command="AT+QGPSDEL=1"
sleep 1
sudo mmcli -m any --command="AT+QGPSDEL=0"
sleep 1
```
1. https://forums.quectel.com/t/a-gnss-msb-with-tls-on-eg25-g/39334
2. https://github.com/Eierkopp/supl-proxy
Tracking more GNSS constellations increases position availability,
especially when sky view is limited or small antennas are used.
BeiDou has global availability, modem does support A-GPS data for
BeiDou. When BeiDou is enabled, its satellites are used in fix
according to PQGSA messages in NMEA stream.
Galileo constellation is kept disabled, since modem doesn't support
assistance data for Galileo. When enabled, Galileo satellites usually
don't participate in the fix.
xtra2.bin contains assistance data only for GPS and GLONASS.
xtra3grc.bin – XTRA 3.0 files, providing GPS, GLO, and BDS assistance
data (protected by a digital signature). Switching to XTRA 3.0 files
is recommended to close CVE-2016-5341.
PP 1.2 and PPP configs were lacking this parameter. Although it's not a
problem as `eg25-manager` will then use a default value, adding them
won't harm and make them more consistent with other config files.
As the modem is connected to a dedicated audio codec, we can select any
sample rate. Let's go for 16K as it should improve call audio quality.
Note: the bitclock's frequency is left untouched due to a bug in the
EG25 kernel, so we can't take advantage of the recommended higher
frequency.
The PinePhone Pro uses the same EG25 modem as the OG PinePhone, but with
a different SoC. It also uses an ALC5616 audio codec directly hooked up
to the modem (which is I2S master in this case).
The config is therefore almost identical to the PinePhone rev1.2 except
for the gpios, UART port used and `AT+QDAI` config (to account for the
different audio setup).
Instead of assuming we're running on the PinePhone (and therefore
hardcoding gpiochip labels and line numbers), make all of those
configurable. Legacy config files will still be parsed as long as they
lack the `chips` key.
Existing config files are also updated to match the new config format.
Automatically fetch the GNSS assistance data from the Web
to heavily reduce the time to acquire a GNSS lock by uploading
the assistance data to the modem.
This feature is optional and can be disabled in the configuration
as people may prefer to not download the assistance data from
the Quectel/Qualcomm servers.
Also configure the GNSS engine to optimize the performance
and power consumption.
In some internal discussions between me,
the ModemManager maintainer and a Quectel engineer,
the URC cache we use is unnecessary.
I did some testing and removed the URC cache
from the configs and it works reliable without affecting
the functionality.
This brings the power on sequence in line with the EG25-G Hardware Design
datasheet, which states we need to wait at least 30 ms after VBAT becomes stable
before pulling PWRKEY low (first action of the power on sequene).
After this change the sequence becomes as follows:
- Set RESET_N high
- Wait 60 ms (double 30 ms)
- Execute PWRKEY sequence
60 ms was choosen because we don't know when VBAT becomes stable, but it should
be much less than an additional 30 ms. Empirical evidence suggests PinePhone
units with a healthy battery do not see serious side effects from not doing
this, while the modem will fail to boot and/or throw random errors on boot with
a worn out battery.
dquote> When using a custom kernel, if this setting is set to 'usbat' only, no RING urc is reported on any interface. Changing QURCCFG to 'all' makes the modem report RINGs on all supported interfaces, making receiving calls possible when using a custom firmware