Vous êtes ici

Huawei E3276 4G USB dongle and Linux

stickIn a previous article, I tried to summarize how Linux handles 4G USB dongles (this information applies to 3G dongles as well, of course).

A few days ago, I got the opportunity to use a new (for me) USB dongle: the E3276 from Huawei. This dongle, labeled Hilink, uses a brand new way (again, for me) to provide Internet connectivity: it leads the PC to create a new network interface, with address 192.168.1.100. The dongle itself is reachable at 192.168.1.1. It embeds a web server, that allows you to manage the dongle using your web browser. On a recent Linux distribution, it works right out of the box.

Of course, before plugging in the USB dongle, ensure that there isn't any active network interface with a 192.168.1.* address on your PC.

In case the Huawei dongle is not recognized by your Linux, refer to the If it does not work... section of previous article.

If you need to configure the dongle so that it provides NAT/PAT on incoming connections, refer to this article.


For reference purpose, here are the traces I got when I configured related applications to debug mode:

  • extracts from udev traces:
# Parsing of USB_ModeSwitch rules:
... [6592.221874] [7745] parse_file: reading '/lib/udev/rules.d/40-usb_modeswitch.rules' as rules file
... # USB stick insertion event processing: [6607.982205] [7745] event_queue_insert: seq 3591 queued, 'add' 'usb' [6607.982515] [7745] worker_new: seq 3591 forked new worker [7804] [6607.982761] [7804] worker_new: seq 3591 running [6607.982957] [7745] event_queue_insert: seq 3592 queued, 'add' 'usb' [6607.983083] [7804] udev_device_new_from_syspath: device 0x7feee2eeb630 has devpath '/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2' [6607.983210] [7745] event_queue_insert: seq 3593 queued, 'add' 'scsi' [6607.983288] [7745] event_queue_insert: seq 3594 queued, 'add' 'scsi_host' [6607.983329] [7804] udev_device_read_db: no db file to read /run/udev/data/c189:164: No such file or directory [6607.983429] [7804] udev_device_new_from_syspath: device 0x7feee2eec2b0 has devpath '/devices/pci0000:00/0000:00:1d.0/usb2/2-1' [6607.983476] [7804] udev_device_new_from_syspath: device 0x7feee2eecaa0 has devpath '/devices/pci0000:00/0000:00:1d.0/usb2' [6607.983522] [7804] udev_device_new_from_syspath: device 0x7feee2eed250 has devpath '/devices/pci0000:00/0000:00:1d.0' [6607.983553] [7804] udev_device_new_from_syspath: device 0x7feee2eeda00 has devpath '/devices/pci0000:00' [6607.983656] [7804] udev_rules_apply_to_event: IMPORT builtin 'usb_id' /lib/udev/rules.d/40-libgphoto2-2.rules:11 [6607.983885] [7804] udev_builtin_add_property: ID_VENDOR=HUAWEI_Technology [6607.983897] [7804] udev_builtin_add_property: ID_VENDOR_ENC=HUAWEI\x20Technology [6607.983907] [7804] udev_builtin_add_property: ID_VENDOR_ID=12d1 [6607.983916] [7804] udev_builtin_add_property: ID_MODEL=HUAWEI_Mobile [6607.983925] [7804] udev_builtin_add_property: ID_MODEL_ENC=HUAWEI\x20Mobile [6607.983933] [7804] udev_builtin_add_property: ID_MODEL_ID=1f01 [6607.983941] [7804] udev_builtin_add_property: ID_REVISION=0102 [6607.983949] [7804] udev_builtin_add_property: ID_SERIAL=HUAWEI_Technology_HUAWEI_Mobile [6607.983958] [7804] udev_builtin_add_property: ID_BUS=usb [6607.983967] [7804] udev_builtin_add_property: ID_USB_INTERFACES=:080650: # Run USB_ModeSwitch: [6607.990572] [7804] udev_rules_apply_to_event: RUN 'usb_modeswitch '%b/%k'' /lib/udev/rules.d/40-usb_modeswitch.rules:496 [6607.990942] [7804] udev_device_read_db: device 0x7feee2eeaad0 filled with db file data [6607.991517] [7808] udev_event_spawn: starting 'usb_modeswitch '/2-1.2:1.0'' [6607.995701] [7804] spawn_wait: 'usb_modeswitch '/2-1.2:1.0'' [7808] exit with return code 0
  • extracts from USB_ModeSwitch log file:
# Input parameters from udev:
USB values from sysfs:
  idVendor	12d1
  idProduct	1f01
  manufacturer	HUAWEI Technology
  product	HUAWEI Mobile
  serial	(null)
  bNumConfigurations	1

# Find and run associated configuration file:
bNumConfigurations is 1 - don't check for active configuration
Found packed config collection /usr/share/usb_modeswitch/configPack.tar.gz
Searching entries named: /usr/share/usb_modeswitch/12d1:1f01*
Searching overriding entries named: /etc/usb_modeswitch.d/12d1:1f01*
SCSI attributes not needed, moving on.

Extracting config 12d1:1f01 from collection /usr/share/usb_modeswitch/configPack.tar.gz
config: TargetVendor set to 12d1
config: TargetProduct set to 14db
config: NoDriverLoading is set to active
Driver will not be handled by usb_modeswitch
! matched, now switching
Command to be run:
/usr/sbin/usb_modeswitch -I -W -D -s 20 -c /run/usb_modeswitch/current_cfg -u -1   -v 12d1 -p 1f01 2>&1

Verbose debug output of usb_modeswitch and libusb follows
(Note that some USB errors are expected in the process)
--------------------------------

Reading config file: /run/usb_modeswitch/current_cfg

 * usb_modeswitch: handle USB devices with multiple modes
 * Version 1.2.3 (C) Josua Dietze 2012
 * Based on libusb0 (0.1.12 and above)

 ! PLEASE REPORT NEW CONFIGURATIONS !

DefaultVendor=  0x12d1
DefaultProduct= 0x1f01
TargetVendor=   0x12d1
TargetProduct=  0x14db
TargetClass=    not set
TargetProductList=""

DetachStorageOnly=0
HuaweiMode=0
SierraMode=0
SonyMode=0
QisdaMode=0
GCTMode=0
KobilMode=0
SequansMode=0
MobileActionMode=0
CiscoMode=0
MessageEndpoint=  not set
MessageContent="55534243123456780000000000000a11062000000000000100000000000000"
NeedResponse=0
ResponseEndpoint= not set

# Success:
Mode switch succeeded. Bye.

ok:
--------------------------------
(end of usb_modeswitch output)

USB dir exists: /sys/bus/usb/devices/2-1.2
Warning: USB attribute "serial" not readable.
Doing no driver checking or binding for this device

All done, exiting