Problem with NetworkManager and LTE/4G USB Modem

When I managed to configure my USB modem to Modem mode,

Bus 002 Device 002: ID 0bda:0411 Realtek Semiconductor Corp. 
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 8087:0a2b Intel Corp. 
Bus 001 Device 005: ID 0461:4d81 Primax Electronics, Ltd Dell N889 Optical Mouse
Bus 001 Device 004: ID 046d:c31d Logitech, Inc. Media Keyboard K200
Bus 001 Device 006: ID 12d1:1506 Huawei Technologies Co., Ltd. Modem/Networkcard
Bus 001 Device 002: ID 0bda:5411 Realtek Semiconductor Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

I then ran mmcli -m 0 and got this :

mmcli -m 0
  --------------------------------
  General  |            dbus path: /org/freedesktop/ModemManager1/Modem/0
           |            device id: ab4c45fd1c54e80572336c490d4e450ce6c045f4
  --------------------------------
  Hardware |         manufacturer: huawei
           |                model: E3372
           |             revision: 21.315.01.00.910
           |            supported: gsm-umts
           |              current: gsm-umts
           |         equipment id: 866785034457704
  --------------------------------
  System   |               device: /sys/devices/70090000.xusb/usb1/1-2/1-2.1
           |              drivers: option1
           |               plugin: Huawei
           |         primary port: ttyUSB0
           |                ports: ttyUSB0 (at)
  --------------------------------
  Status   |       unlock retries: sim-pin (3), sim-pin2 (3), sim-puk (10), sim-puk2 (10)
           |                state: connected
           |          power state: on
           |          access tech: lte
           |       signal quality: 25% (cached)
  --------------------------------
  Modes    |            supported: allowed: 2g; preferred: none
           |                       allowed: 3g; preferred: none
           |                       allowed: 4g; preferred: none
           |                       allowed: 2g, 3g, 4g; preferred: none
           |              current: allowed: 2g, 3g, 4g; preferred: none
  --------------------------------
  IP       |            supported: ipv4, ipv6, ipv4v6
  --------------------------------
  3GPP     |                 imei: 866785034457704
           |          operator id: 52502
           |        operator name: Singtel
           |         registration: home
  --------------------------------
  3GPP EPS | ue mode of operation: csps-2
  --------------------------------
  SIM      |            dbus path: /org/freedesktop/ModemManager1/SIM/0
  --------------------------------
  Bearer   |            dbus path: /org/freedesktop/ModemManager1/Bearer/0

However, it was stuck at getting IP configuration

eth0     ethernet  connected                              Wired connection 1   
ttyUSB0  gsm       connecting (getting IP configuration)  SingTel connection 1 
wlan0    wifi      disconnected                           --                   
l4tbr0   bridge    unmanaged                              --                   
dummy0   dummy     unmanaged                              --                   
rndis0   ethernet  unmanaged                              --                   
usb0     ethernet  unmanaged                              --                   
lo       loopback  unmanaged                              --

Seeing this, I ran ‘sudo systemctl status NetworkManager’ and got this :

● NetworkManager.service - Network Manager
   Loaded: loaded (/lib/systemd/system/NetworkManager.service; enabled; vendor preset: enabled)
   Active: active (running) since Sun 2018-01-28 23:58:24 +08; 1 years 8 months ago
     Docs: man:NetworkManager(8)
 Main PID: 4242 (NetworkManager)
    Tasks: 5 (limit: 4174)
   CGroup: /system.slice/NetworkManager.service
           ├─ 4242 /usr/sbin/NetworkManager --no-daemon
           └─11061 /sbin/dhclient -d -q -sf /usr/lib/NetworkManager/nm-dhcp-helper -pf /run/dhclient-eth0.pid -lf /var/lib/NetworkManager/dhclient-aa28f8bd-4e93-3b42-abaf-45a15172085f-eth0.lease -cf /var/lib/NetworkManager/dhclient-eth0.conf eth0

