[OUTDATED] Tutorial 2 | Make a PPP internet connection with Sixfab GPRS Shield on Raspberry Pi

Following Tutorial is old. Please follow new PPP installer tutorial.
Sixfab GSM/GPRS Shield is using Quectel M66 GSM/GPRS module. It bears the optimal performance in SMS, Data transmission and audio service. Due to the small size(equal to size of raspberry pi zero) it is easily embeddable in any project like video streamer, establishing Internet connection, security systems, tracking system etc.

Features:
• It is a quad-band module(850/ 900/ 1800/ 1900MHz).
• Works on 3.3V ~ 4.6V(which is provided by the Raspberry Pi) No external power supply required.
• Operates at -35°C ~ +80°C.
• Supports Bluetooth BT 3.0 , Voice support
• Controlled via AT commands
• Autobauding 4800bps to 115200bps
• Maximum download speed 85.6kbps
• Uses UART ports or USB port (switchable port)

Now we will use this shield to create PPP (Point to Point Protocol) internet connection. Elaborated steps are stated below.

So the shield comes a 2×20 pin female header.
Sixfab GSM/GPRS shield

Sixfab GSM/GPRS shield

1. The header is later soldered with the shield.

alttext

Soldered Header

2. Once soldered SIM is inserted.

Caption

Inserting SIM

3. Since the shield can be used either with UART or USB. It is needed to be selected with the switch available on the the shield. We select Pi here.

caption

USB<>Pi Switch

4. Now it is connected to Raspberry Pi 3 Model B.

Caption

Shield with Raspberry Pi 3 model B

5. Connect Raspberry Pi to internet via WiFi or Ethernet.
Open the terminal(if you are using desktop or laptop you may connect raspberry pi with SSH. Also enable ssh from the Menu > Preferences > Raspberry Pi Configuration as shown in the figure below)

Raspbian interface

Raspbian interface

Rasberry Pi Configuration

Raspberry Pi Configuration

6. Once Raspberry Pi is connected, run following command in order to update Raspberry Pi.

sudo apt-­get update

raspberry pi

Update command in Terminal

7. Now the getty service needs to be stopped on Raspbian. Getty manages a terminal line and it protects the system from unauthorized access. By default GPIO14 and GPIO15 of Raspberry Pi are active as console. So it need to be disabled as serial console is not being used. Moreover the service of serial console is to be deleted from cmdline.txt. Run the following commands (terminal is connected to /dev/ttyS0 in this case)

sudo systemctl stop serial­[email protected]
sudo systemctl disable serial­[email protected]

As in previous versions Raspberry Pi terminal is connected to /dev/AMA0, following commands should be used instead.

sudo systemctl stop [email protected]
sudo systemctl disable serial-­[email protected]

piraspberrypi

Stopping getty

8. Now console has to be removed from the cmdline.txt. This can be done by running following command

sudo nano /boot/cmdline.txt

and removing ”console=serial0, 115200” or ”console=ttyAMA0, 115200” for Raspberry Pi other than version 3. Exit editor saving the changes.

piraspberrypi-_015

Removing “console = serial0, 115200”

Now Raspberry Pi is rebooted.
9. UART is enabled by adding ”enable_uart=1” at the end of text which is obtained by following command

sudo nano /boot/config.txt

piraspberrypi-_020

Adding “enable_uart=1”

10. In this step minicom will be installed, which is a serial communication program.

sudo apt­-get install minicom

command will install the minicom to the Raspberry Pi.

piraspberrypi-_022

installing minicom

11. The settings will be configured now by

minicom -s

piraspberrypi-_023

Opening minicom

piraspberrypi-_001

minicom settings

12. Serial port setup is selected

piraspberrypi-_002

Selecting Serial port setup

This brings up following screen

piraspberrypi-_003

Serial Port setup Screen

13. Following changes are to be made

Serial Device: /dev/ttyS0 and Hardware Flow Control: No

piraspberrypi-_004

Changing Settings

14. The setup is saved as default

piraspberrypi-_005

Saving the changes

This will open minicom screen.

piraspberrypi-_006

minicom screen

15. In order to check either it working or not type ‘AT’ and enter. If it responds with ‘OK’ then its working properly.

For exiting this press CRTL-A Z then follow instructions

piraspberrypi-_007

minicom screen

piraspberrypi-_008

minicom screen

piraspberrypi-_009

minicom screen

selection_027

Indicating Power Up Button

16. Now before moving to next step POWER UP the shield with the press button available on the shield. Then blue led of State will blink which indicates successfully powered up of the shield.

The shield can also be Powered Up by making GPIO 25 HIGH for 2 seconds and then LOW, as GPIO 25 is connected to POWER KEY of the shield.

Pin assignment of the shield is provided below.

pinouts-1

Pin Assignment of shield

17. This step includes the connection tutorial

Here ppp-creator.sh is to be downloaded. Installation is done with following commands:

wget https://raw.githubusercontent.com/sixfab/rpiShields/master/tutorials/tutorial2/ppp-creator.sh
chmod +x ./ppp­-creator.sh
sudo ./ppp-­creator.sh HOLOGRAM ttyS0

In the last command HOLOGRAM is the APN of the network operator. ‘ttyAMA0’ will be used instead of tty0 in case of other versions of Raspberry Pi.

18. Now the shield is ready to connect to internet. Disconnect Raspberry Pi from WiFi or Ethernet.
Type

sudo pppd call gprs

or

sudo pppd call gprs&

Here & sign is used to run the command in background.
(Open a browser and check a website)

piraspberrypi-_012

Connecting to Internet

19. Just to check the status of shield and ip, type

ifconfig ppp0

piraspberrypi-_013

Checking IP and status

59 thoughts

  1. Is there any way to have the shield automatically power on without having to press the power button?
    I’ve an idea to use this in a remote unit to establish a PDP Context automatically, but that won’t work if the power has to be manually enabled every time the Pi has to restart.

  2. Hello , i am new for this environment. In my ongoing project i want to have following feature with my Rpi3 .

    1. IoT feature – I hope to get IoT server as Google IoT server.

    2.I want to host my internet connection via WiFi.
    I think Sixfab GSM/GPRS Shield is more enough for my requirement used than 3g shield because power and the price.But could i confirm from expertise that before buying the module.
    Please note that i have to used sim integrated module because there is no any wifi AP modem.
    Thank you.

  3. Only is necessary disable serial in the Raspberry pi configuration or run in the terminal raspi-config command, if rasperry pi is version 1 B, B+ or Zero use ttyAMA0. For higher versions use ttyS0.

  4. Hello,

    Is it possible to use the GPRS module with GPS and with the Rasp Zero? I want to send GPS data to an external server.

    Thanks

  5. What’s the 1-wire (gpio 4) for? I noticed in the raspian config screenshots here, they don’t show 1-wire enabled. My guess is that it’s an optional feature, can you tell us more? Thanks!

  6. Cannot type into minicom.
    Followed instructions. As I run minicom and try to test by typing AT, nothing appears.

    I’m using Putty through SSH

    Thanks

  7. Tried to power up the module with setting the GPIO pin 25 to high, but the module does not power up. Measured the voltage in GPIO 25 and it was 3.3 volts.

    Can You tell me what I am doing wrong?

  8. Status update: GPIO 26 did it. It did start up.

    Is there a way to check if shield is on with python? My plan is to use without display/keyboard or other peripherals.

    • Another problem raised: The internet connection fails to open. Did the setup exactly as in this tutorial, but the module does not respond to AT commands at all in minicom. The setup is:
      – raspberry pi zero W
      – Sixfab GSM/GPRS Field V1.5
      – Latest rasbian OS

      Tested the raspi with sim800c raspberry module, and the connection succeeded immediatelly.

      Is there any trouble shooting instructions?

  9. Hello,

    I am using GPIO 3 shutdown and start raspi.

    I have a led button that I want to indicate when device is sending data. What GPIO pin is free for driving the LED? Is there a pin that is not connected to shield so I could safely use it as light up the LED?

  10. Hello,

    I followed all the steps in this tutorial and it seems like I am connected to the Hologram network. This is confirmed when I log into my Hologram Dashboard and it shows that my sim card is active on the T-Mobile network and my device is being logged.

    The problem is that I can not send any data to or from my device when I am connected via the gprs modem. I have tried to open a web browser and surf to google.com, but no dice. I have also tried sending TCP sockets, and HTTP using the Rest API for Hologram and nothing seems to work. I also tried to ping google.com and nothing.

    Can anyone please give me some advice? I am wondering if it is a low signal issue, maybe I need an antenna? It looks like there is no CLI to support this product so I am wondering if there is a way to check the signal strength.

    I contacted Hologram and they said that the Hologram CLI can work with other modems but the code which is available on github needs to be modified to work with the Quectel modem on the shield.

  11. Hello;

    I tried and practiced this practice. I got an IP but I could not connect to the ssh server from the outside with the ip I got. Could you help me with the subject.

    Thank you,
    Good work.

  12. Is there any way to have the shield automatically power on without having to press the power button when the shield is connected to Raspberry via USB?

    • Please use script like this

      #!/bin/sh

      gpio mode 26 in
      gpio mode 23 out

      while true; do

      if [ $(gpio read 26) = "0" ]; then
      echo "Power up"

      gpio write 23 0
      gpio write 23 1
      sleep 2
      gpio write 23 0
      else
      NCHECK='ifconfig ppp'
      NCHECK1='echo $NCHECK | cut -d " " -f 1'

      if [ "$NCHECK1" = "ppp0" ]; then
      echo "Connection up, reconnect not required..."
      exit 0
      else
      echo "Connection down, reconnecting..."
      sudo /sbin/ifdown ppp0
      sudo /sbin/ifup ppp0
      fi
      fi

      sleep 1
      done

  13. It works! Was able to get online.However, I can’t figure out how to disconnect or hangup the connection once established! ifdown ppp0 does nothing.

    Thanks!

  14. If I am connected to the network with pppd, how can I get the signal strength for the board from userspace without killing the connection?

    Thanks

  15. My M66 does not power off after issuing AT+QPOWD=1. It prints “NORMAL POWER DOWN” on the serial line, and indeed powers off, but after 5 seconds it powers on again, and connects to the GSM network.

    Do you have an idea why this happens?

  16. Hello, can you please advise me the best way to get the modem location while connected to PPP? I tried to connect to minicom to issue the quecklocator command but it says “minicom is locked”. I also tried to use the Hologram SDK but it says “modem not detected”. I really need to be able to get the location of the device for it to work with my use case. Please help. Thank you.

  17. Hi everyone,

    I’ve read that some people had problems with the disconnection process, as I had. I have figured out that the script: quectel-chat-disconnect seems to be wrong:

    With this one, the error in the disconnection process disappeared:

    ABORT “ERROR”
    ABORT “NO DIALTONE”
    SAY “\nSending break to the modem\n”
    “” +++
    “” +++
    “” +++
    SAY “\nGoodbye\n”

    I hope it helps.

    Best regards.

  18. Hello everyone,
    I am asking this to experienced users or admins, can i use this module to connect internet by not using UART but using USB serial communication (micro usb power socket). I can use usb socket to send and receive data by minicom or cutecom but is there no way to use for internet ppp?

    Thanks for the reply.

    • Hi,
      Yes you may use USB instead of UART. For this you will need to switch towards USB. Then Start from step 17 of the tutorial.
      Use ttyUSB0 instead of ttyS0.

      • Thank you for the reply Saeed! I will try to connect internet using micro-usb port and let you know the results.
        Have a nice day.

  19. Hi community!

    I managed to setup a ppp connection.

    Is it possible to remotely connect to this ppp connection?

    Regards

    David

  20. Are there any examples or howto’s of having a gprs data connection active and detecting mobile phone calls (RING) *at the same time*? A feat every single phone can manage, but I can’t seem to replicate.

  21. Followed this set up.
    Failed at number 14 setting up minicom.
    Cant write to file.
    Using sudo file written but cant enter AT or anything else.
    HELP

Leave a Reply

Your email address will not be published. Required fields are marked *