Sixfab offers HATs for Raspberry Piwhich provides cellular PPP Internet connection anywhere with the availability of mobile network coverage. These HATs are:
PPP is a data layer communication protocol that is established through the serial port of the modem. These Serial port communications could be either the UART(/dev/ttyS0) or the serial exposed to USB(/dev/ttyUSB3). This serial is also used for both modem commands (AT commands) and responses. This connection is established by dial-up (ATD*99#).
PPP is easy to establish, widely used protocol, and it is flexible with the devices. PPP may show a drop of the connection while using the AT command set for other functionality of modem. The PPP protocol is just used between the computer and the modem to make the connection look like a legacy dial-up modem-based network connection.
Each of these Shields/HATs can be connected to the Internet via PPP(Point to Point Protocol). For this tutorial, we have developed a script to install and perform the required steps.
Without further ado let us jump into the installation process.
Software Setup
During Standalone installation, all source files are downloaded from the internet. It is enough to download ppp_install_standalone.sh and run it.
During the installation, the user will need to answer several questions, in order to complete the installation process. The questions are:
Please choose your Sixfab Shields/HATs You will be offered to choose among the mentioned shields/HATs. Then it will fetch the required scripts for you.
pi@raspberrypi:~ $ sudo ./install.sh
Please choose your Sixfab Shield/HAT:
1: GSM/GPRS Shield
2: 3G, 4G/LTE Base Shield
3: Cellular IoT App Shield
4: Cellular IoT HAT
5: Tracker HAT
6: 3G/4G Base HAT
What is your carrier APN? It will then ask for APN. Type in your APN and then press ENTER. For me, it is super.
pi@raspberrypi:~ $ sudo ./install.sh
…
…
…
Setting up libpcap0.8:armhf (1.8.1-6) …
Setting up ppp (2.4.7-2+4.1+deb10u1) …
Created symlink /etc/systemd/system/multi-user.target.wants/pppd-dns.service → /lib/systemd/system/pppd-dns.service.
Setting up wiringpi (2.50) …
Processing triggers for systemd (241-7~deb10u5+rpi1) …
Processing triggers for man-db (2.8.5-2) …
Processing triggers for libc-bin (2.28-10+rpi1) …
Known wiringpi issue is detected! Wiringpi is updating…
…
HTTP request sent, awaiting response… 200 OK
Length: 52260 (51K) [application/x-debian-package]
Saving to: ‘wiringpi-latest.deb’wiringpi-latest.deb 100 [================================================================>] 51.04K –.-KB/s in 0.1s2021-01-26 15:00:53 (403 KB/s) – ‘wiringpi-latest.deb’ saved [52260/52260](Reading database … 42363 files and directories currently installed.)
Preparing to unpack wiringpi-latest.deb …
Unpacking wiringpi (2.52) over (2.50) …
Setting up wiringpi (2.52) …
Processing triggers for man-db (2.8.5-2) …
What is your carrier APN?
super
Does your carrier need username and password?
pi@raspberrypi:~ $ sudo ./install.sh
…
…
…
Setting up libpcap0.8:armhf (1.8.1-6) …
Setting up ppp (2.4.7-2+4.1+deb10u1) …
Created symlink /etc/systemd/system/multi-user.target.wants/pppd-dns.service → /lib/systemd/system/pppd-dns.service.
Setting up wiringpi (2.50) …
Processing triggers for systemd (241-7~deb10u5+rpi1) …
Processing triggers for man-db (2.8.5-2) …
Processing triggers for libc-bin (2.28-10+rpi1) …
Known wiringpi issue is detected! Wiringpi is updating…
…
HTTP request sent, awaiting response… 200 OK
Length: 52260 (51K) [application/x-debian-package]
Saving to: ‘wiringpi-latest.deb’wiringpi-latest.deb 100 [================================================================>] 51.04K –.-KB/s in 0.1s2021-01-26 15:00:53 (403 KB/s) – ‘wiringpi-latest.deb’ saved [52260/52260](Reading database … 42363 files and directories currently installed.)
Preparing to unpack wiringpi-latest.deb …
Unpacking wiringpi (2.52) over (2.50) …
Setting up wiringpi (2.52) …
Processing triggers for man-db (2.8.5-2) …
What is your carrier APN?
super
Does your carrier need username and password? [Y/n]
n
Enter your communication PORT name In this step, you will enter your PORT. Please see Table 1.
pi@raspberrypi:~ $ sudo ./install.sh
…
…
…
Setting up libpcap0.8:armhf (1.8.1-6) …
Setting up ppp (2.4.7-2+4.1+deb10u1) …
Created symlink /etc/systemd/system/multi-user.target.wants/pppd-dns.service → /lib/systemd/system/pppd-dns.service.
Setting up wiringpi (2.50) …
Processing triggers for systemd (241-7~deb10u5+rpi1) …
Processing triggers for man-db (2.8.5-2) …
Processing triggers for libc-bin (2.28-10+rpi1) …
Known wiringpi issue is detected! Wiringpi is updating…
…
HTTP request sent, awaiting response… 200 OK
Length: 52260 (51K) [application/x-debian-package]
Saving to: ‘wiringpi-latest.deb’wiringpi-latest.deb 100 [================================================================>] 51.04K –.-KB/s in 0.1s2021-01-26 15:00:53 (403 KB/s) – ‘wiringpi-latest.deb’ saved [52260/52260](Reading database … 42363 files and directories currently installed.)
Preparing to unpack wiringpi-latest.deb …
Unpacking wiringpi (2.52) over (2.50) …
Setting up wiringpi (2.52) …
Processing triggers for man-db (2.8.5-2) …
What is your carrier APN?
super
Does your carrier need username and password? [Y/n]
n
What is your device communication PORT? (ttyS0/ttyUSB3/etc.)
ttyUSB3
Do you want to activate auto-connect/reconnect service at Raspberry Pi boot up? This option allows you to connect to the Internet via your HAT automatically when your Raspberry Pi starts.
pi@raspberrypi:~ $ sudo ./install.sh
…
…
…
Setting up libpcap0.8:armhf (1.8.1-6) …
Setting up ppp (2.4.7-2+4.1+deb10u1) …
Created symlink /etc/systemd/system/multi-user.target.wants/pppd-dns.service → /lib/systemd/system/pppd-dns.service.
Setting up wiringpi (2.50) …
Processing triggers for systemd (241-7~deb10u5+rpi1) …
Processing triggers for man-db (2.8.5-2) …
Processing triggers for libc-bin (2.28-10+rpi1) …
Known wiringpi issue is detected! Wiringpi is updating…
…
HTTP request sent, awaiting response… 200 OK
Length: 52260 (51K) [application/x-debian-package]
Saving to: ‘wiringpi-latest.deb’wiringpi-latest.deb 100 [================================================================>] 51.04K –.-KB/s in 0.1s2021-01-26 15:00:53 (403 KB/s) – ‘wiringpi-latest.deb’ saved [52260/52260](Reading database … 42363 files and directories currently installed.)
Preparing to unpack wiringpi-latest.deb …
Unpacking wiringpi (2.52) over (2.50) …
Setting up wiringpi (2.52) …
Processing triggers for man-db (2.8.5-2) …
What is your carrier APN?
super
Does your carrier need username and password? [Y/n]
n
What is your device communication PORT? (ttyS0/ttyUSB3/etc.)
ttyUSB3
To connect to internet run “sudo pon” and to disconnect run “sudo poff” Press ENTER key to reboot
If you want to connect to the Internet automatically type y or N. If you have selected N then you will need to run sudo pon to connect to the internet and sudo poff to stop it. Make sure your module is powered up.
pi@raspberrypi:~ $ sudo pon
pppd options in effect:
debug # (from /etc/ppp/peers/provider)
updetach # (from /etc/ppp/peers/provider)
persist # (from /etc/ppp/peers/provider)
dump # (from /etc/ppp/peers/provider)
noauth # (from /etc/ppp/peers/provider)
remotename 3gppp # (from /etc/ppp/peers/provider)
/dev/ttyUSB3 # (from /etc/ppp/peers/provider)
115200 # (from /etc/ppp/peers/provider)
lock # (from /etc/ppp/peers/provider)
connect chat -s -v -f /etc/chatscripts/chat-connect -T super # (from /etc/ppp/peers/provider)
disconnect chat -s -v -f /etc/chatscripts/chat-disconnect # (from /etc/ppp/peers/provider)
nocrtscts # (from /etc/ppp/peers/provider)
modem # (from /etc/ppp/peers/provider)
asyncmap 0 # (from /etc/ppp/options)
lcp-echo-failure 4 # (from /etc/ppp/options)
lcp-echo-interval 30 # (from /etc/ppp/options)
hide-password # (from /etc/ppp/peers/provider)
novj # (from /etc/ppp/peers/provider)
novjccomp # (from /etc/ppp/peers/provider)
ipcp-accept-local # (from /etc/ppp/peers/provider)
ipcp-accept-remote # (from /etc/ppp/peers/provider)
ipparam 3gppp # (from /etc/ppp/peers/provider)
noipdefault # (from /etc/ppp/peers/provider)
ipcp-max-failure 30 # (from /etc/ppp/peers/provider)
defaultroute # (from /etc/ppp/peers/provider)
usepeerdns # (from /etc/ppp/peers/provider)
noccp # (from /etc/ppp/peers/provider)
noipx # (from /etc/ppp/options)
abort on (BUSY)
abort on (NO CARRIER)
abort on (NO DIALTONE)
abort on (ERROR)
abort on (NO ANSWER)
timeout set to 30 seconds
send (AT^M)
expect (OK)
^M
OK
— got itsend (ATE0^M)
expect (OK)
^M
^M
OK
— got itsend (AT+CPIN?^M)
expect (OK)
^M
^M
+CPIN: READY^M
^M
OK
— got itsend (AT+CSQ^M)
expect (OK)
^M
^M
+CSQ: 27,99^M
^M
OK
— got itsend (AT+CREG?^M)
expect (OK)
^M
^M
+CREG: 0,5^M
^M
OK
— got itsend (AT+CGREG?^M)
expect (OK)
^M
^M
+CGREG: 0,5^M
^M
OK
— got itsend (AT+COPS?^M)
expect (OK)
^M
^M
+COPS: 0,0,”Twilio”,7^M
^M
OK
— got itsend (AT+CGDCONT=1,”IP”,”super”,,0,0^M)
expect (OK)
^M
^M
OK
— got itsend (ATD*99#^M)
expect (CONNECT)
^M
^M
CONNECT
— got itScript chat -s -v -f /etc/chatscripts/chat-connect -T super finished (pid 3399), status = 0x0
Serial connection established.
using channel 1
Using interface ppp0
Connect: ppp0 <–> /dev/ttyUSB3
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x1f1aee7b> <pcomp> <accomp>]
rcvd [LCP ConfReq id=0x0 <asyncmap 0x0> <auth chap MD5> <magic 0x7f83c33d> <pcomp> <accomp>]
No auth is possible
sent [LCP ConfRej id=0x0 <auth chap MD5>]
rcvd [LCP ConfAck id=0x1 <asyncmap 0x0> <magic 0x1f1aee7b> <pcomp> <accomp>]
rcvd [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x7f83c33d> <pcomp> <accomp>]
sent [LCP ConfAck id=0x1 <asyncmap 0x0> <magic 0x7f83c33d> <pcomp> <accomp>]
sent [LCP EchoReq id=0x0 magic=0x1f1aee7b]
sent [IPCP ConfReq id=0x1 <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
rcvd [LCP DiscReq id=0x2 magic=0x7f83c33d]
rcvd [LCP EchoRep id=0x0 magic=0x7f83c33d 1f 1a ee 7b]
rcvd [IPCP ConfReq id=0x0]
sent [IPCP ConfNak id=0x0 <addr 0.0.0.0>]
rcvd [IPCP ConfNak id=0x1 <addr 100.82.153.48> <ms-dns1 8.8.8.8> <ms-dns2 8.8.4.4>]
sent [IPCP ConfReq id=0x2 <addr 100.82.153.48> <ms-dns1 8.8.8.8> <ms-dns2 8.8.4.4>]
rcvd [IPCP ConfReq id=0x1]
sent [IPCP ConfAck id=0x1]
rcvd [IPCP ConfAck id=0x2 <addr 100.82.153.48> <ms-dns1 8.8.8.8> <ms-dns2 8.8.4.4>]
Could not determine remote IP address: defaulting to 10.64.64.64
not replacing default route to wlan0 [192.168.1.1]
local IP address 100.82.153.48
remote IP address 10.64.64.64
primary DNS address 8.8.8.8
secondary DNS address 8.8.4.4
⚙️ Module Configuration
Before running the PPP/QMI make sure the module is configured to the right settings. For Quectel Modules: AT+QCFG=”usbnet” should return 0, otherwise,send AT+QCFG=”usbnet”,0 then reboot the module after 10 seconds AT+CFUN=1,1
For Telit Modules: AT#USBCFG? should return 0, otherwise,send AT#USBCFG=0 then reboot the module after 10 seconds ,AT#REBOOT
By default, the reconnect service is configured to start automatically when the server boots. If this is not what you want, you can disable this behavior by typing:
Note: After the installation you may need to change some configuration in the future if required, this could be the credentials, APN or, the device port. Instead of reinstalling the whole process, you may change them as follows.
Credential
If your carrier asks for username and password; Remove noauth from /etc/ppp/peers/provider and add the following lines.
user “YOUR USERNAME”
password “YOURPASSWORD”
APN or device port
You can change APN and PORT from /etc/ppp/peers/provider.
Table 1. Selecting Port
Shield/HAT
Ports
Base Shield / Base HAT
ttyS0/ttyUSB3
Cellular IoT Application Shield / Cellular IoT HAT
ttyS0/ttyUSB3
Tracker HAT
ttyS0
Note: To use the UART(ttyS0) follow the steps mentioned in the UART guide.
We recommend to go through the section on troubleshooting as it covers the more common issues with establishing and maintaining a network connection. Please check the troubleshooting of your shield/HAT.