Commit Graph

112 Commits

Author SHA1 Message Date
ArenM
ad1d6e5d3e gnss: increase upload timeout to 10 seconds
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.
2021-09-28 16:48:11 -04:00
ArenM
6177c7167c gnss: use sendfile to upload xtra data
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.
2021-09-27 13:57:57 -04:00
ArenM
750c41cbb5 gnss: rearrange enable_mm_gnss so it doesn't noop 2021-09-27 13:57:57 -04:00
Arnaud Ferraris
0d2b0e326a Merge branch 'gnss-upload-failure' into 'master'
gnss: properly clean temporary file before downloading assistance data

Closes #17

See merge request mobian1/devices/eg25-manager!27
2021-09-27 17:51:22 +00:00
Dylan Van Assche
41511cbc5f gnss: truncate temporary file before download
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.
2021-09-07 09:02:48 +02:00
Dylan Van Assche
8913300997 gnss: open temporary file as read/write
Opening as write-only may cause undefined behavior when reading the file
2021-09-07 07:28:34 +02:00
Dylan Van Assche
7b96296938 at: fix indentation 2021-09-03 21:33:05 +02:00
Arnaud Ferraris
c11f68f402 meson.build: release v0.4.0 0.4.0 2021-09-01 00:40:38 +02:00
Arnaud Ferraris
e6df81778e Merge branch 'handle-sim-unlock' into 'master'
gnss: handle locked SIM

See merge request mobian1/devices/eg25-manager!25
2021-08-12 10:17:02 +00:00
Dylan Van Assche
ef94492b30 gnss: handle locked SIM
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.
2021-08-12 11:19:45 +02:00
Dylan Van Assche
75570e45da gpio: extend softsleep wake time
50ms is way to short for the Quectel firmware to react, increase to 200ms
2021-08-12 11:19:21 +02:00
Arnaud Ferraris
34c3b19f70 Merge branch 'modem-power-cfgs' into 'master'
config: synchronize with modem-power

See merge request mobian1/devices/eg25-manager!18
2021-08-11 13:43:06 +00:00
Dylan Van Assche
10ec1119fb at: fast/poweroff is only available in newer firmware versions
Do not retry the AT command of the fast/poweroff setting as it may not be supported by the firmware
2021-08-11 12:58:06 +02:00
Dylan Van Assche
898c0dc79c config: synchronize with modem-power
We cannot assume default factory values if other drivers change them
2021-08-11 12:56:42 +02:00
Arnaud Ferraris
6b3bc5660a Merge branch 'gps-support' into 'master'
gnss: GNSS assistance support

Closes mobian1/issues#253 and #2

See merge request mobian1/devices/eg25-manager!15
2021-08-10 20:58:26 +00:00
Arnaud Ferraris
128483354b udev: remove reset quirk
It seems to work just fine with MM's quick suspend/resume.
2021-08-10 22:27:07 +02:00
Dylan Van Assche
9cfe782f74 gnss: add GNSS assistance support
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.
2021-06-21 07:54:39 +02:00
Dylan Van Assche
5da7c88fc4 at: allow custom callbacks for AT command response processing 2021-06-21 07:53:44 +02:00
Dylan Van Assche
dac50e34eb at: log expected result before setting it to NULL
Otherwise the log contains NULL instead of the expected value, making it hard to debug
2021-06-21 07:53:39 +02:00
Dylan Van Assche
9646e0e8df at: make next_at_command, send_at_command, process_at_result, and append_at_command public methods
Allows other modules to send AT commands as well
2021-06-21 07:53:33 +02:00
Dylan Van Assche
9c4a934a51 at: g_free doesn't require NULL checking
From the docs: If mem is NULL it simply returns, so there is no need to check mem against NULL before calling this function.
2021-06-21 07:53:28 +02:00
Arnaud Ferraris
f2593b62b1 Merge branch 'soft-sleep-runtime' into 'master'
at: wake only when sending AT commands

Closes #12

See merge request mobian1/devices/eg25-manager!21
2021-06-17 09:35:39 +00:00
Arnaud Ferraris
73fb60e0ad Merge branch 'fix-parallel-build' into 'master'
Fix parallel build issue

Closes #14

See merge request mobian1/devices/eg25-manager!22
2021-06-17 09:34:01 +00:00
Natanael Copa
63ba5e2d60 Fix parallel build issue
Tell meson that the generated gdbofono headers are needed at compile
time.

