Luci-proto-modemmanager support thread

Thanks for the insight, so then i just ran a git revert on that commit, rebuilding n ow to see how it goes.

❯ git revert 0fb5d3ed2cb31a0a6076d36fb7a668cfe5328c92

yupp, correct builds fine and works with this reversion

Has this now been fix in packages? I'm having no success with revert and my build still fails right after luci-proto-modemmanager install step.

I'm not able to make openwrt-19.07 because of "missing separator" error, what is it? I show the log:

make[2]: Entering directory '/home/mint/Scrivania/openwrt/feeds/luci_proto_modemmanager/luci-proto-modemmanager'
Makefile:54: *** missing separator.  Stop.
make[2]: Leaving directory '/home/mint/Scrivania/openwrt/feeds/luci_proto_modemmanager/luci-proto-modemmanager'
time: package/feeds/luci_proto_modemmanager/luci-proto-modemmanager/download#0.12#0.03#0.17
make[1]: *** [package/Makefile:113: package/feeds/luci_proto_modemmanager/luci-proto-modemmanager/download] Error 2
make[1]: Leaving directory '/home/mint/Scrivania/openwrt'
make[1]: Entering directory '/home/mint/Scrivania/openwrt'
make[2]: Entering directory '/home/mint/Scrivania/openwrt/target/linux'
make[3]: Entering directory '/home/mint/Scrivania/openwrt/target/linux/ramips'
make[3]: Nothing to be done for 'download'.
make[3]: Leaving directory '/home/mint/Scrivania/openwrt/target/linux/ramips'
make[2]: Leaving directory '/home/mint/Scrivania/openwrt/target/linux'
time: target/linux/download#0.05#0.02#0.08

Usually in feeds, luci_proto_modemmanager is within the luci feed directory. Are you using a custom or other feed than the official luci?

~/openwrt/feeds/luci/protocols/luci-proto-modemmanager

I added src-git luci_proto_modemmanager https://github.com/nickberry17/luci-proto-modemmanager.git inside feeds.conf like I read here:
https://github.com/nickberry17/luci-proto-modemmanager

That one is outdated and uses the old lua framework instead of javascript for luci. This capability is now in official openwrt/luci git repo. However, per this thread looks like someone issued a commit that broke a dependency library (dbus in openwrt/packages repo).

https://github.com/openwrt/luci/tree/master/protocols/luci-proto-modemmanager

What I have to add in feeds.conf.default? I'm building a 19.07-snapshot

It should already have luci feed, therefore you should be all set. Just select the luci-proto-modemmanager in menuconfig.

Unfortunately not in 19.07. I made v21.02.0-rc1 and here ModemManager works like a sharm but vice versa Watchcat doesn't works and I need it to restart the interface because every 3-4 hours I loose internet connection.

Can you recommend me another method to ping and restart ModemManager?

19.07 openwrt/luci repo didn't have luci-proto-modemmanger (my mistake, sorry it has been a while), it was required to get it from master for use in 19.07 branch. I actually compile all the ipk nightly for the latest modemmanager updates for 19.07. You can find that here:
https://gitlab.freedesktop.org/wicadmin/openwrt-modemmanager-packages/-/jobs/artifacts/master/download?job=package

In v21.02.0-rc1, you can try something like foolsm which you can then have call a script where you'll then be able to reset/restart ModemManager.

You can also look into this:
https://github.com/nickberry17/modem-manager-keepalive

Ref:
https://forum.openwrt.org/t/modemmanager-hotplug-script-request-for-review/42306

Ok I created 30-keepalive_modemmanager script inside /etc/hotplug.d/iface/ but now I don't know what else do. I have to eneble it?

Not sure. I don't think so. The maintainer is on this thread so he'll be able to answer more definitively.

I'm still using foolsm (https://lsm.foobar.fi) which I had setup before his hotplug was made available.

Hi I have a quectel ep06 and I can't get it to connect in qmi mode below is the log:

user.notice ModemManager: hotplug: error: parent device sysfspath not found
daemon.notice netifd: skinny (18348): modem available at /org/freedesktop/ModemManager1/Modem/2
daemon.notice netifd: skinny (18348): starting connection with apn 'skinnybroadband'...
Fri Aug 20 07:20:51 2021 daemon.notice netifd: skinny (18348): error: modem has no Simple capabilities
user.notice firewall: Reloading firewall due to ifup of Kids_Lan (br-Kids_Lan)
daemon.notice netifd: skinny (18453): stopping network
daemon.notice netifd: skinny (18453): couldn't load bearer path
daemon.notice netifd: Interface 'skinny' is now down

Any idea what I'm doing wrong ?

How did you confirm it is in QMI mode? Can you please ensure that the device option is set correctly on the ModemManager interface? Use mmcli -m any to get the Device sysfs string.

1 Like

