Huawei E3372-325 'BROVI' and Linux (Ubuntu) - Stick mode.
How to get to work Huawei E3372-325 ‘BROVI’ in Linux (ubuntu) - Stick mode.
In Part1 I explained how to get it work in HiLink mode. For some reasons sometimes you need it in STICK mode.
Notes:
- I could not get it to work in NCM mode (with controlling AT\CDC port and DHCP on a network card) so PPP mode was used.
/usr/local/bin/brovi_switch.X (make it executable!)
#!/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
# vim: filetype=bash
# 2023-01-28 Pavel Piatruk, piatruk.by
# switches BROVI to STICK mode
ID=$$
echo $ID
USB_ID=$(basename $DEVPATH)
{
echo bInterfaceClass on ports as follows
grep -H . /sys$DEVPATH/1*/bInterfaceClass
IC=$( grep -h . /sys$DEVPATH/*:1.0/bInterfaceClass )
echo "got bInterfaceClass on 1st port $IC"
echo usb_modeswitch -b $BUSNUM -g $DEVNUM -v 3566 -p 2001
case $IC in
08)
echo Storage MODE
usb_modeswitch -b $BUSNUM -g $DEVNUM -v $ID_VENDOR_ID -p $ID_MODEL_ID -X
;;
e0)
echo "Already RNDIS"
;;
ff)
echo Serial Port
;;
*)
echo Unknown mode
;;
esac
} | logger -t BROVI
exit 0
and UDEV script /etc/udev/rules.d/40-huawei.rules
ACTION!="add", GOTO="modeswitch_rules_end"
SUBSYSTEM!="usb", GOTO="modeswitch_rules_end"
#
## All known install partitions are on interface 0
ATTRS{bInterfaceNumber}!="00", GOTO="modeswitch_rules_end"
#
GOTO="modeswitch_rules_begin"
LABEL="modeswitch_rules_begin"
ATTR{idVendor}=="3566", ATTR{idProduct}=="2001", RUN+="/usr/local/bin/brovi_switch.X %k %p"
LABEL="modeswitch_rules_end"
SUBSYSTEM=="net", ACTION=="add", ATTRS{idVendor}=="3566", ATTRS{idProduct}=="2001", NAME="wwan_brovi"
# ignore AT ports on interfaces 2,4 for ModemManager cuz they stuck for some reason
SUBSYSTEM=="tty", ACTION=="add", DEVPATH=="*:1.[24]/*", ATTRS{idVendor}=="3566", ATTRS{idProduct}=="2001", ENV{ID_MM_PORT_IGNORE}="1"
After editing these 2 , replug the modem. Or when the modem is in, and is in CDROM mode, just run
usb_modeswitch -v 3566 -p 2001 -X
So it will open its ports & 3 new tty devices will appear. If they don’t - tell the OS to bind this device
modprobe option
echo 3566 2001 ff > /sys/bus/usb-serial/drivers/option1/new_id
At this point AT ports are present. Check kernel logs.
Now you have 2 options to get online.
Option1. Use NetworkManager + ModemManager
Check output of mmcli -L , it shows smth like /org/freedesktop/ModemManager1/Modem/5 [ZOWEE TECHNOLOGY (HEYUAN) CO., LTD.] E3372-325.
Check verbose output from MM(ModemManager), it shows signal levels etc: mmcli -m 5
And nmcli dev shows ttyUSB1.
Create NM(NetworkManager) connection:
nmcli con add con-name BROVI_PPP ipv4.route-metric 3000 connection.type gsm ifname ttyUSB1
nmcli con modify BROVI_PPP ipv6.method disabled
nmcli con modify BROVI_PPP gsm.apn internet
it is started automatically when the modem appears.
Option2. use Wvdial.
create a file /etc/wvdial.conf
[Dialer Defaults]
Init1 = AT
Init3 = AT+CGDCONT=1,"IP","internet"
Init7 = AT+CGATT?
Init8 = AT+CGACT?
Phone = *99#
Username = { }
Password = { }
Modem Type = Analog Modem
ISDN = 0
New PPPD = yes
Stupid Mode = yes
Modem = /dev/ttyUSB1
Auto DNS = no
Baud = 9600
and run wvdial