2

I am attempting to compile support for a Huawei E3276 usb LTE modem for an embedded Linux/BusyBox installation on a Parrot AR Drone 2.0, which is based on kernel 2.6.32; however, I am running into some issues after loading the kernel modules.

I start off by loading the necessary kernel modules:

  • usbnet,
  • cdc-acm,
  • cdc_subset,
  • cdc_ether,
  • mii,
  • usbserial

This modem behaves like an Ethernet NIC that presents a routed interface (192.168.1.100 on an eth port), so all the actual 4G setup is done on the modem itself via a web interface (in case you're wondering why I'm not including qmi_wwan drivers).

Then I plug in the 4G modem until I get the following entries in dmesg and lsusb:

lsusb:

Bus 001 Device 002: ID 12d1:1f01 Huawei Technologies Co., Ltd.

dmesg:

scsi8 : SCSI emulation for USB Mass Storage devices
usb 1-1: uevent
usb-storage: device found at 12
usb-storage: waiting for device to settle before scanning
/home/stephane/.ardrone/linux/ardrone2_ARDrone2_Version_20130102/Linux/kernel/omap/drivers/usb/core/inode.c: creating file '012'
hub 1-0:1.0: state 7 ports 1 chg 0000 evt 0002
hub 1-0:1.0: port 1 enable change, status 00000503
scsi 8:0:0:0: CD-ROM            HUAWEI   Mass Storage     2.31 PQ: 0 ANSI: 2

At this point I use the modeswitch command to bring the device into modem mode:

usb_modeswitch-1.1.9-arm-static -v 12d1 -p 1f01 -W -M 55534243123456780000000000000011060000000000000000000000000000

This succeeds and changes the product code and reconnects it:

lsusb:

Bus 001 Device 003: ID 12d1:1001 Huawei Technologies Co., Ltd. E620 USB Modem

dmesg:

usb-storage 1-1:1.0: disconnect by usbfs
usb 1-1: usbfs: process 4792 (usb_modeswitch-) did not claim interface 0 before use
hub 1-0:1.0: state 7 ports 1 chg 0000 evt 0002
hub 1-0:1.0: port 1, status 0100, change 0001, 12 Mb/s
usb 1-1: USB disconnect, address 12
usb 1-1: unregistering device
usb 1-1: usb_disable_device nuking all URBs
usb 1-1: unregistering interface 1-1:1.0
usb 1-1:1.0: uevent
usb 1-1: uevent
hub 1-0:1.0: debounce: port 1: total 100ms stable 100ms status 0x100
hub 1-0:1.0: hub_suspend
usb usb1: bus auto-suspend
usb usb1: usb resume
hub 1-0:1.0: hub_resume
hub 1-0:1.0: port 1: status 0101 change 0001
hub 1-0:1.0: state 7 ports 1 chg 0002 evt 0000
hub 1-0:1.0: port 1, status 0101, change 0000, 12 Mb/s
usb 1-1: new high speed USB device using musb_hdrc and address 13
usb 1-1: skipped 4 descriptors after interface
usb 1-1: skipped 4 descriptors after interface
usb 1-1: skipped 4 descriptors after interface
usb 1-1: default language 0x0409
usb 1-1: udev 13, busnum 1, minor = 12
usb 1-1: New USB device found, idVendor=12d1, idProduct=1001
usb 1-1: New USB device strings: Mfr=2, Product=1, SerialNumber=0
usb 1-1: Product: HUAWEI Mobile
usb 1-1: Manufacturer: HUAWEI Technology
usb 1-1: uevent
usb 1-1: usb_probe_device
usb 1-1: no configuration chosen from 1 choice
/home/stephane/.ardrone/linux/ardrone2_ARDrone2_Version_20130102/Linux/kernel/omap/drivers/usb/core/inode.c: creating file '013'
hub 1-0:1.0: state 7 ports 1 chg 0000 evt 0002
hub 1-0:1.0: port 1 enable change, status 00000503
Spurious irq 95: 0xffffffdf, please flush posted write for irq 56

Unfortunately, after the usb_probe_device step, it shows that it has found a configuration, but is not choosing it without an explanation.

Can anyone help me discover the reason for it not proceeding with the found configuration? What diagnostic steps should I take? What tests should I try?

Roland
  • 21
  • 3

1 Answers1

1

I'm trying to do the same thing you are: get a 3G/4G modem to work on the ARDrone2. I'm not as far along as you are though, I only just managed to get my hands on the toolchain, and my first few attempts at a hello world have crashed.

I don't really have an answer, only an idea. I did a quick google on your log messages, and I found this: https://bugzilla.kernel.org/show_bug.cgi?id=8167

However, I believe the ARDrone2 is using kernel 2.6.32.9, and after looking through the code files mentioned in that bugzilla it seems to me that the mentioned fix is present.

So that got me thinking: the ARDrone2 has a uclinux build, which generally targets embedded systems, and hence builds are optimized with minimalistic features. Maybe some flag wasn't set when the kernel module in the drone was compiled (file generic.c has comments which seem to also hint at this around the relevant line with the #if !defined statement).

