228 Commits

Author SHA1 Message Date
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
Arnaud Ferraris
c7e8d9171c d/changelog: release version 0.3.0-1 2021-05-28 13:59:53 +02:00
Arnaud Ferraris
5db68722ec New upstream version 0.3.0 2021-05-28 13:58:11 +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
432bd454bb d/changelog: release version 0.2.1-1 2021-02-21 16:42:15 +01:00
Arnaud Ferraris
986e7f08c4 New upstream version 0.2.1 2021-02-21 16:41:22 +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
4089f2ea6b d/changelog: release version 0.2.0-1 2021-02-20 22:27:18 +01:00
Arnaud Ferraris
c77c58df49 d/eg25-manager.service: remove deprecated -g option 2021-02-20 22:26:13 +01:00
Arnaud Ferraris
9e40ae11d6 data: add AT command reporting firmware version
Fixes #7
2021-02-20 20:12:21 +01:00
Arnaud Ferraris
5cc5ff5c0e d/gbp.conf: enable multimaint-merge 2021-02-20 17:21:37 +01:00
Arnaud Ferraris
6a81955086 New upstream version 0.2.0 2021-02-20 17:18:46 +01:00
Arnaud Ferraris
11c9cee111 meson.build: release version 0.2.0 0.2.0 2021-02-20 17:18:25 +01:00
Arnaud Ferraris
89ce52f709 Merge branch 'config' into 'master'
Implement config file

Closes #6

See merge request mobian1/devices/eg25-manager!8
2021-02-20 16:16:45 +00:00
Arnaud Ferraris
8a41a3203b data: add config files for all pinephone versions 2021-02-20 17:11:56 +01:00
Arnaud Ferraris
042de572ea at: parse config file
The AT commands list for each stage is now configured per-device, as 
well as the UART port to be used.

As this list can be changed by the user, there is no more need for a 
special GNSS-related option
2021-02-20 17:10:43 +01:00
Arnaud Ferraris
cfbbbd0167 gpio: parse config file
The GPIO numbers are now moved to the config file instead of being 
hardcoded.
2021-02-20 17:10:43 +01:00
Arnaud Ferraris
f276d9cf9e suspend: make timeouts configurable
Instead of fixed values, the modem boot timeout and recovery timeout are now
(optional) config values.
2021-02-20 17:10:01 +01:00
Arnaud Ferraris
433982e4f7 manager: parse config file
The need to use libusb to check for the modem state on startup now 
depends on a config option, instead of the device type. The USB PID and 
VID are moved to config as well.
2021-02-20 17:04:49 +01:00
Arnaud Ferraris
d9256251fd src: implement config file lookup and initial parsing
This commit prepares the use of device-specific configuration files. 
These files should be named after the device-tree `compatible` string 
with the `toml` extension.

`eg25-manager` will search for config files in 
`<prefix>/etc/eg25-manager` first (or `/etc/eg25-manager` if prefix is 
`/usr`), then in `<prefix>/share/eg25-manager`.
2021-02-20 17:04:49 +01:00
Arnaud Ferraris
c92746e875 src: add TOML parser 2021-02-20 17:04:49 +01:00