Modems are no longer detected if udev is not used
I am currently in the process of updating the ModemManager in openwrt master branch with the new release version 1.22.0 [1].
During this process I noticed, that no modem is recognized anymore. The problem are introduced by the following lines.
- https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/blob/main/src/plugins/ublox/77-mm-ublox-port-types.rules?ref_type=heads#L91
- https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/blob/main/src/plugins/ublox/77-mm-ublox-port-types.rules?ref_type=heads#L92
This change was added with commit f32a625a
The second ENV definition does not work for system that does not use udev to handle the rules See the following explanation in the code.
Log output:
Fri Oct 13 13:57:54 2023 daemon.notice [15490]: <msg> ModemManager (version 1.22.0) starting in system bus...
Fri Oct 13 13:57:55 2023 daemon.info ModemManager[15459]: hotplug: checking if ModemManager is available...
Fri Oct 13 13:57:55 2023 daemon.debug ModemManager[15459]: hotplug: cached event found: action=add, name=wwan1, subsystem=net, sysfspath=/sys/devices/pci0000:00/0000:00:13.0/usb2/2-1/2-1.3/2-1.3:1.4/net/wwan1
Fri Oct 13 13:57:55 2023 daemon.debug ModemManager[15459]: hotplug: event reported: action=add, name=wwan1, subsystem=net
Fri Oct 13 13:57:55 2023 daemon.info ModemManager[15459]: hotplug: interface 'wwan' is set to configure device '/sys/devices/pci0000:00/0000:00:13.0/usb2/2-1/2-1.3'
Fri Oct 13 13:57:55 2023 daemon.info ModemManager[15459]: hotplug: now waiting for modem at sysfs path /sys/devices/pci0000:00/0000:00:13.0/usb2/2-1/2-1.3
Fri Oct 13 13:57:55 2023 daemon.warn [15490]: <wrn> [base-manager] couldn't handle kernel event: Invalid rule match, wrong match type: ' ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1"'
Fri Oct 13 13:57:56 2023 daemon.debug ModemManager[15459]: hotplug: cached event found: action=add, name=cdc-wdm1, subsystem=usbmisc, sysfspath=/sys/devices/pci0000:00/0000:00:13.0/usb2/2-1/2-1.3/2-1.3:1.4/net/wwan1
Fri Oct 13 13:57:56 2023 daemon.debug ModemManager[15459]: hotplug: event reported: action=add, name=cdc-wdm1, subsystem=usbmisc
Fri Oct 13 13:57:56 2023 daemon.err ModemManager[15459]: hotplug: modem not detected at sysfs path
Fri Oct 13 13:57:56 2023 daemon.info ModemManager[15459]: hotplug: already waiting for modem at sysfs path /sys/devices/pci0000:00/0000:00:13.0/usb2/2-1/2-1.3
Fri Oct 13 13:57:56 2023 daemon.debug ModemManager[15459]: hotplug: cached event found: action=add, name=eth2, subsystem=net, sysfspath=/sys/devices/pci0000:00/0000:00:02.4/0000:03:00.0/net/eth2
Fri Oct 13 13:57:56 2023 daemon.debug ModemManager[15459]: hotplug: event reported: action=add, name=eth2, subsystem=net
Fri Oct 13 13:57:56 2023 daemon.warn [15490]: <wrn> [base-manager] couldn't handle kernel event: Invalid rule match, wrong match type: ' ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1"'
Fri Oct 13 13:57:56 2023 daemon.info ModemManager[15459]: hotplug: no need to wait for modem at sysfs path /sys/devices/pci0000:00/0000:00:02.4/0000:03:00.0
Fri Oct 13 13:57:56 2023 daemon.warn [15490]: <wrn> [base-manager] couldn't handle kernel event: Invalid rule match, wrong match type: ' ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1"'
Fri Oct 13 13:57:56 2023 daemon.debug ModemManager[15459]: hotplug: cached event found: action=add, name=eth0, subsystem=net, sysfspath=/sys/devices/pci0000:00/0000:00:02.2/0000:01:00.0/net/eth0
Fri Oct 13 13:57:56 2023 daemon.debug ModemManager[15459]: hotplug: event reported: action=add, name=eth0, subsystem=net
Fri Oct 13 13:57:56 2023 daemon.info ModemManager[15459]: hotplug: no need to wait for modem at sysfs path /sys/devices/pci0000:00/0000:00:02.2/0000:01:00.0
Fri Oct 13 13:57:56 2023 daemon.warn [15490]: <wrn> [base-manager] couldn't handle kernel event: Invalid rule match, wrong match type: ' ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1"'
Fri Oct 13 13:57:56 2023 daemon.debug ModemManager[15459]: hotplug: cached event found: action=add, name=wwan0, subsystem=net, sysfspath=/sys/devices/pci0000:00/0000:00:12.0/usb1/1-1/1-1.4/1-1.4:1.4/net/wwan0
Fri Oct 13 13:57:56 2023 daemon.debug ModemManager[15459]: hotplug: event reported: action=add, name=wwan0, subsystem=net
Fri Oct 13 13:57:56 2023 daemon.info ModemManager[15459]: hotplug: interface 'wwan2' is set to configure device '/sys/devices/pci0000:00/0000:00:12.0/usb1/1-1/1-1.4'
Fri Oct 13 13:57:56 2023 daemon.info ModemManager[15459]: hotplug: now waiting for modem at sysfs path /sys/devices/pci0000:00/0000:00:12.0/usb1/1-1/1-1.4
Fri Oct 13 13:57:56 2023 daemon.warn [15490]: <wrn> [base-manager] couldn't handle kernel event: Invalid rule match, wrong match type: ' ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1"'
Fri Oct 13 13:57:56 2023 daemon.debug ModemManager[15459]: hotplug: cached event found: action=add, name=cdc-wdm0, subsystem=usbmisc, sysfspath=/sys/devices/pci0000:00/0000:00:12.0/usb1/1-1/1-1.4/1-1.4:1.4/net/wwan0
Fri Oct 13 13:57:56 2023 daemon.debug ModemManager[15459]: hotplug: event reported: action=add, name=cdc-wdm0, subsystem=usbmisc
Fri Oct 13 13:57:56 2023 daemon.err ModemManager[15459]: hotplug: modem not detected at sysfs path
Fri Oct 13 13:57:56 2023 daemon.info ModemManager[15459]: hotplug: already waiting for modem at sysfs path /sys/devices/pci0000:00/0000:00:12.0/usb1/1-1/1-1.4
Fri Oct 13 13:57:56 2023 daemon.debug ModemManager[15459]: hotplug: cached event found: action=add, name=eth1, subsystem=net, sysfspath=/sys/devices/pci0000:00/0000:00:02.3/0000:02:00.0/net/eth1
Fri Oct 13 13:57:56 2023 daemon.debug ModemManager[15459]: hotplug: event reported: action=add, name=eth1, subsystem=net
Fri Oct 13 13:57:56 2023 daemon.warn [15490]: <wrn> [base-manager] couldn't handle kernel event: Invalid rule match, wrong match type: ' ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1"'
Fri Oct 13 13:57:56 2023 daemon.info ModemManager[15459]: hotplug: no need to wait for modem at sysfs path /sys/devices/pci0000:00/0000:00:02.3/0000:02:00.0
Fri Oct 13 13:57:56 2023 daemon.warn [15490]: <wrn> [base-manager] couldn't handle kernel event: Invalid rule match, wrong match type: ' ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1"'
Fri Oct 13 13:57:56 2023 daemon.debug ModemManager[15459]: hotplug: cached event found: action=add, name=ttyS2, subsystem=tty, sysfspath=/sys/devices/platform/serial8250/tty/ttyS2
Fri Oct 13 13:57:56 2023 daemon.debug ModemManager[15459]: hotplug: event reported: action=add, name=ttyS2, subsystem=tty
Fri Oct 13 13:57:56 2023 daemon.err ModemManager[15459]: hotplug: parent device sysfspath not found
Fri Oct 13 13:57:56 2023 daemon.debug ModemManager[15459]: hotplug: cached event found: action=add, name=ttyS0, subsystem=tty, sysfspath=/sys/devices/pnp0/00:02/tty/ttyS0
Fri Oct 13 13:57:56 2023 daemon.debug ModemManager[15459]: hotplug: event reported: action=add, name=ttyS0, subsystem=tty
Fri Oct 13 13:57:56 2023 daemon.warn [15490]: <wrn> [base-manager] couldn't handle kernel event: Invalid rule match, wrong match type: ' ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1"'
Fri Oct 13 13:57:56 2023 daemon.err ModemManager[15459]: hotplug: parent device sysfspath not found
Fri Oct 13 13:57:56 2023 daemon.debug ModemManager[15459]: hotplug: cached event found: action=add, name=ttyS3, subsystem=tty, sysfspath=/sys/devices/platform/serial8250/tty/ttyS3
Fri Oct 13 13:57:56 2023 daemon.debug ModemManager[15459]: hotplug: event reported: action=add, name=ttyS3, subsystem=tty
Fri Oct 13 13:57:56 2023 daemon.warn [15490]: <wrn> [base-manager] couldn't handle kernel event: Invalid rule match, wrong match type: ' ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1"'
Fri Oct 13 13:57:56 2023 daemon.err ModemManager[15459]: hotplug: parent device sysfspath not found
Fri Oct 13 13:57:56 2023 daemon.debug ModemManager[15459]: hotplug: cached event found: action=add, name=ttyS1, subsystem=tty, sysfspath=/sys/devices/platform/serial8250/tty/ttyS1
Fri Oct 13 13:57:56 2023 daemon.debug ModemManager[15459]: hotplug: event reported: action=add, name=ttyS1, subsystem=tty
Fri Oct 13 13:57:56 2023 daemon.warn [15490]: <wrn> [base-manager] couldn't handle kernel event: Invalid rule match, wrong match type: ' ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1"'
Fri Oct 13 13:57:56 2023 daemon.err ModemManager[15459]: hotplug: parent device sysfspath not found
Fri Oct 13 13:57:56 2023 daemon.debug ModemManager[15459]: hotplug: cached event found: action=add, name=ttyUSB0, subsystem=tty, sysfspath=/sys/devices/pci0000:00/0000:00:12.0/usb1/1-1/1-1.4/1-1.4:1.0/ttyUSB0/tty/ttyUSB0
Fri Oct 13 13:57:56 2023 daemon.debug ModemManager[15459]: hotplug: event reported: action=add, name=ttyUSB0, subsystem=tty
Fri Oct 13 13:57:56 2023 daemon.warn [15490]: <wrn> [base-manager] couldn't handle kernel event: Invalid rule match, wrong match type: ' ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1"'
Fri Oct 13 13:57:56 2023 daemon.info ModemManager[15459]: hotplug: already waiting for modem at sysfs path /sys/devices/pci0000:00/0000:00:12.0/usb1/1-1/1-1.4
Fri Oct 13 13:57:56 2023 daemon.debug ModemManager[15459]: hotplug: cached event found: action=add, name=ttyUSB1, subsystem=tty, sysfspath=/sys/devices/pci0000:00/0000:00:12.0/usb1/1-1/1-1.4/1-1.4:1.1/ttyUSB1/tty/ttyUSB1
Fri Oct 13 13:57:56 2023 daemon.debug ModemManager[15459]: hotplug: event reported: action=add, name=ttyUSB1, subsystem=tty
Fri Oct 13 13:57:56 2023 daemon.warn [15490]: <wrn> [base-manager] couldn't handle kernel event: Invalid rule match, wrong match type: ' ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1"'
Fri Oct 13 13:57:56 2023 daemon.info ModemManager[15459]: hotplug: already waiting for modem at sysfs path /sys/devices/pci0000:00/0000:00:12.0/usb1/1-1/1-1.4
Fri Oct 13 13:57:56 2023 daemon.debug ModemManager[15459]: hotplug: cached event found: action=add, name=ttyUSB2, subsystem=tty, sysfspath=/sys/devices/pci0000:00/0000:00:12.0/usb1/1-1/1-1.4/1-1.4:1.2/ttyUSB2/tty/ttyUSB2
Fri Oct 13 13:57:56 2023 daemon.debug ModemManager[15459]: hotplug: event reported: action=add, name=ttyUSB2, subsystem=tty
Fri Oct 13 13:57:56 2023 daemon.warn [15490]: <wrn> [base-manager] couldn't handle kernel event: Invalid rule match, wrong match type: ' ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1"'
Fri Oct 13 13:57:56 2023 daemon.info ModemManager[15459]: hotplug: already waiting for modem at sysfs path /sys/devices/pci0000:00/0000:00:12.0/usb1/1-1/1-1.4
Fri Oct 13 13:57:56 2023 daemon.debug ModemManager[15459]: hotplug: cached event found: action=add, name=ttyUSB3, subsystem=tty, sysfspath=/sys/devices/pci0000:00/0000:00:12.0/usb1/1-1/1-1.4/1-1.4:1.3/ttyUSB3/tty/ttyUSB3
Fri Oct 13 13:57:56 2023 daemon.debug ModemManager[15459]: hotplug: event reported: action=add, name=ttyUSB3, subsystem=tty
Fri Oct 13 13:57:56 2023 daemon.warn [15490]: <wrn> [base-manager] couldn't handle kernel event: Invalid rule match, wrong match type: ' ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1"'
Fri Oct 13 13:57:56 2023 daemon.info ModemManager[15459]: hotplug: already waiting for modem at sysfs path /sys/devices/pci0000:00/0000:00:12.0/usb1/1-1/1-1.4
Fri Oct 13 13:57:56 2023 daemon.debug ModemManager[15459]: hotplug: cached event found: action=add, name=ttyUSB4, subsystem=tty, sysfspath=/sys/devices/pci0000:00/0000:00:13.0/usb2/2-1/2-1.3/2-1.3:1.0/ttyUSB4/tty/ttyUSB4
Fri Oct 13 13:57:56 2023 daemon.debug ModemManager[15459]: hotplug: event reported: action=add, name=ttyUSB4, subsystem=tty
Fri Oct 13 13:57:56 2023 daemon.warn [15490]: <wrn> [base-manager] couldn't handle kernel event: Invalid rule match, wrong match type: ' ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1"'
Fri Oct 13 13:57:56 2023 daemon.info ModemManager[15459]: hotplug: already waiting for modem at sysfs path /sys/devices/pci0000:00/0000:00:13.0/usb2/2-1/2-1.3
Fri Oct 13 13:57:56 2023 daemon.debug ModemManager[15459]: hotplug: cached event found: action=add, name=ttyUSB5, subsystem=tty, sysfspath=/sys/devices/pci0000:00/0000:00:13.0/usb2/2-1/2-1.3/2-1.3:1.1/ttyUSB5/tty/ttyUSB5
Fri Oct 13 13:57:56 2023 daemon.debug ModemManager[15459]: hotplug: event reported: action=add, name=ttyUSB5, subsystem=tty
Fri Oct 13 13:57:56 2023 daemon.warn [15490]: <wrn> [base-manager] couldn't handle kernel event: Invalid rule match, wrong match type: ' ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1"'
Fri Oct 13 13:57:56 2023 daemon.info ModemManager[15459]: hotplug: already waiting for modem at sysfs path /sys/devices/pci0000:00/0000:00:13.0/usb2/2-1/2-1.3
Fri Oct 13 13:57:57 2023 daemon.debug ModemManager[15459]: hotplug: cached event found: action=add, name=ttyUSB6, subsystem=tty, sysfspath=/sys/devices/pci0000:00/0000:00:13.0/usb2/2-1/2-1.3/2-1.3:1.2/ttyUSB6/tty/ttyUSB6
Fri Oct 13 13:57:57 2023 daemon.debug ModemManager[15459]: hotplug: event reported: action=add, name=ttyUSB6, subsystem=tty
Fri Oct 13 13:57:57 2023 daemon.warn [15490]: <wrn> [base-manager] couldn't handle kernel event: Invalid rule match, wrong match type: ' ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1"'
Fri Oct 13 13:57:57 2023 daemon.info ModemManager[15459]: hotplug: already waiting for modem at sysfs path /sys/devices/pci0000:00/0000:00:13.0/usb2/2-1/2-1.3
Fri Oct 13 13:57:57 2023 daemon.debug ModemManager[15459]: hotplug: cached event found: action=add, name=ttyUSB7, subsystem=tty, sysfspath=/sys/devices/pci0000:00/0000:00:13.0/usb2/2-1/2-1.3/2-1.3:1.3/ttyUSB7/tty/ttyUSB7
Fri Oct 13 13:57:57 2023 daemon.debug ModemManager[15459]: hotplug: event reported: action=add, name=ttyUSB7, subsystem=tty
Fri Oct 13 13:57:57 2023 daemon.warn [15490]: <wrn> [base-manager] couldn't handle kernel event: Invalid rule match, wrong match type: ' ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1"'
Fri Oct 13 13:57:57 2023 daemon.info ModemManager[15459]: hotplug: already waiting for modem at sysfs path /sys/devices/pci0000:00/0000:00:13.0/usb2/2-1/2-1.3
Fri Oct 13 13:57:57 2023 daemon.warn [15490]: <wrn> [base-manager] couldn't handle kernel event: Invalid rule match, wrong match type: ' ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1"'