openwrt / packages

Community maintained packages for OpenWrt. Documentation for submitting pull requests is in CONTRIBUTING.md
GNU General Public License v2.0
3.94k stars 3.46k forks source link

ModemManager: Naming Devices (user-provided names) not working in OpenWRT #15360

Closed wicadmin closed 1 year ago

wicadmin commented 3 years ago

Maintainer: @aleksander0m Environment: x86 19.07

Description:

OpenWRT wouldn't connect when this is configured. mmcli 1.12.8

https://sigquit.wordpress.com/2016/10/06/naming-devices-in-modemmanager/

root@OpenWRT:~# cat 78-mm-naming.rules 
ACTION!="add|change|move", GOTO="mm_naming_rules_end"
DEVPATH=="/sys/devices/pci0000:00/0000:00:14.0/usb1/1-4",ENV{ID_MM_PHYSDEV_UID}="em7455"
LABEL="mm_naming_rules_end"
config interface 'wan1'
    option proto 'modemmanager'
    option device 'em7455'
    option apn 'r.ispsn'
    option delegate '0'
    option iptype 'ipv4'

mmcli -m em7455 works which is all I want to use this for but OpenWRT wouldn't connect is the side effect. Also tried (keeping it the default way) but didn't work:

config interface 'wan1'
    option proto 'modemmanager'
    option device '/sys/devices/pci0000:00/0000:00:14.0/usb1/1-4'
    option apn 'r.ispsn'
    option delegate '0'
    option iptype 'ipv4'
wicadmin commented 3 years ago

@dedeckeh @nbd168 - I'm not sure who to tag for netifd for this. Would you happen to know the correct maintainer/dev for this?

Per @aleksander0m, he believes the openwrt netitfd protocol handler requires the "device" to be the sysfs path. To support a static user-provided name in ModemManager, what would need to be changed in netifd?

Thanks.

aleksander0m commented 3 years ago

@wicadmin I think we should simplify this by asking the user to provide the sysfs path in the config file as well; so that:

Maybe a bit error prone? But I think that would be better than having the protocol handler read and parse the MM udev tags...

@nickberry17 what do you think?

feckert commented 1 year ago

@aleksander0m From my point of view, it is not perfect that the device option reports the sysfspath or an alias (if configured) on mmcli -m <number>. My colleague and I working on a change for the ModemManager to show an additional field that shows the configured alias via udev additional to the device sysfspath info. So we do not overwrite the device info with the alias name. If this is hopefully accepted upstream in the ModemManager, then we can continue with the alias here and add a new option and update the device handling in the ModemManager.