Use modemManager without udev

Aleksander Morgado aleksander at aleksander.es
Fri May 21 07:36:34 UTC 2021


Hey,

>
>     I want use "mmcli --report-kernel-event " to access the modem, but the error occur as follow:
>
> root at NVTEVM:~$ mmcli --report-kernel-event="action=add,subsystem=tty,name=ttyUSB
> 0"
> ModemManager[601]: <debug> [1621557548.457821] [base-manager] kernel event reported:
> ModemManager[601]: <debug> [1621557548.457821] [base-manager] kernel event reported:
> ModemManager[601]: <debug> [1621557548.458234] [base-manager]   action:    add
> ModemManager[601]: <debug> [1621557548.458234] [base-manager]   action:    add
> ModemManager[601]: <debug> [1621557548.458467] [base-manager]   subsystem: tty
> ModemManager[601]: <debug> [1621557548.458467] [base-manager]   subsystem: tty
> ModemManager[601]: <debug> [1621557548.458790] [base-manager]   name:      ttyUSB0
> ModemManager[601]: <debug> [1621557548.458790] [base-manager]   name:      ttyUSB0
> ModemManager[601]: <debug> [1621557548.459218] [base-manager]   uid:       n/a
> ModemManager[601]: <debug> [1621557548.459218] [base-manager]   uid:       n/a
> ModemManager[601]: <warn>  [1621557548.499209] [base-manager] couldn't handle kernel event: No rule files found in '/lib/udev/rules.d'
> ModemManager[601]: <warn>  [1621557548.499209] [base-manager] couldn't handle kernel event: No rule files found in '/lib/udev/rules.d'
> error: couldn't report kernel event: 'GDBus.Error:org.freedesktop.ModemManager1.Error.Core.Failed: No rule files found in '/lib/udev/rules.d''
>

How did you install ModemManager? By default we install a series of
udev rules files in /lib/udev/rules.d and it looks like you didn't do
that. Those files are *required* even when you're not using udev,
because the daemon will look for them and parse them e.g. to know port
type hints or candidate rules. Without those files, nothing will work.

> Is it necessary to install the udev library ?

Using udev is definitely better and cleaner, but ModemManager can also
be used without udev by using the --report-kernel-event option to
report port add/remove events, as you were trying. E.g. the OpenWRT
setup does not use udev at all, we have some hotplug scripts that run
mmcli --report-kernel-event on every new event instead.

-- 
Aleksander
https://aleksander.es


More information about the ModemManager-devel mailing list