GPRS and Narrowband with Raspberry PLC

Basic tutorial on the usage of LTE IoT clicks with Raspberry PLC family
May 23, 2024 by
GPRS and Narrowband with Raspberry PLC
Boot & Work Corp. S.L., Martí Schnabel

Ready to enhance your IoT projects with Raspberry PLC and LTE IoT Clicks?

Discover how to leverage the advanced capabilities of LTE IoT clicks with the Raspberry PLC family. This tutorial provides a step-by-step guide on using GPRS and Narrowband technologies with Raspberry PLC, featuring the powerful SARA-R4 modules.

The Raspberry PLC supports two versatile communication boards compatible with LTE IoT clicks. Choose between:

  • LTE IoT 6 Click: This board features the SARA-R412M module which supports LTE Cat M1, LTE Cat NB1 and EGPRS modes.
  • LTE IoT 7 Click: This board features the SARA-R422M8S module, which supports LTE-M, NB-IoT and EGPRS modes.

Essential Hardware for integrating LTE IoT clicks with Raspberry PLC

To successfully integrate LTE IoT clicks with the Raspberry PLC family, you'll need specific hardware components. This guide outlines the necessary equipment to get your IoT projects up and running with reliable connectivity.

PLC powered by Raspberry Pi

Hardware Requirements

  • A Raspberry PLC from the Raspberry PLC family.
  • An LTE IoT click connected to one of the communication boards of the Raspberry PLC.
  • A SIM card and an antenna for the LTE IoT click.

Comprehensive Software Setup for LTE IoT Clicks on Raspberry PLC

To ensure your LTE IoT clicks function properly with your Raspberry PLC, you'll need to set up the appropriate software. This section provides detailed instructions for downloading and installing the necessary scripts, depending on which expansor you are using. Follow these steps to streamline your installation process.

Here are the "" codes to test SARA-R4 on the Raspberry PLC depending on the expansor being used for the LTE IoT click:

Test code for expansor 1

Test code for expansor 2

The expansor 1 is the closest to the ethernet connector.
The expansor 2 is the furthest to the ethernet connector.

Once downloaded the code for you expansor​, transfer it to the Rasperry PLC. This process can be done using the SCP command: ​scp /path_to_file/ pi@RPi_IP:/home/pi

Verifying SARA-R4 communication on Raspberry PLC: Step-​by-Step Testing Guide

Once you have set up the hardware and software for your LTE IoT clicks on the Raspberry PLC, the next crucial step is to test the SARA-R4 communication. Follow these detailed instructions to ensure everything is functioning correctly and to troubleshoot any potential issues.

To test the SARA-R4 communication follow this steps:

1. Execute the file with superuser permissions: sudo ./

2. From console it will ask for:

  • APN (Access Point Name):
  • ISP username: WLTRIALS
  • ISP password: WLTRIALS​​
  • Radio Access Technology (LTE Cat M1 (4G), NB-IoT(Narrow Band) or GPRS/eGPRS): 1, 2 or 3

3. You can see the log messages executing tail -f /var/log/messages or tail -f /var/log/syslog. There should appear lines similar to:

local		IP		address
remote IP address
primary DNS address
secondary DNS address

4. After 50-120 seconds of executing the script should appear an interface named ppp0. Execute ifconfig ppp0 to see the interface.

5. Ping through the ppp0 interface executing ping -c4 -I ppp0. If the result is "4 packets transmitted, 4 received, 0% packet loss", it means that the ping has been successful.

In case of not getting any successful responses the test can be done manually. Execute the file created by the script with: python /usr/src/ [RAT]. Where [RAT] can be gprs, nb-iot or lte-m.

For more information about the possible commands for GPRS, Narrowband and LTE check the SARA-R4 AT Commands Manual.

Seamlessly integrate LTE IoT with Raspberry P​LC

Integrating LTE IoT clicks with the Raspberry PLC family can significantly enhance the connectivity and functionality of your IoT projects. By following the step-by-step guide provided, you can ensure a smooth setup and efficient operation of the SARA-R4 modules. From selecting the appropriate hardware components to executing the necessary software scripts and verifying the communication setup, this tutorial equips you with all the essential knowledge. Embrace the power of LTE IoT technologies to achieve reliable and robust IoT solutions with Raspberry PLC. For further commands and detailed configurations, refer to the SARA-R4 AT Commands Manual, ensuring you make the most out of your IoT deployments.

​Search in our Blog

GPRS and Narrowband with Raspberry PLC
Boot & Work Corp. S.L., Martí Schnabel May 23, 2024
Share this post

Looking for your ideal Programmable Logic Controller?

Take a look at this product comparison with other industrial controllers Arduino-based. 

We are comparing inputs, outputs, communications and other features with the ones of the relevant brands.

Industrial PLC comparison >>>