If you place it in that directory then you don't have to do anything else, but your ModemManager interface has to be called mobiledata

I fired up socat and set it to QMI mode via AT commands as per the datasheet.
below is the commands I set QMI mode and to force LTE band:

at+qcfg="nwscanmode",3
at+qcfg="usbnet",0

i also set Raw IP mode as below:

echo Y >/sys/class/net/wwan0/qmi/raw_ip

See below with an attempted connection:

root@OpenWrt:~# mmcli -m 0 --simple-connect="apn=mobile.o2.co.uk,user=user,passw
ord=password"
error: modem has no Simple capabilities
root@OpenWrt:~# mmcli -m 0
  -----------------------------------
  General  |                    path: /org/freedesktop/ModemManager1/Modem/0
           |               device id: c5d7f7f03561b92a9a61987ac8e94953f8f790cd
  -----------------------------------
  Hardware |            manufacturer: Quectel
           |                   model: EP06-E
           |       firmware revision: EP06ELAR03A08M4G
           |          carrier config: ROW_Generic_3GPP
           | carrier config revision: 06010821
           |            h/w revision: 20000
           |               supported: gsm-umts, lte
           |                 current: gsm-umts, lte
           |            equipment id: 862967031181149
  -----------------------------------
  System   |                  device: /sys/devices/platform/soc/60f8800.usb2/6000000.dwc3/xhci-hcd.1.auto/usb3/3-1
           |                 drivers: qmi_wwan, option1
           |                  plugin: quectel
           |            primary port: cdc-wdm0
           |                   ports: cdc-wdm0 (qmi), ttyUSB0 (qcdm), ttyUSB1 (gps), 
           |                          ttyUSB2 (at), ttyUSB3 (at), wwan0 (net)
  -----------------------------------
  Status   |                   state: failed
           |           failed reason: sim-missing
           |             power state: on
           |          signal quality: 0% (cached)
  -----------------------------------
  Modes    |               supported: allowed: 3g; preferred: none
           |                          allowed: 4g; preferred: none
           |                          allowed: 3g, 4g; preferred: 4g
           |                          allowed: 3g, 4g; preferred: 3g
           |                 current: allowed: any; preferred: none
  -----------------------------------
  Bands    |               supported: utran-1, utran-3, utran-5, utran-8, eutran-1, eutran-3, 
           |                          eutran-5, eutran-7, eutran-8, eutran-20, eutran-28, eutran-32, 
           |                          eutran-38, eutran-40, eutran-41
  -----------------------------------
  IP       |               supported: ipv4, ipv6, ipv4v6

It's saying the SIM is missing, so that's most likely the cause. To explain the error a bit, the reason the modem "has no Simple capabilities" is because in MM, a modem in a failed state has a limited set of capabilities, and certainly not the --simple-dis/connect capabilities. I suspect the module could be set to use the secondary SIM slot, so check the AT command manual for switching SIM slots. Depending on the MM version you are on, you can do this via MM e.g. --set-primary-sim-slot=1 or --set-primary-sim-slot=2

I had the sim in previously for thus test I had it removed and in another device.

Of note the sim is taglocked to only work with equipment if the first 8 digits of the imei match the code stored in the sim card.

My imie matches my sim.

I will run this command with the sim inserted and see what it says with the above command.

My sim was inserter in the correct slot.

@biangbiangmian

I am trying to user modemmanager with a Quectel EC-25 modem, but I am always getting this:

root@OpenWrt:~# mmcli -m
error: couldn't get bus: The connection is closed

The QMI kernel driver and serial drivers are installed, and the modem is detected according to the kernel log:

[   20.615505] qmi_wwan 1-1.2:1.4: cdc-wdm0: USB WDM device
[   20.621919] qmi_wwan 1-1.2:1.4 wwan0: register 'qmi_wwan' at usb-ci_hdrc.0-1.2, WWAN/QMI device, d2:6c:8a:b6:80:95
[   20.631248] usbcore: registered new interface driver qmi_wwan
[   20.868262] usbcore: registered new interface driver option
[   20.872477] usbserial: USB Serial support registered for GSM modem (1-port)
[   20.880077] option 1-1.2:1.0: GSM modem (1-port) converter detected
[   20.886027] usb 1-1.2: GSM modem (1-port) converter now attached to ttyUSB0
[   20.892976] option 1-1.2:1.1: GSM modem (1-port) converter detected
[   20.899280] usb 1-1.2: GSM modem (1-port) converter now attached to ttyUSB1
[   20.906245] option 1-1.2:1.2: GSM modem (1-port) converter detected
[   20.912362] usb 1-1.2: GSM modem (1-port) converter now attached to ttyUSB2
[   20.919481] option 1-1.2:1.3: GSM modem (1-port) converter detected
[   20.925625] usb 1-1.2: GSM modem (1-port) converter now attached to ttyUSB3

What am I doing wrong?