fixes https://gitlab.com/mobian1/devices/eg25-manager/-/issues/14
2021-06-03 17:51:57 +02:00
Dylan Van Assche
e690e2a17d at: wake only when sending AT commands
Allow the modem to enter soft sleep when
we don't talk to the modem using AT commands.
This was already the case in suspend, but
not during runtime. By only waking the modem
from soft sleep when we need to send
an AT command, we can save some power.
2021-05-23 20:13:16 +02:00
Arnaud Ferraris
64145acbae Merge branch 'mm-cleanup' into 'master'
mm-iface: clean out modem_iface if mm disappears

See merge request mobian1/devices/eg25-manager!17
2021-04-15 15:48:02 +00:00
Bhushan Shah
705950bb39 mm-iface: clean out modem_iface if mm disappears
otherwise we will be stuck in state where restarting of mm will not
reset the modem_iface and it will loop through hard resetting modem
2021-04-15 11:08:06 +05:30
Arnaud Ferraris
73e16f7699 meson.build: release version 0.3.0 0.3.0 2021-04-09 11:29:26 +02:00
Arnaud Ferraris
3d21b0fc9e Merge branch 'direct-udev' into 'master'
udev: use the udev rules directly to set attr

See merge request mobian1/devices/eg25-manager!12
2021-04-09 09:23:51 +00:00
Bhushan Shah
0d46f42d78 udev: match only USB device and not USB interfaces
Interfaces can not have a power control, only usb devices.
2021-04-09 14:39:53 +05:30
Arnaud Ferraris
1fd9d7d634 Merge branch 'no-urc-cache' into 'master'
config: drop URC cache

Closes #9

See merge request mobian1/devices/eg25-manager!14
2021-04-09 09:08:22 +00:00
Dylan Van Assche
d665ea9639 config: drop URC cache
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.
2021-04-09 10:35:27 +02:00
Arnaud Ferraris
68e4b2c5b4 Merge branch 'sfos' into 'master'
Allow to build without mmglib

See merge request mobian1/devices/eg25-manager!13
2021-04-09 07:53:32 +00:00
Adam Pigg
dfeab4c79b Re-order mmglib checking as per suggestion 2021-04-09 08:44:17 +01:00
Adam Pigg
40136c2a52 Allow to build without mmglib 2021-04-05 17:11:17 +01:00
Bhushan Shah
84a0ae603d udev: use the udev rules directly to set attr
We don't need complicated script for this, we can just set required
attributes using udev rules.
2021-03-26 13:56:37 +05:30
Arnaud Ferraris
ea19b0271c Merge branch 'master' into 'master'
Add a 100ms delay before PWRKEY sequence

See merge request mobian1/devices/eg25-manager!11
2021-03-17 21:37:53 +00:00
Djhg2000
528fe7e07c Add a 100ms delay before PWRKEY sequence
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.
2021-03-17 19:11:36 +01:00
Arnaud Ferraris
bd5b5a5cf8 Merge branch 'ofono' into 'master'
add ofono-iface

See merge request mobian1/devices/eg25-manager!6
2021-03-15 10:24:35 +00:00
Arnaud Ferraris
ef707c9a33 Merge branch 'qurccfg_all' into 'master'
Set URC config to 'all' instead of 'usbat'

See merge request mobian1/devices/eg25-manager!10
2021-03-15 10:21:25 +00:00
Bhushan Shah
2e7a5a696b ofono-iface: add spdx copyright info 2021-03-15 12:30:16 +05:30
Bhushan Shah
52488d2e2a suspend: if we are using ofono, mark modem as resumed immediately 2021-03-15 12:30:16 +05:30
Bhushan Shah
032bd4651c at: if we are using ofono, don't query modem manager for state 2021-03-15 12:30:16 +05:30
Bhushan Shah
060dc9ae32 src: watch ofono service for new modem
If system is using ofono, use ofono dbus service to figure out the
modem's USB id.
2021-03-15 12:30:16 +05:30
Oliver Smith
dcb1a9a050 src: add ofono-iface
Start work on new ofono interface. So far, this detects ofono on dbus
and complains if both mm and ofono are running.
2021-03-15 12:29:08 +05:30
Biktor
04eed2496d Set URC config to 'all' instead of 'usbat'
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
2021-02-24 12:32:46 +01:00
Arnaud Ferraris
3d076e8bc8 README: add details about config files 0.2.1 2021-02-21 16:40:36 +01:00
Arnaud Ferraris
2e7bf44f2d Merge branch 'at-value-expected-switched' into 'master'
at: fix argument order

See merge request mobian1/devices/eg25-manager!9
2021-02-21 15:37:36 +00:00
Dylan Van Assche
3bf2d785bb at: fix argument order
'expected' and 'value' parts of the AT command were switched.
2021-02-21 16:27:30 +01:00
Arnaud Ferraris
9e40ae11d6 data: add AT command reporting firmware version
Fixes #7
2021-02-20 20:12:21 +01:00