In this installation we will see how to install the modem either for HUAWEI or ALcatel brands.Because each modem has a different options and workflow.Alcatel ik40:Lets begin with Alcatel because its a new model. for me I worked with Alcatel IK40.But at the first I noticed that my OS panic and I dont have the control anymore, which I look after many solution but here is the final one:-The Modem worked Automaticly with OS no need for any additional installation but the issue is he took directly the IP for me which I am not able to control it via SSH, which I did an ngrok to get the acces to it before I pluged in the Modem.-After that I found that it make the OS panic and it stops working.I look after the usbmodemswitch solution and it here is the best one.1) make sure packages usb-modeswitch and usb-modeswitch-data are installed2) create the file "/etc/usb_modeswitch.d/1bbb:f000" (use the quotes, since there's a : in the file name)3) put into the file this content:TargetVendor=0x1bbbTargetProductList="0000, 0017, 00b7, 011e, 0191, 0195"StandardEject=1Explanation: it seems like there are multiple methods for performing mode switching (ie the switching from the disk mode to the modem mode), and the default one makes the RPI panics. The configuration forces the StandardEject mode.and now I can get acces normaly via ssh from ngrok or unplug the modem and continue with local wifi.
HUAWEI E3372 modemIf you are using HUAWEI E3372, it can plug & play on Raspberry Pi, no need to install any program too.
I have an old HUAWEI E3370 modem that needs config manually. The method also can help me find the problem when the modem didn’t work. Run the command below in you RPi, to check did the USB modem loaded.
$ lsusb | grep Huawei
12d1:1506 Huawei Technologies Co., Ltd. Modem/Networkcard
Install wvdialIf the modem has been loaded but it didn’t dial up. You can install the wvdial
.
$ sudo apt-get install wvdial
The default config of wvdial is fine for me. If you need to edit it, the config file is here:
$ sudo pico /etc/wvdial.conf
It is the default config file:
[Dialer Defaults]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0
Modem Type = Analog Modem
Baud = 9600
New PPPD = yes
Modem = /dev/ttyUSB0
ISDN = 0
Phone = *99#
Password = internet
Username = internet
Stupid Mode = on
Testing the dial up:$ sudo wvdial
It is the success dial up screen-print:
--> WvDial: Internet dialer version 1.61
--> Initializing modem.
--> Sending: ATZ
OK
--> Sending: ATQ0 V1 E1 S0=0
OK
--> Modem initialized.
--> Sending: ATDT*99#
--> Waiting for carrier.
ATDT*99#
CONNECT 150000000
--> Carrier detected. Starting PPP immediately.
--> Starting pppd at Sun Oct 18 14:45:08 2020
--> Pid of pppd: 1329
--> Using interface ppp0
--> pppd: X/?[01]X/?[01]
--> local IP address xxx.xxx.xxx.xxx
--> pppd: X/?[01]X/?[01]
--> remote IP address xxx.xxx.xxx.xxx
--> pppd: X/?[01]X/?[01]
--> primary DNS address xxx.xxx.xxx.xxx
--> pppd: X/?[01]X/?[01]
--> secondary DNS address xxx.xxx.xxx.xxx
--> pppd: X/?[01]X/?[01]
Create the serviceI need the USB modem can auto dial-up, I created a wvdial.service
file.
$ sudo pico /etc/systemd/system/wvdial.service
[Unit]
Description=wvdial
[Service]
ExecStart=/usr/bin/wvdial
Restart=on-failure
RestartSec=5
Add the code to the 99-com.rules
file. It will call the wvdial.service
when the USB modem loaded.
$ sudo pico /etc/udev/rules.d/99-com.rules
SUBSYSTEM=="tty", KERNEL=="ttyUSB0", TAG+="systemd", ENV{SYSTEMD_WANTS}+="wvdial.service"
Testing the connectionRun the command:
ifconfig
If the modem runs correctly, you can find the ppp0
output:
ppp0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1500
inet xxx.xxx.xxx.xxx netmask 255.255.255.255 destination 10.64.64.64
ppp txqueuelen 3 (Point-to-Point Protocol)
RX packets 11065 bytes 1348146 (1.2 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 12168 bytes 1585065 (1.5 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Comments