4

I have a Huawei E3531 3G dongle (which works fine on Ubuntu 14.04, right out of the box). However, it registers as an USB-Ethernet adapter and I can't view any signal strength or other connection information except by visiting the dongle's internal webpage at 192.168.8.1. Can this dongle also be used as a ttyUSBx modem device so it works properly with network-manager?

Thanks! Florian

1
  • Ubuntu needs better support for this.
    – empedokles
    Sep 13, 2015 at 12:24

2 Answers 2

11

I can actually answer my own question now: it is possible to switch the stick into a "modem mode" where it presents 3 serial devices. Connecting via those modem devices doesn't currently work, however. In any case, here's the magic incantation - put the following into a file "/etc/usb_modeswitch.d/12d1:1f01":

# Huawei E3531s-2 - switch to modem mode instead of HiLink CDC-Ether mode
TargetVendor=0x12d1
TargetProduct=0x1f01

# switch to 12d1:1001 (modem mode, 3 virtual serial ports)
MessageContent="55534243123456780000000000000011062000000100000000000000000000"

# switch to 12d1:14dc (default HiLink CDC-Ether mode)
# MessageContent="55534243123456780000000000000a11062000000000000100000000000000"

# switch to 12d1:1442 (debug mode with 2 virtual serial ports)
# MessageContent="55534243000000000000000000000011060000000000000000000000000000"

Found at and adapted from: http://www.draisberghof.de/usb_modeswitch/bb/viewtopic.php?f=3&t=1897

2
  • Could you pleae provide a more in depth (and newbie-friendly) description?
    – empedokles
    Sep 13, 2015 at 9:51
  • There's not really much more to add - if you put the lines shown above into a file /etc/usb_modeswitch.d/12d1:1f01, then the next time you plug in the stick, it will show up as a modem device. However, I couldn't use it to actually connect in that mode. Sep 15, 2015 at 9:29
5

TL;DR: In order for the E3531 to work as a serial over USB modem, you need to modify the mode switching rule to the one you have posted (12d1:1001) and to switch off autodialing in the internal configuration page, otherwise there is a conflict and the computer can't use the modem.

I needed to set up this modem to work with an OpenWrt router, so I spent quite a few hours testing on my Fedora box and the router itself. It does work in CDC Ethernet mode, but there is no way to set up things like port forwarding. In /etc/usb_modeswitch.d/12d1:1f01 I had:

# Huawei E353 (3.se)

TargetVendor=  0x12d1
TargetProduct= 0x14db

MessageContent="55534243123456780000000000000a11062000000000000100000000000000"
NoDriverLoading=1

and similarly in OpenWrt's /etc/usb-mode.json (the values inside brackets are in decimal):

    "12d1:1f01": {
        "*": {
            "t_vendor": 4817,
            "t_product": [ 5339, 5340 ],
            "mode": "HuaweiNew",
            "no_driver": true,
            "msg": [  ]
        }
    }

It seems that the NoDriverLoading=1 ("no_driver": true) option does not allow the device to switch to serial-over-USB mode. I can't remember if the same is true for "mode": "HuaweiNew", as I've shipped the router to the client.

So, to recap, you need to:

  1. Disable autodialing in the configuration page
  2. Modify the mode switching rule to target product id 0x1001 (decimal: 4097) and message "55534243123456780000000000000011062000000100000000000000000000"
  3. Remove the NoDriverLoading=1 option
  4. Save the rule, unplug and plug back in
2
  • For a similar Huawei modem I found I had to remove the "mode": "HuaweiNew" line to get the correct switching.
    – Tristan
    Feb 17, 2015 at 19:21
  • Just for the record, now it does indeed work, thanks for the hint to disable autodial. That (in combination with the modified usb-modeswitch message) did the trick. Oct 5, 2015 at 5:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .