Skip to content

Instantly share code, notes, and snippets.

@aayubkh
Last active February 13, 2024 11:55
Show Gist options
  • Save aayubkh/614055d0bc260f5ea305d71439a03790 to your computer and use it in GitHub Desktop.
Save aayubkh/614055d0bc260f5ea305d71439a03790 to your computer and use it in GitHub Desktop.
Huawei E8372 Linux Configuration and Setup

Dependencies

  1. usb_modeswitch, usb_modeswitch-data
  2. libusb1
  3. libusb-devel(Fedora), libusb-dev(Debian based)

Configuration

By default, your linux box would register your Huawei E8372 as a Mass Storage device and not (somehow) as a modem. First, make sure you have the exace same device we're talking about. This can be confirmed by looking at two values using the following command (while the dongle is plugged in): As an elevated user:

    # lsusb | grep Huawei
  • Now look exactly for 12d1:1f01 - not overlooking a single character mismatch. If all good, proceed.

  • Using your favourite editor, with elevated privileges, create a new file called 70-huawei_e8372.rules in /etc/udev/rules.d/

    # gedit /etc/udev/rules.d/70-huawei_e8372.rules

  • Paste the following piece of code in it, and save it:

    ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1f01", RUN+="/usr/sbin/usb_modeswitch -v 12d1 -p 1f01 -M '55534243123456780000000000000a11062000000000000100000000000000'" ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1f01", RUN+="/bin/bash -c 'modprobe option && echo 12d1 14db > /sys/bus/usb-serial/drivers/option1/new_id'"

  • Finally, reload all the udev rules by:

    # udevadm control --reload-rules

  • Now restart your PC and you're good to go now. Whenever you plug-in your dongle, you'll have it automatically registered as a modem.

@itsme300
Copy link

This fix worked perfectly. Thanks. Also, I dont see the usb LAN disappear after doing this on ubuntu 16.04.

@pixelatedpic
Copy link

will this work on ubuntu 16.04?? cause mine did not work.. i hav Huawei E8372

@zxzjim
Copy link

zxzjim commented Jan 21, 2018

somehow I can just get the ttyUSB1 at 12d1:14db and I can't get the ttyUSB0 device... I'm using the stick on a Respberry Pi

@kilikyrepito
Copy link

Hi! Thanks! It's working fine with Debian Squeeze 6.0.10. I Have Huawei E3372. How do ?

@dimmo
Copy link

dimmo commented Apr 12, 2018

Thanks! Worked for me on Ubuntu 16.04.4 LTS.

@advnaser
Copy link

advnaser commented Aug 4, 2018

I am using Xenialpup64-7.5, a fork of Puppy Linux. Xenialpup recognized Huawei E8372 wingle as a mass storage device. I tried the solution given above but it didn't work for some reason. Then I tried the following technique with success.

I replaced the existing code in usr/share/usb_modeswitch/12d1:1f01 with the one given below and restarted the PC.

Huawei E8372

TargetVendor= 0x12d1
TargetProduct= 0x14db

MessageContent="55534243123456780000000000000a11062000000000000100000000000000"
NoDriverLoading=1

@advnaser
Copy link

advnaser commented Aug 4, 2018

Important : Add # before Huawei E8372

@riel712
Copy link

riel712 commented Dec 2, 2020

I just wanna say thank you. I edited according to my Huawei E303 and was able to hit on wvdialconf.

Edit: UBUNTU 20.04.1 LS

@kot0
Copy link

kot0 commented Feb 9, 2021

work!

@rifqifebrianmrf
Copy link

How if i did not get 12d1:1f01 but 12d1:14db? should i just change the 1f01 words to 14db?

@ethaniel
Copy link

ethaniel commented Apr 12, 2021

Just a quick update for everyone still strugling. E8372 works in Hilink mode by default.

  1. Only the latest version of usb_modeswitch (check with usb_modeswitch -e, I have 2.5.2) can switch it back to ttyUSB mode. So update it first if you're on an older version.
  2. Then download the new usb-modeswitch-data package from https://www.draisberghof.de/usb_modeswitch/ (not available in raspberry repositories yet). Unpack it, and run gen-rules.tcl to install (might require to do apt install tcl first).

Voila. Now you have /dev/ttyUSB*

UPDATE: I also created a full blown manual - https://gist.github.com/ethaniel/d7f9c3192041c64c89d2c5b49527d0e2

@kushpvo
Copy link

kushpvo commented Jun 16, 2021

How do I switch between LTE/4G/3G modes via ubuntu/linux?

@Zuborg
Copy link

Zuborg commented Aug 25, 2021

How do I switch between LTE/4G/3G modes via ubuntu/linux?
Maybe through its web interface?..

@aayubkh
Copy link
Author

aayubkh commented Aug 25, 2021

Hey there everyone! Thanks for the feedback everyone... I am glad that it was of help...
I'm not maintaining this gist anymore...

Signing off,
Abdullah

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment