USB LTE dongle support

I’m trying to make a Huawei e3372 usb dongle to work, I manage to add usb_modeswitch that will switch the dongle from data drive to network, the modem’s led does get fixed on, but no new network interface gets created. If I’m getting correctly from other forums, I’m missing the kernel modules for kmod-usb-net and cdc, but I cannot find them in the duo-buildroot-sdk compilation process, any suggestions?

1 Like

Hi Argus
Can you run the command

lsusb

and share the output (with dongle attached to your milk v sbc?

Edit:
Can you also confirm which linux image you are using, provided output from dmesg after inserting dongle, and provide output from lsmod

2 Likes

Hello Johan, thank you for your reply. I build my image to include usb_modeswitch, but the basic information can be found bellow:

[root@milkv-duo]~# cat /etc/os-release
NAME=Buildroot
VERSION=20240702-2122
ID=buildroot
VERSION_ID=2021.05
PRETTY_NAME="Buildroot 2021.05"

[root@milkv-duo]~# uname -a
Linux milkv-duo 5.10.4-tag- #1 PREEMPT Tue Jul 2 21:19:43 CST 2024 riscv64 GNU/Linux

As requested, I have booted with the dongle already connected, so we have:

[root@milkv-duo]~# lsusb
Bus 001 Device 001: ID 1d6b:0002
Bus 001 Device 002: ID 12d1:1f01

And from dmesg, dongle USB LED flashing blue:

[root@milkv-duo]~# dmesg | grep usb
[    0.220564] usbcore: registered new interface driver usbfs
[    0.226340] usbcore: registered new interface driver hub
[    0.231903] usbcore: registered new device driver usb
[    0.855710] dwc2 4340000.usb: axi clk installed
[    0.860488] dwc2 4340000.usb: apb clk installed
[    0.865217] dwc2 4340000.usb: 125m clk installed
[    0.870031] dwc2 4340000.usb: 33k clk installed
[    0.874754] dwc2 4340000.usb: 12m clk installed
[    0.879568] dwc2 4340000.usb: EPs: 8, dedicated fifos, 3072 entries in SPRAM
[    0.887463] dwc2 4340000.usb: DWC OTG Controller
[    0.892342] dwc2 4340000.usb: new USB bus registered, assigned bus number 1
[    0.899621] dwc2 4340000.usb: irq 40, io mem 0x04340000
[    0.915541] usbcore: registered new interface driver usb-storage
[    1.007374] usbcore: registered new interface driver usbhid
[    1.017222] usbhid: USB HID core driver
[    1.022798] usbcore: registered new interface driver snd-usb-audio
[    3.085299] usb 1-1: new high-speed USB device number 2 using dwc2
[    3.324677] usb-storage 1-1:1.0: USB Mass Storage device detected
[    3.334892] scsi host0: usb-storage 1-1:1.0

By the way, I have setup the USB to operate as OTG already:

[root@milkv-duo]/mnt/system# cat usb.sh
#!/bin/sh
echo host > /proc/cviusb/otg_role >> /tmp/usb.log 2>&1

So, after using the usb_modeswitch:

[root@milkv-duo]/mnt/system# usb_modeswitch -v 12d1 -p 1f01 -M "55534243123456780000000000000011062000000101000100
000000000000" -W
Take all parameters from the command line


 * usb_modeswitch: handle USB devices with multiple modes
 * Version 2.6.1 (C) Josua Dietze 2017
 * Based on libusb1/libusbx

 ! PLEASE REPORT NEW CONFIGURATIONS !

DefaultVendor=  0x12d1
DefaultProduct= 0x1f01
MessageContent="55534243123456780000000000000011062000000101000100000000000000"

Look for default devices ...
  found USB ID 12d1:1f01
   vendor ID matched
   product ID matched
  found USB ID 1d6b:0002
 Found devices in default mode (1)
Access device 002 on bus 001
Get the current device configuration ...
Current configuration number is 1
Use interface number 0
 with class 8
Use endpoints 0x01 (out) and 0x81 (in)

USB description data (for identification)
-------------------------
Manufacturer: HUAWEI_MOBILE
     Product: HUAWEI_MOBILE
  Serial No.: 0123456789ABCDEF
-------------------------
Looking for active drivers ...
 OK, driver detached
Set up interface 0
Use endpoint 0x01 for message sending ...
Trying to send message 1 to endpoint 0x01 ...
 OK, message successfully sent
Read the response to message 1 (CSW) ...
 Device seems to have vanished after reading. Good.
 Device is gone, skip any further commands
-> Run lsusb to note any changes. Bye!

[root@milkv-duo]/mnt/system# lsusb
Bus 001 Device 001: ID 1d6b:0002
Bus 001 Device 003: ID 12d1:14dc

From dmesg, now dongle USB LED fix on blue:

[root@milkv-duo]/mnt/system# dmesg | grep USB
...
[  889.424293] dwc2 4340000.usb: Not connected
[  889.429408] usb 1-1: usbfs: usb_submit_urb returned -19
[  889.530895] usb 1-1: USB disconnect, device number 2
[  890.606660] usb 1-1: new high-speed USB device number 3 using dwc2
[  890.820504] usb-storage 1-1:1.2: USB Mass Storage device detected
[  890.821110] scsi host0: usb-storage 1-1:1.2

I should have a eth1, but it doesn’t show up, I guess I’m missing the kmod-usb-net and/or CDC.

[root@milkv-duo]/mnt/system# ifconfig
eth0      Link encap:Ethernet  HWaddr 42:DD:24:B8:xx:xx
          inet addr:10.1.1.117  Bcast:10.1.1.255  Mask:255.255.255.0
          inet6 addr: fe80::4f9c:a254:a6cf:12c/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:7724 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2571 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1122262 (1.0 MiB)  TX bytes:282687 (276.0 KiB)
          Interrupt:25

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:28 errors:0 dropped:0 overruns:0 frame:0
          TX packets:28 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1934 (1.8 KiB)  TX bytes:1934 (1.8 KiB)

My hardware setup is pretty simple, powering up by gpio, USB dongle with usb-c adapter.

Lastly, the output of lsmod:

[root@milkv-duo]~# lsmod
Module                  Size  Used by    Tainted: GF
cv180x_pwm              6983  0
cvi_vc_driver         879138  0 [permanent]
cv180x_jpeg            25220  1 cvi_vc_driver,[permanent]
cv180x_vcodec          28451  2 cvi_vc_driver,cv180x_jpeg,[permanent]
cv180x_tpu             32041  0 [permanent]
cv180x_clock_cooling     5953  0 [permanent]
cv180x_thermal          3404  0
cv180x_rgn            100809  0 [permanent]
cv180x_dwa             48669  0 [permanent]
cv180x_vpss           280938  0 [permanent]
cv180x_vi             338826  0 [permanent]
snsr_i2c                9341  0 [permanent]
cvi_mipi_rx            54306  0 [permanent]
cv180x_base            96472  7 cvi_vc_driver,cv180x_rgn,cv180x_dwa,cv180x_vpss,cv180x_vi,snsr_i2c,cvi_mipi_rx,[pe                                                                      rmanent]
cv180x_sys             64161  6 cvi_vc_driver,cv180x_rgn,cv180x_dwa,cv180x_vpss,cv180x_vi,cv180x_base,[permanent]

Thanks for the help!

1 Like

Hi Argus,

I think the issue is missing drivers, as you also mention. I don’t have an e3372 myself, but I recently had a similar issue with a USB WiFi adapter I was using a buildroot generated OS. I that case I had to configure buildroot to also build drivers for my wifi adapter. They were build as extra modules (output/target/lib/modules/[kernal version]/extra) and could then copy them to /lib/modules/5.15.118/extra/ on my device and then run depmod -a and modprobe [new driver]. After that I could confirm with dmesg that the new drivers were correctly loaded and my new network interface showed up correctly.

Unfortunately, I don’t know how exactly to configure buildroot to build drivers for the E3372.

I hope this is response can be of some help to you. Good luck!

1 Like

Thanks for the reply. I’m still unsure how to build the driver, but I will keep searching.
Thanks!

1 Like