how to use a Huawei e3372 on linux with ncm driver, dd-wrt ready too.
connect-huawei-e3372.sh | ||
README.md | ||
refresh-connect-huawei-e3372.sh |
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
sudo ./balong-usbdload -p /dev/ttyUSB0 usblsafe-3372h.bin
DO NOT TOUCH the usb key, you should see 3 new tty popingsudo ./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
-
Delete old /dev/ttyUSBx can save your life
-
Doing a
rmmod option
can solve a lot -
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
-
ip link
must show a device likewwx00XXXXXXXXX
-
To enable connection
-
socat - /dev/ttyUSB0,crnl
-
ATI
show basic informations -
AT+CPIN=1234
if you have a pin code -
AT+CGDCONT=1,"IP","m2m.tele2.com"
for setup a APN -
AT^NDISDUP=1,1,
to enable APN should show =>^NDISSTAT:1,,,"IPV4"
-
Then you enable wwx iface with
ip link set up wwx00XXXXXXXXX
-
Then send shcp request
dhclient -v wwx00XXXXXXXXX
On DDWRT
- Usb drivers debug helpful command
cat /sys/kernel/debug/usb/devices
- 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 - Switch the Huawei in modem mode
usb_modeswitch -v 0x12d1 -p 0x14fe -J
- You should see a change in
lsusb
- You should see
wwan0: register 'huawei_cdc_ncm' at usb-0000:00:0b.1-2, Huawei CDC NCM device, 00:1e
indmesg
command output - Enable connection
echo -ne "AT^NDISDUP=1,1,\"sl2sfr\"\r\n" > /dev/ttyUSB0
ifconfig wwan0 up
see this documentation hereudhcpc -i wwan0
iptables -t nat -A POSTROUTING -o wwan0 -j MASQUERADE
iptables -A FORWARD -i br0 -j ACCEPT
iptables -t mangle -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu