how to use a Huawei e3372 on linux with ncm driver, dd-wrt ready too.
Go to file
2022-07-17 15:14:52 +02:00
connect-huawei-e3372.sh feat: init repo and scripts and readme 2022-07-17 15:14:52 +02:00
README.md feat: init repo and scripts and readme 2022-07-17 15:14:52 +02:00
refresh-connect-huawei-e3372.sh feat: init repo and scripts and readme 2022-07-17 15:14:52 +02:00

How to use Huawei 3372s under linux

https://www.0xf8.org/2017/01/flashing-a-huawei-e3372h-4g-lte-stick-from-hilink-to-stick-mode/

How to flash

  1. sudo ./balong-usbdload -p /dev/ttyUSB0 usblsafe-3372h.bin DO NOT TOUCH the usb key, you should see 3 new tty poping
  2. sudo ./balong_flash -p /dev/ttyUSB2 Huawei_E3372h-153_21.180.01.00.00_Firmware_general_3Ginfo.ru/E3372h-153_UPDATE_21.180.01.00.00.BIN

https://wiki.dd-wrt.com/wiki/index.php/Cellular_Phone/USB_Modem_as_WAN_connection

https://openwrt.org/docs/guide-user/network/wan/wwan/ethernetoverusb_ncm

  1. Delete old /dev/ttyUSBx can save your life

  2. Doing a rmmod option can solve a lot

  3. You should have usb-devices

T:  Bus=01 Lev=01 Prnt=01 Port=06 Cnt=03 Dev#= 68 Spd=480 MxCh= 0
D:  Ver= 2.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=12d1 ProdID=1506 Rev=01.02
S:  Manufacturer=HUAWEI_MOBILE
S:  Product=HUAWEI_MOBILE
C:  #Ifs= 5 Cfg#= 1 Atr=80 MxPwr=2mA
I:  If#=0x0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=02 Prot=12 Driver=option
I:  If#=0x1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=02 Prot=01 Driver=option
I:  If#=0x2 Alt= 1 #EPs= 3 Cls=ff(vend.) Sub=02 Prot=16 Driver=huawei_cdc_ncm
I:  If#=0x3 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
I:  If#=0x4 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
  1. ip link must show a device like wwx00XXXXXXXXX

  2. To enable connection

  3. socat - /dev/ttyUSB0,crnl

  4. ATI show basic informations

  5. AT+CPIN=1234 if you have a pin code

  6. AT+CGDCONT=1,"IP","m2m.tele2.com" for setup a APN

  7. AT^NDISDUP=1,1, to enable APN should show => ^NDISSTAT:1,,,"IPV4"

  8. Then you enable wwx iface with ip link set up wwx00XXXXXXXXX

  9. Then send shcp request dhclient -v wwx00XXXXXXXXX

On DDWRT

  1. Usb drivers debug helpful command cat /sys/kernel/debug/usb/devices
  2. You need to load kernel module first insmod cdc-ncm.ko cdc_wdm.ko huawei_cdc_ncm.ko usb_wwan.ko option.ko TODO finish this
  3. Switch the Huawei in modem mode usb_modeswitch -v 0x12d1 -p 0x14fe -J
  4. You should see a change in lsusb
  5. You should see wwan0: register 'huawei_cdc_ncm' at usb-0000:00:0b.1-2, Huawei CDC NCM device, 00:1e in dmesg command output
  6. Enable connection echo -ne "AT^NDISDUP=1,1,\"sl2sfr\"\r\n" > /dev/ttyUSB0
  7. ifconfig wwan0 up see this documentation here
  8. udhcpc -i wwan0
  9. iptables -t nat -A POSTROUTING -o wwan0 -j MASQUERADE
  10. iptables -A FORWARD -i br0 -j ACCEPT
  11. iptables -t mangle -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu