Crash when starting eg25-manager
eg25-manager core dumps on startup, saying "Unable to get output GPIO 0".
I am packaging eg25-manager and writing service config for it on NixOS, since none existed up to now. I am testing on a PinePhone, and only have one test device. Therefore, I don't have a known-good setup to compare to. I may be able to test on other OSes if required but it would be tedious and I would prefer not to.
The below logs were taken on eg25-manager 0.4.5 with Linux kernel 5.11.2 and the PinePhone 1.2 motherboard. The modem is running stock firmware; the output of AT+QGMR is EG25GGBR07A08M2G_01.002.01.002. I have also tested eg25-manager 0.4.4 and 0.4.3, on the same kernel and motherboard, with very similar results. ModemManager is not running during the below logs, nor has it ever been running since the last hard power cycle, but NetworkManager is. Separately, I have tested with ModemManager running, with very similar results.
My setup is using the unmodified systemd unit file provided in the eg25-manager source. It is using a very slightly modified version of the PinePhone 1.2 config file provided in the source; specifically, I have patched the config to look for /dev/ttyUSB2 rather than for /dev/ttyS2, which I know to be the correct device node for the modem because I've tested it with picocom. Without this change I get a warning that the UART can't be found.
I'd appreciate any pointers on how to debug this. The modem definitely works and has a correctly installed SIM; when I start ModemManager, all expected functionality works except that I'm not yet in a position to test audio.
Here is the crash log.
Oct 01 00:53:08 Moss systemd[1]: Started Quectel EG25 modem.
Oct 01 00:53:08 Moss eg25-manager[4479]: Opening config file: /nix/store/x231587rhkp8vqzmr1
8dl4pikv8nbjvh-eg25-manager-0.4.5/share/eg25-manager/pine64,pinephone-1.2.toml
Oct 01 00:53:08 Moss eg25-manager[4479]: Unable to get output GPIO 0
Oct 01 00:53:08 Moss systemd[1]: Started Process Core Dump (PID 4480/UID 0).
Oct 01 00:53:08 Moss systemd-coredump[4481]: Process 4479 (eg25-manager) of user 0 dumped c
ore.
Module linux-vdso.so.1 with build-id 901a819a6
8b7ab9e4d04895123f0feb123e67158
Module libbrotlicommon.so.1 without build-id.
Module libm.so.6 with build-id e62af759130e530
802ba3c1de32466b8888e273d
Module libresolv.so.2 with build-id a16e3c4bd4
f8cadf8186621a6bc46bc8c88956a7
Module libkeyutils.so.1 without build-id.
Module libkrb5support.so.0 without build-id.
Module libcom_err.so.3 without build-id.
Module libk5crypto.so.3 without build-id.
Module libkrb5.so.3 without build-id.
Module libunistring.so.2 without build-id.
Module libdl.so.2 with build-id 515a1fce5a828f
fd00ac8117a276498f4b670631
Module libblkid.so.1 with build-id ecaf147a18c
68545824f04ed537120ab33555448
Module libbrotlidec.so.1 without build-id.
Module libzstd.so.1 without build-id.
Module libgssapi_krb5.so.2 without build-id.
Module libcrypto.so.1.1 with build-id ec163ab7
141abaa72fddf2bdbf4e2a82cd60fe05
Module libssl.so.1.1 with build-id d8c300716ed
21b2b55b9f9a9276a2855ed994272
Module libssh2.so.1 without build-id.
Module libidn2.so.0 without build-id.
Module libnghttp2.so.14 without build-id.
Module libpthread.so.0 with build-id fe2a445d1
17680ae34fc4513c9436b31697d58bd
Module libatomic.so.1 without build-id.
Module libudev.so.1 without build-id.
Module libffi.so.8 without build-id.
Module libselinux.so.1 without build-id.
Module libmount.so.1 with build-id 04717719798
501c95d36f30589c9d4d510d27ec3
Module libz.so.1 without build-id.
Module libgmodule-2.0.so.0 with build-id bfa038ab976afb22d6e756195de38da0c6cd3c61
Module libpcre.so.1 without build-id.
Module libc.so.6 with build-id d43a4dd9d5436168d2e79642b947f49bc80d99f1
Module libmm-glib.so.0 without build-id.
Module libcurl.so.4 with build-id 785d8b004e8236fc6748ca4653acfbcd01714329
Module libusb-1.0.so.0 without build-id.
Module libgpiod.so.2 without build-id.
Module libgudev-1.0.so.0 without build-id.
Module libgobject-2.0.so.0 with build-id 32e17b492bab6e8697c9bd31ce9d460cf5b19b81
Module libgio-2.0.so.0 with build-id 545bc44ffa08d6c6c50f4051e7e46ca40b2d6f0b
Module libglib-2.0.so.0 with build-id bfa45b343a181bb01b2564662019e350d7a6f902
Module eg25-manager without build-id.
Stack trace of thread 4479:
#0 0x0000ffffa95d18d8 __pthread_kill_implementation (libc.so.6 + 0x7b8d8)
#1 0x0000ffffa958f2b4 raise (libc.so.6 + 0x392b4)
#2 0x0000ffffa9beb260 g_log_default_handler (libglib-2.0.so.0 + 0x5e260)
#3 0x0000ffffa9beb49c g_logv (libglib-2.0.so.0 + 0x5e49c)
#4 0x0000ffffa9beb688 g_log (libglib-2.0.so.0 + 0x5e688)
#5 0x0000000000407484 gpio_init (eg25-manager + 0x7484)
#6 0x0000000000405968 main (eg25-manager + 0x5968)
#7 0x0000ffffa957d260 __libc_start_call_main (libc.so.6 + 0x27260)
#8 0x0000ffffa957d340 __libc_start_main@@GLIBC_2.34 (libc.so.6 + 0x27340)
#9 0x0000000000405b30 _start (eg25-manager + 0x5b30)
ELF object binary architecture: AARCH64
Oct 01 00:53:08 Moss systemd[1]: systemd-coredump@4-4480-0.service: Deactivated successfully.
Oct 01 00:53:08 Moss systemd[1]: eg25-manager.service: Main process exited, code=dumped, status=5/TRAP
Oct 01 00:53:08 Moss systemd[1]: eg25-manager.service: Failed with result 'core-dump'.
Oct 01 00:53:09 Moss systemd[1]: eg25-manager.service: Scheduled restart job, restart counter is at 5.
Oct 01 00:53:09 Moss systemd[1]: Stopped Quectel EG25 modem.
Oct 01 00:53:09 Moss systemd[1]: eg25-manager.service: Start request repeated too quickly.
Oct 01 00:53:09 Moss systemd[1]: eg25-manager.service: Failed with result 'core-dump'.
Oct 01 00:53:09 Moss systemd[1]: Failed to start Quectel EG25 modem.
Here is the config file.
[manager]
monitor_udev = true
usb_vid = 0x2c7c
usb_pid = 0x0125
# Delay between setting GPIO and PWRKEY sequence, set in microseconds
poweron_delay = 100000
# Uncomment the following if you need to change the modem detection timeout on
# resume and/or the time during which suspend is blocked after modem boot
#[suspend]
#boot_timeout = 120
#recovery_timeout = 9
[gpio]
chips = [ "1c20800.pinctrl" ]
dtr = { chip = 0, line = 34 }
pwrkey = { chip = 0, line = 35 }
reset = { chip = 0, line = 68 }
apready = { chip = 0, line = 231 }
disable = { chip = 0, line = 232 }
status = { chip = 0, line = 233 }
[at]
uart = "/dev/ttyUSB2"
configure = [
# Each command has 4 possible elements:
# * `cmd` : the AT command itself, which will be translated to "AT+`cmd`"
# * `subcmd`: the subcommand in case a single AT command can be used
# to change multiple parameters, such as QCFG (optional)
# * `value` : the commands, argument, usually used to set the value of
# a specific parameter (optional)
# * `expect`: the expected return value; the command is first executed
# without any value in order to query the current state. This
# state is then compared to the `expect` string; if they don't
# match, the command is then executed with value `expect` in
# order to set the parameter to the configured value (optional)
# A command can have `expect` OR `value` configured, but it shouldn't have both
# Print software version
{ cmd = "QGMR" },
# Configure audio
{ cmd = "QDAI", expect = "1,1,0,1,0,0,1,1" },
# RI signaling using physical RI pin
{ cmd = "QCFG", subcmd = "risignaltype", expect = "\"physical\"" },
# Enable VoLTE support
{ cmd = "QCFG", subcmd = "ims", expect = "1" },
# Enable APREADY for PP 1.2
{ cmd = "QCFG", subcmd = "apready", expect = "1,0,500" },
# URC configuration for PP 1.2 (APREADY pin connected):
# * RING URC: normal pulse length
# * Incoming SMS URC: default pulse length
# * Other URC: default length
# * Report URCs on all ports (serial and USB) for FOSS firmware
# * Reporting of URCs without any delay
# * Configure URC pin to UART Ring Indicator
{ cmd = "QCFG", subcmd = "urc/ri/ring", expect = "\"pulse\",120,1000,5000,\"off\",1" },
{ cmd = "QCFG", subcmd = "urc/ri/smsincoming", expect = "\"pulse\",120,1" },
{ cmd = "QCFG", subcmd = "urc/ri/other", expect = "\"off\",1,1" },
{ cmd = "QCFG", subcmd = "urc/delay", expect = "0" },
{ cmd = "QCFG", subcmd = "urc/cache", expect = "0" },
{ cmd = "QCFG", subcmd = "urc/ri/pin", expect = "uart_ri" },
{ cmd = "QURCCFG", subcmd = "urcport", expect = "\"all\"" },
# Allow sleeping for power saving
{ cmd = "QSCLK", value = "1" },
# GNSS configuration:
# * Enable A-GPS data upload support (XTRA)
# * Disable On-Demand-Positioning (ODP) mode
# to avoid running the GNSS system in the background, even when not enabled.
# * Enable Dynamic Power Optimizations (DPO) mode to turn off GNSS RF radios
# when they are not in use.
# * Only enable GPS and GLONASS, disable other GNSS systems.
# A-GPS data upload doesn't work for Galileo anyway.
# * Avoid turning on GNSS support automatically when the modem boots.
{ cmd = "QGPSXTRA", expect = "1" },
{ cmd = "QGPSCFG", subcmd = "gnssconfig", expect = "4" },
{ cmd = "QGPSCFG", subcmd = "odpcontrol", expect = "0" },
{ cmd = "QGPSCFG", subcmd = "dpoenable", expect = "1" },
{ cmd = "QGPSCFG", subcmd = "gpsnmeatype", expect = "31" },
{ cmd = "QGPSCFG", subcmd = "glonassnmeatype", expect = "7" },
{ cmd = "QGPSCFG", subcmd = "galileonmeatype", expect = "0" },
{ cmd = "QGPSCFG", subcmd = "beidounmeatype", expect = "0" },
{ cmd = "QGPSCFG", subcmd = "autogps", expect = "0" },
# Disable fast poweroff for stability
{ cmd = "QCFG", subcmd = "fast/poweroff", expect = "0" },
# Configure sleep and wake up pin levels to active low
{ cmd = "QCFG", subcmd = "sleepind/level", expect = "0" },
{ cmd = "QCFG", subcmd = "wakeupin/level", expect = "0,0" },
# Do not enter RAMDUMP mode, auto-reset instead
{ cmd = "QCFG", subcmd = "ApRstLevel", expect = "1" },
{ cmd = "QCFG", subcmd = "ModemRstLevel", expect = "1" },
]
suspend = [
]
resume = [
]
reset = [ { cmd = "CFUN", value = "1,1" } ]
[gnss]
enabled = true
url = "https://xtrapath4.izatcloud.net"
file = "xtra2.bin"
(edit: forgot to add code block syntax)