ModemManager auto connect & LuCI integration

Aleksander Morgado aleksander at aleksander.es
Wed Jan 17 11:07:36 UTC 2018


Hey!

>
> I just have a couple of questions regarding the operation of ModemManager and LuCI integration.
>
> 1. I have an interface configuration in /etc/config/network which reads very similarly to the one on the modemmanager-openwrt bitbucket readme file.  Upon startup of my system, the modem is always in the disabled state.  I have to manually enable it, and then issue the simple connect.  I thought that, but perhaps this is wrong, that modem manager would enable the interface and issue a connection command using the APN supplied in the network configuration file.  Can someone please explain how I should go about automatically connecting?  I have tried setting autoconnect ‘1' in the configuration as well.
>
> Is the only real way to get an automatic connection from boot/reboot to have a script to read the /etc/config/network file for the interface using ‘modemmanager’ as the protocol?
>

Oh no no, there's something broken somewhere, because all that
(enabling, connection up...) should be managed by netifd and the
"modemmanager" protocol handler also included in the repository. See:
https://bitbucket.org/aleksander0m/modemmanager-openwrt/src/8c553f2a1c090abf4da0f4e762ab6cec22d00557/modemmanager/files/modemmanager.proto?at=master&fileviewer=file-view-default

Once you have configured the interface with the "modemmanager" proto,
you should be able to start or stop it just with "ifup broadband" or
"ifdown broadband" (if you named "broadband" the interface section in
the settings).

> 2.  I think this question is better suited to the lede/openwrt forum.  I have created a working LuCI Protocol for ModemManager which creates the interface as described above.  However, I believe the ability to start/stop this connection from LuCI would be of great advantage to the user.  Unless I am doing something above incorrectly, how can I let ModemManager to detect changes to the interface?
>
>
> This is the config file on the bitbucket page:
>  Once installed, you can configure the 2G/3G/4G modem connections directly in
>    /etc/config/network as in the following example:
>
>     config interface 'broadband'
>         option device   '/sys/devices/platform/soc/20980000.usb/usb1/1-1/1-1.2/1-1.2.1'
>         option proto    'modemmanager'
>         option apn      'ac.vodafone.es'
>         option username 'vodafone'
>         option password 'vodafone'
>         option pincode  '7423'
>         option lowpower ‘1'
>
> Mine is like this
>
> config interface ‘broadband’
>         option device ‘/dev/cdc-wdm0’
>         option proto ‘modemmanager’
>         option apn ‘live.vodafone.com’
>

Why device "/dev/cdc-wdm0"? I don't suggest that at all, although I
know openwrt/lede has done that for a long time. The sysfs based
"device" setting as in the "modemmanager" protocol handler should be
really the preferred way to handle this, if the modem is built-in the
router device. is it?


-- 
Aleksander
https://aleksander.es


More information about the ModemManager-devel mailing list