Port Forwarding Tutorial

Most of our products support the UDP protocol. In order to test UDP communication with one of our product in the local server, we will need to play with port forwarding settings in our router. We can use the UDP protocol over both local and remote server. Local server refers to your own machine while the remote server is another machine/computer.
Read More

QMI Interface with Sixfab Shields/HATs

QMI Interface with Sixfab Shields/HATs

QMI interface has been mostly asked tutorial for Raspberry Pi 3 and Raspberry Pi 4 with Quectel UC20 / Quectel EC25 attached on our Sixfab 3G-4G/LTE Base Shield v2.

This Tutorial is maintained in our documentation section.

Base Shield
Base HAT
Cellular App. IoT Shield
Cellular IoT HAT

Please submit your technical issues and feedback to the community forum.

This has been tested with Raspberry Pi 4 too.

In this tutorial, we will be demonstrating you the process step by step. Without further ado, let’s get started.

Hardware Prerequisites

  1. Raspberry Pi
  2. Sixfab 3G-4G/LTE Base Shield v2
  3. Quectel EC25 mini PCIe module
  4. LTE antenna (2 antennas are recommended)

Hardware Setup

  1. Plug Quectel EC25 Mini PCIe module to the Sixfab 3G-4G/LTE Base Shield v2.
  2. Connect required antennas to the Quectel EC25 module. (Antenna Connecting Guide will be Available soon!).
  3. Attach the Shield on top of your Raspberry Pi and keep the micro-USB cable disconnected that comes with the Shield.

Make sure you are using the original Raspberry Adapter as your power source.

Software Setup

1. First run update

sudo apt update && sudo apt upgrade

2. Install Raspberry Pi kernel headers.

sudo apt-get install raspberrypi-kernel-headers

3. Check installed kernel headers packet version ls /usr/src
In our case, it is 4.14.79

If you are using Raspberry Pi 4, skip steps 4-7.

4. Now open your browser and go to rpi-firmware github repository commits

5. Here, find out your version and click on <> button to browse the repository at that point in the history.

6. From the link copy the hash as shown in the image below.

7. Now go back your terminal and update rpi in following format. Replace the term <hash> with your hash matching the kernel headers you checked in step 3.

sudo rpi-update <hash>

8. Reboot your Raspberry Pi in order to activate the new firmware

9. After rebooting, download qmi_installer.sh script.

wget https://raw.githubusercontent.com/sixfab/Sixfab_RPi_3G-4G-LTE_Base_Shield/master/tutorials/QMI_tutorial/qmi_install.sh

10. Change the permission of the script.

sudo chmod +x qmi_install.sh

11. Make sure the module is disconnected before running the installer script

sudo ./qmi_install.sh

12. At the end of installation enter any key to reboot your Raspberry Pi and attach the USB cable of the shield.

13. After rebooting goto directory  files/quectel-CM

cd /files/quectel-CM

14. Now run the following command to connect to the Internet.

sudo ./quectel-CM -s internet

Usage

./quectel-CM [-s [apn [user password auth]]] [-p pincode] [-f logfilename]

-s [apn [user password auth]] Set apn/user/password/auth get from your network provider
-p pincode Verify sim card pin if sim card is locked
-f logfilename Save log message of this program to file

Example 1: ./quectel-CM
Example 2: ./quectel-CM -s 3gnet
Example 3: ./quectel-CM -s 3gnet carl 1234 0 -p 1234 -f gobinet_log.txt

15. Now you can check you IP using

ifconfig wwan0

16. Further more you may check by pinging

ping -I wwan0 -c 5 8.8.8.8

Auto Connect on reboot

If you want your Raspberry Pi to automatically connect to the Internet via QMI interface then there is one more step you will need to follow.

1. Get the installation script.

wget https://raw.githubusercontent.com/sixfab/Sixfab_RPi_3G-4G-LTE_Base_Shield/master/tutorials/QMI_tutorial/install_auto_connect.sh

