Using the LTE-M cellular modem to create a data connection with PPP

LTE-M GPS IMU 10DOF

This section shows how to create a PPP Internet connection using the SARA-R5 on the OzzMaker LTE-M GPS IMU 10DOF.

When  creating a connection, it is best to use multiplexing between the Raspberry Pi and SARA-R5 on the LTE-M GPS IMU 10DOF .
You can follow this guide to enable this.

Update apt-get and then install PPP

pi@raspberrypi ~ $ sudo apt-get update
pi@raspberrypi ~ $ sudo apt-get install ppp

We now need to create a chat script.  A chat script defines the conversation needed between the Pi and the LTE modem to create a PPP session.
Create a new directory

pi@raspberrypi ~ $ sudo mkdir /etc/ppp/chatscripts/

Create a new script

pi@raspberrypi ~ $ sudo nano /etc/ppp/chatscripts/mobile-modem.chat

Copy this content into the empty file;

ABORT 'BUSY'
ABORT 'NO CARRIER'
ABORT 'VOICE'
ABORT 'NO DIALTONE'
ABORT 'NO DIAL TONE'
ABORT 'NO ANSWER'
ABORT 'DELAYED'
TIMEOUT 20
REPORT CONNECT
"" AT
OK ATH
OK ATZ
OK ATQ0
OK ATDT*99***1#
CONNECT ''

 

Configure the settings used by PPP;

pi@raspberrypi ~ $ sudo nano /etc/ppp/peers/provider

Locate the below line;

connect "/usr/sbin/chat -v -f /etc/chatscripts/pap -T ********"

Delete it or comment it out by placing a ‘#’ at the start of the line.
And then add this line just below;

connect "/usr/sbin/chat -v -f /etc/ppp/chatscripts/mobile-modem.chat -T hologram"

Place your APN at the end, here we are using hologram. If you are not using a Hologram SIM, you would need to use the APN for your provider.

You now need to add the serial device used by the GSM modem. This should be /dev/ttyGSM1
Just below this line;

#/dev/modem

add

/dev/ttyGSM1

To manually start a PPP connection, use;

pi@raspberrypi ~ $ sudo pon

And to close a PPP connection, use;

pi@raspberrypi ~ $ sudo poff

Verification can by done by seeing if the Pi has a ppp0 interface and it has an IP.

pi@raspberrypi ~ $ sudo ifconfig

Below is the output from the above command, with ppp0 highlighted showing an active connection.
ifconfig

You can also monitor the syslog while bringing up ppp

pi@raspberrypi ~ $ tail -f /var/log/syslog

 

Start PPP on boot

Add the user Pi to the dialup group;

pi@raspberrypi ~ $ sudo adduser pi dip

Create a new script to start ppp;

pi@raspberrypi ~ $ nano ~/pppStart.sh

copy in the below lines;

#!/bin/bash
sleep 5
pon

The pause above is there to give the Pi time to boot before we try and make a PPP connection.

Make the script executable;

pi@raspberrypi ~ $ chmod +x pppStart.sh

We will use cron to start the script every time the Pi boots;

pi@raspberrypi ~ $ crontab -e

Add the below line to the bottom

@reboot /home/pi/pppStart.sh &

 

Other Information and Guides

Blip, blop, bloop…