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

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