2. Change the permission

sudo chmod +x install_auto_connect.sh

3. Now install the script

sudo ./install_auto_connect.sh

4. It will then ask for APN. Type in your APN and then press ENTER

5. Once you press enter it will create and activate the service.

6. The name of the service is qmi_reconnect. To check if the service is active you can type

sudo systemctl status qmi_reconnect.service

7. If it is working fine then you will be able to see active(running) in green.

PPP installer for Sixfab Shield/HAT

Sixfab offers Shields/HATs for Raspberry Pi which provides cellular PPP Internet connection anywhere with the availability of mobile network coverage. These shields are:

This Tutorial is maintained in our documentation section.

Base Shield
Base HAT
Cellular App. IoT Shield
Cellular IoT HAT
Tracker HAT

Please submit your technical issues and feedback to the community forum.

Each of these shields can be connected to the Internet via PPP(Point to Point Protocol). For this tutorial, we have written a script to install and perform the required steps.

Without further ado let us jump into the installation process:

1. Get the script by the following command

wget https://raw.githubusercontent.com/sixfab/Sixfab_PPP_Installer/master/ppp_installer/install.sh

2. Now change the permission of the downloaded script. chmod +x install.sh

3. Now install the script sudo ./install.sh It will ask several questions, just answer them accordingly to complete the installation process. The questions are:

  • Please choose your Sixfab Shields/HATs
    You will be offered to choose among the mentioned three shields. Then it will fetch required scripts for you.ppp install.sh01
  • Do you have updated kernel
    It asks if your kernel is up-to-date. If no[N] it updates the kernel else it skips the update. Then it installs ppp.install.sh02
  • What is your carrier APN?
    Here, it asks for your carrier’s APN. For me it is hologram.install.sh03
  • Enter your PORT name
    In this step you will enter your PORT. For 3G, 4G/LTE Base Shield && Base HAT it will be ttyUSB3.install.sh04
  • Do you want to activate auto-connect/reconnect service at R.Pi boot up?
    This option allows you to connect to the Internet via your shield automatically when your Raspberry Pi Starts. If you want to connect to the Internet automatically type y else N. If you have selected N then you will need to run sudo pon to connect to the internet and sudo poff to stop it. Make sure your module is powered up(Not applicable for Base Shield).intall.sh05

Enjoy your Internet connection.

EXTRA

Route: One of the possible errors you may get is the routing error. In this case, run the following commands

sudo route del default
sudo route add default ppp0

Credential
If your carrier asks for username and password;
Remove noauth  from /etc/ppp/peers/provider  and add following lines

user “YOUR USERNAME”
password “YOURPASSWORD”

Selecting port

Shield/HAT PORT
GSM/GPRS Shield ttyS0/ttyUSB0
Base Shield / Base HAT ttyUSB3
Cellular IoT App. Shield / Cellular IoT HAT ttyS0/ttyUSB3
Tracker HAT ttyS0

To understand PPP further you can check PPP documentation.

Sensor Test Tutorial for Sixfab Arduino Cellular IoT Application Shield

Sixfab has came up with Arduino Cellular IoT shield that have combined LTE technilogies Cat.M1, Cat.NB1(NB-IoT) and eGPRS, which is based on Quectel BG96 module. It also have built-it sensors, LED and relay. Sixfab also has a RPi Cellular IoT Application HAT.

Sixfab is also providing library to use the shield. To keep the it easy we will be showing how to install the library and access the sensor data in our first tutorial.  Read More

IOT’s Place in The Industry 4.0

This article aims to answer the question, “Why IoT is important?”, from a different perspective. Every period has been the major revolutions and innovations in the field of industry. These revolutions occur with a power of new phenomena like the invention of steam engine, computers, and the internet. IoT which is the new phenomenon like these places the heart of “Industry 4.0”. Let’s return to our question again, “Why IoT is important?” It is necessary to talk about Industrial Revolutions in order to understand the answer to this question. Read More