ModemManager 1.20.4 - invalid cast
Peter Naulls
peter at chocky.org
Fri Jan 6 15:18:09 UTC 2023
Background: I'm trying to implement a "bridge mode" with ModemManager. I have
this working with a legacy vendor connection manager, which uses direct qmi
library calls, and makes it impossible to use separate qmicli queries, as
well as being unsophisticated versus MM, and the monitoring scripts I have
on top of MM and friends are much more robust.
A "bridge mode" in this context is really just an IP pass though. There's a
lot of tricks to make this happen (including a hacked up qmi_wwan driver in my
case) and various ebtables etc rules. But in short, the IP address that is
normally assigned to the wwan0 interface is instead assigned to a LAN-side
DHCPing computer, and on the OpenWrt router, an ethernet bridge is setup
with wwan0 and eth0 (or whatever) and only has an 192.168.x.x address - this
is still accessible from the LAN-side due to redirect rules, etc.
There is much that I'm doing that is far from satisfactory here - I have
old vendor code and hacks that's been updated to more modern kernels, and
certainly this isn't really how ModemManager is expected to operate. Once
I have this somewhat working, I'll share what I have and explore improvement
options.
I have also created a netif script that's a copy of the existing ModemManager
one, except it doesn't assign local IPs.
In the meantime, I was able to trigger this problem; hopefully this is enough
debug. For what it's worth, I don't need to use mbim (or ppp) at all.
[19419]: <debug> [1673017294.072546] [/dev/cdc-wdm0] registered 'dsd' (version
1.0) client with ID '8'
[19419]: <debug> [1673017294.073581] [/dev/cdc-wdm0] sent message...
<<<<<< RAW:
<<<<<< length = 16
<<<<<< data = 01:0F:00:00:00:00:00:0E:22:00:04:00...
[19419]: <debug> [1673017294.074525] [/dev/cdc-wdm0] sent generic request
(translated)...
<<<<<< QMUX:
<<<<<< length = 15
<<<<<< flags = 0x00
<<<<<< service = "ctl"
<<<<<< client = 0
<<<<<< QMI:
<<<<<< flags = "none"
<<<<<< transaction = 14
<<<<<< tlv_length = 4
<<<<<< message = "Allocate CID" (0x0022)
<<<<<< TLV:
<<<<<< type = "Service" (0x01)
<<<<<< length = 1
<<<<<< value = 11
<<<<<< translated = sar
[19419]: <debug> [1673017294.133894] [/dev/cdc-wdm0] received message...
<<<<<< RAW:
<<<<<< length = 24
<<<<<< data = 01:17:00:80:00:00:01:0E:22:00:0C:00...
[19419]: <debug> [1673017294.134682] [/dev/cdc-wdm0] received generic response
(translated)...
<<<<<< QMUX:
<<<<<< length = 23
<<<<<< flags = 0x80
<<<<<< service = "ctl"
<<<<<< client = 0
<<<<<< QMI:
<<<<<< flags = "response"
<<<<<< transaction = 14
<<<<<< tlv_length = 12
<<<<<< message = "Allocate CID" (0x0022)
<<<<<< TLV:
<<<<<< type = "Result" (0x02)
<<<<<< length = 4
<<<<<< value = 00:00:00:00
<<<<<< translated = SUCCESS
<<<<<< TLV:
<<<<<< type = "Allocation Info" (0x01)
<<<<<< length = 2
<<<<<< value = 11:08
<<<<<< translated = [ service = 'sar' cid = '8' ]
[19419]: <debug> [1673017294.136213] [/dev/cdc-wdm0] registered 'sar' (version
1.0) client with ID '8'
[19419]: <debug> [1673017294.137506] [modem0] couldn't start parent
initialization: Couldn't open ports during modem initialization: Couldn't get
primary port
[19419]: <warn> [1673017294.146220] [modem0] modem couldn't be initialized:
Failed to load current capabilities: Couldn't peek client for service 'nas'
[19419]: <info> [1673017294.146670] [modem0] state changed (unknown -> failed)
[19419]: <debug> [1673017294.149693] [modem0] Voice capabilities not supported
[19419]: <debug> [1673017294.150518] [modem0] couldn't initialize interface:
'Voice not supported'
(ModemManager:19419): GLib-GObject-WARNING **: 15:01:34.152: invalid cast from
'MMBroadbandModemQmiQuectel' to 'MMBroadbandModemMbim'
**
ERROR:../src/mm-broadband-modem-mbim.c:284:mm_broadband_modem_mbim_peek_port_mbim:
assertion failed: (MM_IS_BROADBAND_MODEM_MBIM (self))
Bail out!
ERROR:../src/mm-broadband-modem-mbim.c:284:mm_broadband_modem_mbim_peek_port_mbim:
assertion failed: (MM_IS_BROADBAND_MODEM_MBIM (self))
Aborted
More information about the ModemManager-devel
mailing list