3. Installing 4G USB modem to Raspberry Pi

4G USB modem

HUAWEI E3372 modem

If you are using HUAWEI E3372, it can plug & play on Raspberry Pi, no need to install any program.

HUAWEI E3370 modem

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.

Did the USB modem loaded?

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

Did the E3370 loaded?

The 12d1 is Huawei and the 1506 is E3370 modem.

$ dmesg | grep 1506
idVendor=12d1, idProduct=1506, bcdDevice= 1.02

Install wvdial

If 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
--> Sending: ATQ0 V1 E1 S0=0
--> Modem initialized.
--> Sending: ATDT*99#
--> Waiting for carrier.
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 service

I need the USB modem can auto dial-up, I created a wvdial.service file.

$ sudo pico /etc/systemd/system/wvdial.service


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 connection

Run the command:


If the modem runs correctly, you can find the ppp0 output:

        inet xxx.xxx.xxx.xxx  netmask  destination
        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

If you found any mistake in the document or you have difficulty following the setups, please leave your comments to me. Your comments can help me to improve this article. Thank you!

RC Bellergy

Next: 4. Install Zerotier

4 thoughts on “3. Installing 4G USB modem to Raspberry Pi”

  1. sudo pico /etc/udev/rules.d99-com.rules

    should be:

    sudo pico /etc/udev/rules.d/99-com.rules

    overall this is the best solution!

  2. Hi, There is an error in: “$ sudo pico /etc/udev/rules.d99-com.rules” should be “sudo pico /etc/udev/rules.d/99-com.rules”

Welcome your comments

%d bloggers like this: