In some cases, there might be an issue with `eg25-manager` trying to
reset the modem while it's being configured. This leads to infinite boot
loops where the modem is constantly reset soon after it booted.
Fixes#24
write(2) might return less than expected due to various reasons.
Therefore, unless we are dealing with a critical error, it must be
called in a loop until all bytes are written.
This will print the error message from curl instead of just the http
status code if downloading gpsOneXtra data fails. It also adds checks
for other errors that are likely to occur.
This will print the error message from curl instead of just the http
status code if downloading gpsOneXtra data fails. This also removes the
need to check to check the size of the file curl downloaded.
The timeout for QFUPL defaults to 5 seconds which is about how long it
takes to upload data under ideal circumstances.
I'm not sure if this will actually have an effect, the docs say
"<timeout> The time waiting for data to be inputted to USB/UART. The
default value is 5. Unit: s." which could be the time before the first
byte is received.
This should make the data upload much faster because it handles
incomplete writes better, and because it the kernel copies the data
between the files directly, and it doesn't get sent to userspace and
back.
A temporary file is used to download the GNSS assistance data.
It's created and truncated at initialization, but not truncated
when a re-upload is necessary (when data expires).
This causes to corrupt the GNSS assistance data if the new downloaded
data is smaller than the previous download.
Additional security options in kernel config make it more picky,
removing problematic directives (`DeviceAllow` and `ProtectClock`) from
the service file helps getting things straight.
Other options aren't recognized by our systemd version
(`ProtectKernelModules`, `ProtectProc`, `ProtectDevices` and
`ProtectKernelLog`), so we can just as well remove those.
ModemManager Location service is only available after SIM unlock
and network registration.
Track service separately to avoid an assert error and crashes.
GNSS assistance data is uploaded when the service becomes available.
With eg25-manager directly interfacing with the untrusted modem and
potentially (MR !15) including libcurl for HTTP, sandboxing the daemon
significantly reduces the any post-exploit attack surface.
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.