Oct 07 13:48:51 uavstream-desktop NetworkManager[4242]: <warn>  [1570427331.6396] error requesting auth for org.freedesktop.NetworkManager.wifi.share.protected: Authorization check failed: Failed to open file “/proc/14364/status”: No such file or directory
Oct 07 13:48:51 uavstream-desktop NetworkManager[4242]: <warn>  [1570427331.6406] error requesting auth for org.freedesktop.NetworkManager.wifi.share.open: Authorization check failed: Failed to open file “/proc/14364/status”: No such file or directory
Oct 07 13:48:51 uavstream-desktop NetworkManager[4242]: <warn>  [1570427331.6416] error requesting auth for org.freedesktop.NetworkManager.settings.modify.system: Authorization check failed: Failed to open file “/proc/14364/status”: No such file or directory
Oct 07 13:48:51 uavstream-desktop NetworkManager[4242]: <warn>  [1570427331.6426] error requesting auth for org.freedesktop.NetworkManager.settings.modify.own: Authorization check failed: Failed to open file “/proc/14364/status”: No such file or directory
Oct 07 13:48:51 uavstream-desktop NetworkManager[4242]: <warn>  [1570427331.6434] error requesting auth for org.freedesktop.NetworkManager.settings.modify.hostname: Authorization check failed: Failed to open file “/proc/14364/status”: No such file or directory
Oct 07 13:48:51 uavstream-desktop NetworkManager[4242]: <warn>  [1570427331.6445] error requesting auth for org.freedesktop.NetworkManager.settings.modify.global-dns: Authorization check failed: Failed to open file “/proc/14364/status”: No such file or directory
Oct 07 13:48:51 uavstream-desktop NetworkManager[4242]: <warn>  [1570427331.6461] error requesting auth for org.freedesktop.NetworkManager.reload: Authorization check failed: Failed to open file “/proc/14364/status”: No such file or directory
Oct 07 13:48:51 uavstream-desktop NetworkManager[4242]: <warn>  [1570427331.6471] error requesting auth for org.freedesktop.NetworkManager.checkpoint-rollback: Authorization check failed: Failed to open file “/proc/14364/status”: No such file or directory
Oct 07 13:48:51 uavstream-desktop NetworkManager[4242]: <warn>  [1570427331.6486] error requesting auth for org.freedesktop.NetworkManager.enable-disable-statistics: Authorization check failed: Failed to open file “/proc/14364/status”: No such file or directory
Oct 07 13:48:51 uavstream-desktop NetworkManager[4242]: <warn>  [1570427331.6507] error requesting auth for org.freedesktop.NetworkManager.enable-disable-connectivity-check: Authorization check failed: Failed to open file “/proc/14364/status”: No such file or directory

Also, does anyone know how to activate wwan0 on my ifconfig? I can’t seem to figure it out

Thank you so much for taking the time to help out! I greatly appreciate it

~

Could you check and compare the dmesg between Pi and nano? Maybe there are some missing driver that needs to be installed.

https://askubuntu.com/questions/790893/huawei-usb-4g-modem-not-detected

It is common that different vendors enable different upstream kernel modules in their kernel. I mean maybe raspberry Pi is using different kernel drivers.

Thank you for the reply!
The dmesg when I connect the LTE modem to my Nano is :

[  659.302294] usb 1-2.1: new high-speed USB device number 6 using tegra-xusb
[  659.328051] usb 1-2.1: New USB device found, idVendor=12d1, idProduct=1506
[  659.328120] usb 1-2.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[  659.328170] usb 1-2.1: Product: HUAWEI_MOBILE
[  659.328215] usb 1-2.1: Manufacturer: HUAWEI_MOBILE
[  659.487745] usbcore: registered new interface driver option
[  659.487831] usbserial: USB Serial support registered for GSM modem (1-port)
[  659.488068] option 1-2.1:1.0: GSM modem (1-port) converter detected
[  659.488412] usb 1-2.1: GSM modem (1-port) converter now attached to ttyUSB0

On my Raspberry Pi3, I get :

[  175.791909] usb 1-1.2: new high-speed USB device number 9 using dwc_otg
[  175.923314] usb 1-1.2: New USB device found, idVendor=12d1, idProduct=1506, bcdDevice= 1.02
[  175.923331] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[  175.923341] usb 1-1.2: Product: HUAWEI_MOBILE
[  175.923351] usb 1-1.2: Manufacturer: HUAWEI_MOBILE
[  176.044377] usbcore: registered new interface driver usbserial_generic
[  176.044455] usbserial: USB Serial support registered for generic
[  176.044997] usbcore: registered new interface driver cdc_ncm
[  176.050791] usbcore: registered new interface driver cdc_wdm
[  176.070067] usbcore: registered new interface driver option
[  176.070151] usbserial: USB Serial support registered for GSM modem (1-port)
[  176.146568] huawei_cdc_ncm 1-1.2:1.1: MAC-Address: 00:1e:10:1f:00:00
[  176.146579] huawei_cdc_ncm 1-1.2:1.1: setting rx_max = 16384
[  176.153793] huawei_cdc_ncm 1-1.2:1.1: NDP will be placed at end of frame for this device.
[  176.154019] huawei_cdc_ncm 1-1.2:1.1: cdc-wdm0: USB WDM device
[  176.154685] huawei_cdc_ncm 1-1.2:1.1 wwan0: register 'huawei_cdc_ncm' at usb-3f980000.usb-1.2, Huawei CDC NCM device, 00:1e:10:1f:00:00
[  176.154815] usbcore: registered new interface driver huawei_cdc_ncm
[  176.155275] option 1-1.2:1.0: GSM modem (1-port) converter detected
[  176.155654] usb 1-1.2: GSM modem (1-port) converter now attached to ttyUSB0

I can clearly see some differences, namely the different drivers such as option and usbserial_generic and the cdc_wdm drivers.

But how do I install these drivers? I already updated my kernel to the latest version

Hi,

According to your log, I think we need below drivers

cdc_ncm → This is not enabled.
cdc_wdm → This is enabled by default as a kernel moduel (.ko) in our driver.
huawei_cdc_ncm → Not enabled either.

If you read this Makefile in kernel source, you will see what is missing

kernel/kernel-4.9/drivers/net/usb/Makefile

obj-$(CONFIG_USB_NET_CDC_NCM)	+= cdc_ncm.o
 obj-$(CONFIG_USB_NET_HUAWEI_CDC_NCM)	+= huawei_cdc_ncm.o

To enable these two, you have to enable CONFIG_USB_NET_CDC_NCM and CONFIG_USB_NET_HUAWEI_CDC_NCM in tegra_defconfig (kernel/kernel-4.9/arch/arm64/configs)

Thank you for the quick reply! I enabled the two drivers by adding

CONFIG_USB_NET_CDC_NCM=y
CONFIG_USB_NET_HUAWEI_CDC_NCM=y

into my tegra_defconfig and rebooted my nano.
I then plugged in my LTE usb modem and the dmesg is still the same :

[  314.206738] usb 1-2.1: new high-speed USB device number 6 using tegra-xusb
[  314.227911] usb 1-2.1: New USB device found, idVendor=12d1, idProduct=1506
[  314.227919] usb 1-2.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[  314.227924] usb 1-2.1: Product: HUAWEI_MOBILE
[  314.227928] usb 1-2.1: Manufacturer: HUAWEI_MOBILE
[  314.378085] usbcore: registered new interface driver option
[  314.378177] usbserial: USB Serial support registered for GSM modem (1-port)
[  314.378560] option 1-2.1:1.0: GSM modem (1-port) converter detected
[  314.380233] usb 1-2.1: GSM modem (1-port) converter now attached to ttyUSB0

Is there a way where I can ‘force’ a driver to the USB modem?

Also, this one is needed for usbserial_generic.

CONFIG_USB_SERIAL_GENERIC

Please be careful that “cdc_wdm” would not be loaded up automatically after boot up. You have to load it manually.

nvidia@nvidia-desktop:/lib/modules$ find -iname “wdm
./4.9.140-tegra/kernel/drivers/usb/class/cdc-wdm.ko
nvidia@nvidia-desktop:/lib/modules$ sudo modprobe cdc-wdm
nvidia@nvidia-desktop:/lib/modules$ lsmod
Module Size Used by
cdc_wdm 15852 0
fuse 103841 3
zram 26166 6
overlay 48691 0
nvgpu 1569917 20
bluedroid_pm 13912 0
ip_tables 19441 0
x_tables 28951 1 ip_tables

Hi wayneWWW, thank you for the quick reply again! Really appreciate it :)

As for the modem problem,

This is the lsmod on my RPi when I plug the USB modem in

pi@raspberrypi:~ $ lsmod
Module                  Size  Used by
option                 45056  1
huawei_cdc_ncm         16384  0
cdc_wdm                20480  1 huawei_cdc_ncm
usb_wwan               20480  1 option
cdc_ncm                28672  1 huawei_cdc_ncm
usbserial              40960  4 option,usb_wwan
rfcomm                 49152  4
bnep                   20480  2
hci_uart               40960  1
btbcm                  16384  1 hci_uart
serdev                 20480  1 hci_uart
bluetooth             389120  29 hci_uart,bnep,btbcm,rfcomm
ecdh_generic           28672  1 bluetooth
8021q                  32768  0
garp                   16384  1 8021q
stp                    16384  1 garp
llc                    16384  2 garp,stp
snd_usb_audio         192512  0
joydev                 20480  0
brcmfmac              311296  0
snd_hwdep              16384  1 snd_usb_audio
evdev                  24576  9
brcmutil               16384  1 brcmfmac
snd_usbmidi_lib        32768  1 snd_usb_audio
snd_rawmidi            32768  1 snd_usbmidi_lib
snd_seq_device         16384  1 snd_rawmidi
sha256_generic         20480  0
cfg80211              614400  1 brcmfmac
rfkill                 28672  6 bluetooth,cfg80211
snd_bcm2835            24576  2
snd_pcm               102400  2 snd_usb_audio,snd_bcm2835
raspberrypi_hwmon      16384  0
hwmon                  16384  1 raspberrypi_hwmon
snd_timer              32768  1 snd_pcm
snd                    73728  12 snd_hwdep,snd_usb_audio,snd_timer,snd_rawmidi,snd_usbmidi_lib,snd_seq_device,snd_bcm2835,snd_pcm
bcm2835_codec          36864  0
v4l2_mem2mem           24576  1 bcm2835_codec
videobuf2_dma_contig    20480  1 bcm2835_codec
uio_pdrv_genirq        16384  0
uio                    20480  1 uio_pdrv_genirq
fixed                  16384  0
bcm2835_v4l2           45056  0
bcm2835_mmal_vchiq     32768  2 bcm2835_codec,bcm2835_v4l2
vc_sm_cma              36864  1 bcm2835_mmal_vchiq
v4l2_common            16384  1 bcm2835_v4l2
videobuf2_vmalloc      16384  1 bcm2835_v4l2
videobuf2_memops       16384  2 videobuf2_dma_contig,videobuf2_vmalloc
videobuf2_v4l2         24576  3 bcm2835_codec,bcm2835_v4l2,v4l2_mem2mem
videobuf2_common       45056  4 bcm2835_codec,bcm2835_v4l2,v4l2_mem2mem,videobuf2_v4l2
videodev              200704  6 bcm2835_codec,v4l2_common,videobuf2_common,bcm2835_v4l2,v4l2_mem2mem,videobuf2_v4l2
media                  36864  2 videodev,v4l2_mem2mem
cuse                   16384  2
fuse                  110592  4 cuse
i2c_dev                20480  0
ip_tables              24576  0
x_tables               32768  1 ip_tables
ipv6                  450560  22

Whereas on my Jetson Nano, I get:

uavstream@uavstream-desktop:~$ lsmod
Module                  Size  Used by
option                 44068  1
usb_wwan               14212  1 option
cdc_wdm                18151  0
fuse                  111691  3
overlay                51662  0
zram                   29313  4
bnep                   18758  2
iwlmvm                382529  0
mac80211              802752  1 iwlmvm
btusb                  44507  0
btrtl                   7749  1 btusb
btbcm                  10207  1 btusb
btintel                13379  1 btusb
iwlwifi               178099  1 iwlmvm
cfg80211              684152  3 iwlmvm,iwlwifi,mac80211
nvgpu                1706372  39
bluedroid_pm           16059  0
ip_tables              21421  0
x_tables               38016  1 ip_tables

This is after I enabled the Huawei_cdc_ncm and cdc_ncm. My guess is that the modem is not using this driver(huawei_cdc_ncm)

Do you also enable CONFIG_USB_SERIAL_GENERIC? It is needed for usb-generic to register some devices.

Also, I don’t see huawei_cdc_ncm in lsmod, do you enable it as a module (=m) or inside kernel (=y)?

According to the result from raspberry pi, cdc_wdm is used by huawei_cdc_ncm, so huawei_cdc_ncm is still needed I think.

huawei_cdc_ncm 16384 0
cdc_wdm 20480 1 huawei_cdc_ncm

I enabled huawei_cdc_ncm and cdc_ncm as =y. Should it be =m?

Also when you say enable CONFIG_USB_SERIAL_GENERIC, I should just add this line

CONFIG_USB_SERIAL_GENERIC=m

into the tegra_defconfig right?

When I try to run ModemManger, I get this under the status update

ModemManager.service - Modem Manager
   Loaded: loaded (/lib/systemd/system/ModemManager.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2018-01-29 03:58:35 +12; 1 years 8 months ago
 Main PID: 4076 (ModemManager)
    Tasks: 3 (limit: 4174)
   CGroup: /system.slice/ModemManager.service
           └─4076 /usr/sbin/ModemManager --filter-policy=strict

Jan 29 03:58:33 uavstream-desktop systemd[1]: Starting Modem Manager...
Jan 29 03:58:33 uavstream-desktop ModemManager[4076]: <info>  ModemManager (version 1.10.0) starting in system bus...
Jan 29 03:58:35 uavstream-desktop systemd[1]: Started Modem Manager.
Jan 29 03:58:38 uavstream-desktop ModemManager[4076]: <info>  Couldn't check support for device '/sys/devices/1003000.pcie/pci0000:00/0000:00:01.0/0000:01:00.0': not supported by any plugin
Jan 29 03:58:38 uavstream-desktop ModemManager[4076]: <info>  Couldn't check support for device '/sys/devices/1003000.pcie/pci0000:00/0000:00:02.0/0000:02:00.0': not supported by any plugin
Jan 29 03:58:38 uavstream-desktop ModemManager[4076]: <info>  Couldn't check support for device '/sys/devices/700d0000.xudc': not supported by any plugin
Jan 29 03:58:56 uavstream-desktop ModemManager[4076]: <info>  [device /sys/devices/70090000.xusb/usb1/1-2/1-2.1] creating modem with plugin 'Huawei' and '1' ports
Jan 29 03:58:56 uavstream-desktop ModemManager[4076]: <warn>  Could not grab port (tty/ttyUSB0): 'Cannot add port 'tty/ttyUSB0', unhandled serial type'
Jan 29 03:58:56 uavstream-desktop ModemManager[4076]: <warn>  Couldn't create modem for device '/sys/devices/70090000.xusb/usb1/1-2/1-2.1': Failed to find primary AT port

Hi UAVstreaming,

“=m” means it is built as a kernel modules and can be checked in lsmod.
“=y” means it is built inside kernel image so that lsmod does not have it.

I am not sure if this would affect your device or not. You could dump the defconfig on your raspberry Pi by below command.

cat /proc/config.gz | gunzip > running.config

And compare it with tegra_defconfig.

Thank you for your reply, Wayne! Really helps a ton.

Currently I am comparing the config files between RPi and tegra_defconfig. There is over 10k lines on the RPi configs. I was thinking if it was okay to copy everything over to tegra_defconfig.

I think you could consult with Huawei what is the need of their ubuntu driver.

I’ll do just that. Thank you for all your help :)

Hi Wayne,
Could I ask where can I get cdc_mbim kernel from? I seem to be missing that kernel and I think that is the problem! I’ve been searching around but can’t seem to find a solution. Thank you for your help!

Hi,

You could just grep the keyword in kernel source tarball and it would show the makefile.
For example,
kernel/kernel-4.9/drivers/net/usb/Makefile indicates that it should be CONFIG_USB_NET_CDC_MBIM.

Hi Wayne,

I managed to get my 4G dongle working. It was by running scripts that edits/configures the kernels and modules required on JetsonHacksNano on github. Your help came in clutch too. I have learnt a ton. Thank you! ;)

Hi,

Could you also kindly share the github link for other users to refer to?

Certainly.

I git cloned this repo : GitHub - JetsonHacksNano/buildKernelAndModules: Build the Linux Kernel and Modules on board the NVIDIA Jetson Nano Developer Kit

and used this guide to know what kernels/modules to enable : https://github.com/etu/gentoo-hardware-notes/blob/master/12d1:1506_Huawei_Technologies_Co._Ltd._Modem_Networkcard.org

From there I ran the ./editConfig.sh script to enable the required settings as specified in the link above. After doing so, I ran the ./makeKernels.sh and ./makeModules.sh scripts and it works thereafter :)