If this is true, it would be a matter of recompiling with the correct flags enabled. I have no way of testing your issue, though. My modem is still on its way.

  • Hi Daniel, I unfortunately had to give up (temporarily) on the huawei modem due to time constraints. and instead opted for this Bandluxe C501 modem http://www.proxicast.com/support/PocketPORT_Modem_Guide.asp?TID=67, which works like a charm. I still intend to get the Huawei dongle supported however. since these Bandluxe modems are increasingly hard to come by. – Roland Jul 01 '15 at 09:19
  • Interesting. I got my modem today, it's an older huawei k3765, but still huawei, so who knows, I may have to deal with what you faced. I managed to cross-compile the binutils for the drone, and readelf has been helpful, e.g.: the cortex-a8 is hardfloat, but binaries still need to be armel, probably because the uclinux is built for the old ardrone1 cpu. I also managed to get the drone connected to my router, so I can connect to it and the internet at the same time. How did you figure out which kernel modules were required? – Daniel Salazar Jul 04 '15 at 06:37
  • I just noticed something: the usb_modeswitch command you show doesn't include the -H option. Have you tried that? – Daniel Salazar Jul 04 '15 at 06:49
  • My huawei K3765 apparently does the modeswitch (I get the message 1 configuration chosen of 1 choice). I guess now comes compiling the kernel modules. Is there any way I can help with your huawei modem? – Daniel Salazar Jul 05 '15 at 05:20
  • Hi Daniel, Work is keeping me from investing time in this project, but i used usb-devices and modinfo to find out which drivers I needed from a machine which has support for the modems by default. – Roland Jul 06 '15 at 10:10
  • I have noticed that the modeswitch target product id is different in my working test environment after switching than when I use modeswitch from the parrot drone, ill try the -H flag when i have time to see if it makes a difference. – Roland Jul 06 '15 at 10:17
  • A word of warning against most Huawei dongles on older kernels(unfortunately this includes your K3765 modem), is that they make use of the qmi_wwan drivers, whilst there is nothing wrong with the driver it was only added upstream quite recently and as far as i know no back-ports exist for 2.6.* kernels, so this is something you will probably have issues with on the parrot – Roland Jul 06 '15 at 10:21
  • I actually got the K3765 to be recognized by the kernel. I had to patch option.c and recompile option.ko, but I do get the three /dev/ttyUSB? devices, and I can talk to the modem (I send AT and I get OK back on ttyUSB0). I've been looking at the next step: get a network interface in front of the serial device, and I think you may be right: no wwan module exists for this older kernel. I'll either have to find a patch, backport it myself, or use something else like ppp or wvdial. – Daniel Salazar Jul 14 '15 at 18:51
  • In my case, the modules I loaded were mii.ko, usbnet.ko, option.ko, cdc_subset.ko, cdc_ether.ko.The usbserial.ko seems to already be built into the kernel (per a dmesg log when I try to load it). Roland, anything I can do to help out getting you a solution? What does lsmod say? When you cross-compiled your modules, did you change the extraversion in the makefile to exactly match that of your ardrone kernel? – Daniel Salazar Jul 14 '15 at 18:52
  • Hi Daniel, I also got to the point where i could set up a ppp connection over the /dev/ttyUSB* serial ports, the only problem is the max speed of the serial connection (around 460kbit/s) which is way too little for a video connection (even the telemetry alone is 1.5 mbit/s(dont ask me why)), I cant check lsmod right now but I remember I did have to change the extraversion in the makefile to get the modules to load, we are currently debating whether we should continue with the AR drone at all or build a custom drone, since backporting the qmi_wwan module would be non-trivial. – Roland Jul 16 '15 at 10:39
  • Dang, I just tested ppp myself, and I agree: ppp over the serial port is slow with high latency, about 460kbit/s at best.. You're right: either the qmi_wwan module would need to be backported, or a newer kernel version configured and flashed. The former is harder, the latter is riskier (drone could potentially not boot). – Daniel Salazar Jul 25 '15 at 06:48
  • In case you haven't seen it, there seems to be a patch for backporting the usb_wwan to 2.6 kernels. I intend to look at that next. http://tomatousb.org/forum/t-388205/usb-wwan-and-option-modules – Daniel Salazar Jul 25 '15 at 06:54
  • Thanks I hadn't seen that patch before, ill check it out as well. – Roland Jul 27 '15 at 10:17
  • Good news: I applied the patch, and got the usb_wwan module to load in kernel 2.6.32-x. Modem seems to work. Bad news: It seem to load like a serial port, same as before, requiring ppp. No cdc_ether driver or anything... So I tested under Ubuntu 14, and I get the same behavior. I could swear the modem loaded cdc_ether under Ubuntu 14, but now it doesn't. I upgraded the modem firmware at some point to get it working under windows 7 (signed drivers issue), maybe that changed something? – Daniel Salazar Jul 28 '15 at 15:29
  • Can you post your dmesg when you plug it in with the module loaded? – Roland Jul 29 '15 at 16:33