Using GPS on BerryGPS-GSM
The GPS used on the BerryGPS-GSM is the same as the GPS module used on the BerryGPS-IMU.
The guide used for BerryGPS-IMU can also be used for BerryGPS-GSM;
If the BerryGPS-GSM is sitting on top of the GPIO pins of the Raspberry Pi, you can continue to use /dev/serial0 for the modem device which is mentioned in the above guide.
However, if you are streaming the GPS data through the GSM module, then you will need to use /dev/ttyACM3
Using the 3G/2G cellular modem – PPP
This section shows how to create a PPP Internet connection using the GSM module on the BerryGPS-GSM.
Update apt-get and then install PPP
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 GSM modem to create a PPP session.
Create a new directory
Create a new script
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 12 REPORT CONNECT "" AT OK ATH OK ATZ OK ATQ0 OK AT+CGDCONT=1,"IP","hologram" OK ATDT*99***1# CONNECT ''
Line 15 above should have you carrier’s APN. For this guide, we are using a Hologram SIM. If you are not using a Hologram SIM, then you will need to add the APN for your provider.
Configure the settings used by PPP;
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/serial0
Just below this line;
To manually start a PPP connection, use;
And to close a PPP connection, use;
Verification can by done by seeing if the Pi has a ppp0 interface and it has an IP.
Below is the output from the above command, with ppp0 highlighted showing an active connection.
You can also monitor the syslog while bringing up ppp
Start PPP on boot
Add the user Pi to the dialup group;
Create a new script to start ppp;
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;
We will use cron to start the script every time the Pi boots;
Add the below line to the bottom
@reboot /home/pi/pppStart.sh &