BG96 Linux NetworkManager ModemManager

Hi,

we have a custom hardware with BG96 module. The module is recognized in Linux, lsusb shows:
Bus 001 Device 003: ID 2c7c:0296 Quectel Wireless Solutions Co., Ltd. BG96 CAT-M1/NB-IoT modem

i configure connection with

nmcli c add type gsm ifname cdc-wdm0 con-name gsm apn XX
nmcli c up gsm

and get a static ip
ifconfig wwan0

wwan0     Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
          inet addr:10.193.70.110  P-t-P:10.193.70.110  Mask:255.255.255.252
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:700 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:36593 (35.7 KiB)

But I am not able to get online, no ping is working.

I am able to setup connection successfully with qmcli and udhcpc. But I have to use NetworkManager as this is integrated in our configuration system.

Any hint how to get NetworkManager to work with BG96?

Thanks in advance and best regards
Ruben

I doubt this has anything to do with the modem.
Have you checked your routing?

Yes, routing looks fine. It’s similar if I add a WiFi connection.
Difference I saw is if using network manager device is in raw ip mode, if starting qmicli device is in 802.3 mode. Any idea if this can cause the problem?

to be more clear: ifconfig wwan0 looks like this if I start connection with qmicli

wwan0     Link encap:Ethernet  HWaddr 22:C6:DF:19:6C:7D  
          inet addr:10.193.190.189  Bcast:10.193.190.191  Mask:255.255.255.252
          inet6 addr: fe80::20c6:dfff:fe19:6c7d/64 Scope:Link
          UP BROADCAST RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:14 errors:0 dropped:0 overruns:0 frame:0
          TX packets:67 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:3230 (3.1 KiB)  TX bytes:12598 (12.3 KiB)

I don’t think the modem can do both modes, I guess only one of the tools is working properly [with this modem].

I don’t use both tools in parallel. During hardware bringup we used qmicli to validate hw function and it worked. Now we decided to go with networkmanager which is not working. If I use networkmanager the qmicli script is disabled, only networkmanager and modemmanager are running

That is obvious, no need to explain. I was talking about the modem, not the tools - from my point of view, if it supports, say, 802.3 mode, it will not support other mode(s). I would check the cause with modemmanager.

ok, thanks. do you have any idea how to configure modemmanager to use raw-ip or 802.3 mode?

No idea, sorry. Uninstalled it years ago.

What is your recommendation to configure BG96 from linux?

I would just use qmicli with some shell scripting around. It looks like you already have it.

yes, nearly. systemd integration is missing. And I am not sure about reconnection handling

I am one step further. I checked the logs of ModemManager and saw that the BG96 module reports that it has raw-ip data format. ModemManager then changes to raw-ip which is not working.
Any idea why the bg96 reports raw-ip?

ModemManager[377]: <debug> [946698157.433803] Querying device data format...
ModemManager[377]: [/dev/cdc-wdm0] sent message...
<<<<<< RAW:
<<<<<<   length = 13
<<<<<<   data   = 01:0C:00:00:1A:01:00:01:00:21:00:00:00
ModemManager[377]: [/dev/cdc-wdm0] sent generic request (translated)...
<<<<<< QMUX:
<<<<<<   length  = 12
<<<<<<   flags   = 0x00
<<<<<<   service = "wda"
<<<<<<   client  = 1
<<<<<< QMI:
<<<<<<   flags       = "none"
<<<<<<   transaction = 1
<<<<<<   tlv_length  = 0
<<<<<<   message     = "Get Data Format" (0x0021)
ModemManager[377]: [/dev/cdc-wdm0] received message...
<<<<<< RAW:
<<<<<<   length = 91
<<<<<<   data   = 01:5A:00:80:1A:01:02:01:00:21:00:4E:00:02:04:00:00:00:00:00:10:01:00:00:11:04:00:02:00:00:00:12:04:00:00:00:00:00:13:04:00:00:00:00:00:14:04:00:00:00:00:00:15:04:00:00:00:00:00:16:04:00:00:00:00:00:17:04:00:10:00:00:00:18:04:00:00:10:00:00:1A:04:00:00:00:00:00:1B:01:00:00
ModemManager[377]: [/dev/cdc-wdm0] received generic response (translated)...
<<<<<< QMUX:
<<<<<<   length  = 90
<<<<<<   flags   = 0x80
<<<<<<   service = "wda"
<<<<<<   client  = 1
<<<<<< QMI:
<<<<<<   flags       = "response"
<<<<<<   transaction = 1
<<<<<<   tlv_length  = 78
<<<<<<   message     = "Get Data Format" (0x0021)
<<<<<< TLV:
<<<<<<   type       = "Result" (0x02)
<<<<<<   length     = 4
<<<<<<   value      = 00:00:00:00
<<<<<<   translated = SUCCESS
<<<<<< TLV:
<<<<<<   type       = "QoS Format" (0x10)
<<<<<<   length     = 1
<<<<<<   value      = 00
<<<<<<   translated = no
<<<<<< TLV:
<<<<<<   type       = "Link Layer Protocol" (0x11)
<<<<<<   length     = 4
<<<<<<   value      = 02:00:00:00
<<<<<<   translated = raw-ip
<<<<<< TLV:
<<<<<<   type       = "Uplink Data Aggregation Protocol" (0x12)
<<<<<<   length     = 4
<<<<<<   value      = 00:00:00:00
<<<<<<   translated = disabled
<<<<<< TLV:
<<<<<<   type       = "Downlink Data Aggregation Protocol" (0x13)
<<<<<<   length     = 4
<<<<<<   value      = 00:00:00:00
<<<<<<   translated = disabled
<<<<<< TLV:
<<<<<<   type       = "NDP Signature" (0x14)
<<<<<<   length     = 4
<<<<<<   value      = 00:00:00:00
<<<<<<   translated = 0
<<<<<< TLV:
<<<<<<   type       = "Uplink Data Aggregation Max Size" (0x15)
<<<<<<   length     = 4
<<<<<<   value      = 00:00:00:00
<<<<<<   translated = 0
<<<<<< TLV:
<<<<<<   type       = "Downlink Data Aggregation Max Size" (0x16)
<<<<<<   length     = 4
<<<<<<   value      = 00:00:00:00
<<<<<<   translated = 0
<<<<<< TLV:
<<<<<<   type   = 0x17
<<<<<<   length = 4
<<<<<<   value  = 10:00:00:00
<<<<<< TLV:
<<<<<<   type   = 0x18
<<<<<<   length = 4
<<<<<<   value  = 00:10:00:00
<<<<<< TLV:
<<<<<<   type   = 0x1a
<<<<<<   length = 4
<<<<<<   value  = 00:00:00:00
<<<<<< TLV:
<<<<<<   type   = 0x1b
<<<<<<   length = 1
<<<<<<   value  = 00
ModemManager[377]: <debug> [946698157.438634] Checking data format: kernel 802-3, device raw-ip
ModemManager[377]: <debug> [946698157.438713] Updating kernel data format: raw-ip

Found the proplem. Our kernel had some kernel patches which are recommended in another documentation from quectel. When I removed the patch everything works fine. It looks like this kernel patch is not compatible with modemmanager

1 Like

Hi ruben ,
I also faced same problem . how it solved.

Hi,

Could you precise the patche you removed to have it work?