Internet Connection to Raspberry pi 3 (Raspbian Stretch) with a 4G Huawei Mobile Broadband LTE USB Stick (HUAWEI E3372) using sakis3g

Getting an internet  connection to Raspberry pi (with Raspbian Stretch)using a USB dongle is not that straightforward .

We know that 4G Huawei E3372  dongle is identified immediately and ready to use once it connected to a  Windows  or Ubuntu PC.

But for Raspberry pi , you will have to do some more work to get internet .

First connect the 4G Huawei E3372  dongle is connected to a USB port of  the Raspberry pi 3.

This post describes how the free software called   “sakis3g”  can be used for configuring the USB dongle to obtain internet access  to pi3 .

To get internet We are going to install following packages.

ppp package

sakis3g

usb-modeswitch

umtskeeper

Open the Terminal

sudo apt-get update
sudo apt-get install ppp
sudo apt-get install ppp usb-modeswitch
cd ~
pwd
mkdir umtskeeper
Download sakis3g.tar.gz file from sourceforge .
cd Downloads
Then copy the downloaded sakis3g.tar.gz file to the folder umtskeeper
cp sakis3g.tar.gz /home/pi/umtskeeper
cd ..
cd umtskeeper/
tar -xzvf sakis3g.tar.gz
chmod +x sakis3g

wget "http://mintakaconciencia.net/squares/umtskeeper/src/umtskeeper.tar.gz"
tar -xzvf umtskeeper.tar.gz
chmod +x umtskeeper


sudo ./sakis3g --interactive
Use 0 for APN username and password
Since my internet service provider  is mobitel Sri Lanka , I have used mobitel in sakis3g menu

 

 

 

 

Figure 1:-Connecting to internet using Sakis3G .You can see from above figures that the USBINTERFACE=’1′

Screenshot from 2018-08-31 19-34-12

Figure 2:- Internet is established using the 4G dongle

On the terminal to get the USBMODAM ID

lsusb

Screenshot from 2018-09-01 00-00-41

Figure 3:- From the above figure it can be seen that USBMODEM=’12d1:1506′

Using the data of Figure 1 and Figure 3 on the terminal
sudo ./sakis3g connect --sudo --console USBINTERFACE='1' OTHER='USBMODEM' USBMODEM='12d1:1506' SIM_PIN='1234' APN='CUSTOM_APN' CUSTOM_APN='mobitel' APN_USER='0' APN_PASS='0'" --sakisswitches "--sudo --console" --devicename 'Huawei' --log --nat 'no'


cat /var/log/umtskeeper.log
Screenshot from 2018-09-01 16-05-02

Figure 5:- Details in the log file


How to make internet connection automatic during the boot time of the PI 3 

sudo gedit /etc/rc.local 

add the following line to rc.local script file and save .This script file activates during the boot time to facilitate automatic internet connection
/home/pi/sakis3g connect --sudo --console USBINTERFACE='1' OTHER='USBMODEM' USBMODEM='12d1:1506' SIM_PIN='1234' APN='CUSTOM_APN' CUSTOM_APN='mobitel' APN_USER='0' APN_PASS='0'" --sakisswitches "--sudo --console" --devicename 'Huawei' --log --nat 'no'

Screenshot from 2018-09-04 17-20-48

  Figure 5:- Codes in file rc.local at /etc ( the codes underlined with green have to be changed to suit your dongle)

reboot pi 
Now you can see that the internet connection is established when the pi 3 is started

Note :- If you install Ubuntu MATE 16.0  , instead of Raspbian  on Raspberry pi 3 , USB internet Dongle can be used to access internet without Sakis3g or wvdial 
IMG_20180907_164742

Reference :-
mintakaconciencia.net
Advertisements

2 thoughts on “Internet Connection to Raspberry pi 3 (Raspbian Stretch) with a 4G Huawei Mobile Broadband LTE USB Stick (HUAWEI E3372) using sakis3g

  1. Hi Jayasundera, thank you – this was very helpful (for some reason I couldn’t add this reply to your other post)

    For myself, a couple of additional notes. On my E3372 it was definitely /dev/ttyUSB1 so I needed to change that first make it dial successfully.

    I’m in Singapore with Singtel (postpaid), so my wvdial.conf file ended up looking like this:

    [Dialer Defaults]
    Init1 = ATZ
    Init2 = ATQ0 V1 E1 S0=0
    Init3 = AT+CGDCONT=1,”IP”,”e-ideas”
    Stupid Mode = 1
    Modem Type = Analog Modem
    Baud = 9600
    New PPPD = yes
    Modem = /dev/ttyUSB1
    ISDN = 0
    Phone = *99#
    Password = 65IDEAS
    Username = 65IDEAS
    Auto Reconnect = yes
    Check Def Route = yes

    For auto-dial on boot, a much simpler method I found is to do this:

    – Add these to the end of the file /etc/network/interface:
    auto ppp0
    iface ppp0 inet wvdial

    And if you have any trouble with it not being the default route:

    – edit the /etc/ppp/peers/wvdial:
    noauth
    name wvdial
    defaultroute
    replacedefaultroute

    My only last issue that I haven’t managed to solve yet is the speed…. it seems relatively slow at around 1.5Mbit/s.

    Thanks again anyway, your advice gave me enough info to start digging around.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s