Before we jump into the tutorial, let us check all the items required for this is available with us and prepare our hardware.
- Raspberry Pi (Model 3B+ and 4 are recommended)
- Cellular IoT Application Shield – LTE-M & NB-IoT & eGPRS
- LTE – GNSS Dual u.FL Antenna
- 40 pin Header
- Right Angle Micro USB Cable
- SIM card
Enabling serial console
By default, the primary UART is assigned to the Linux console. If you wish to use the primary UART for other purposes, you must reconfigure Raspberry Pi OS. This can be done by using raspi-config:
- Start raspi-config: sudo raspi-config.
- Select option 3 - Interface Options.
- Select option P6 - Serial Port.
- At the prompt Would you like a login shell to be accessible over serial? answer 'No'.
- At the prompt Would you like the serial port hardware to be enabled? answer 'Yes'.
raspi-configand reboot the Pi for changes to take effect.
In order to check the drivers, first press the PWRKEY button of the HAT which will power up the module.
Then open up a terminal and run the commands below. Expected outputs are as follows:
- Download the Cellular IoT Application Shield repository.
git clone https://github.com/sixfab/Sixfab_RPi_CellularIoT_Library.git
- Goto directory Sixfab_RPi_CellularIoT_Library.
- Complete the installation.
sudo python3 setup.py install
🌐 Internet connection
PPP(Point-to-Point Protocol) is a data layer communication protocol that is established through the serial port of the modem. These Serial port communication 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 flexible with the devices. PPP may show a drop of the connection while using the AT command set for other functionality of modem.
The LTE radio protocol has native support of TCP/IP and IPv6, so there is no need to actually wrap TCP/IP into PPP over the radio interface. 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.
If you need to establish an internet connection for a short period of time and the date to be transferred is not high, you may stick to PPP.
Now we can proceed to establish an active internet connection.