Sixfab came up with Raspberry Pi Cellular IoT HAT. This time it is a Hat rather than a shield. To be more specific this HAT is lighter version of our previous Raspberry Pi Cellular IoT Application Shield, where both uses Quectel BG96 module. The major difference is the peripheral sensors, the HAT doesn’t contain any sensors on it.
What is the feature of this HAT?
This HAT contains Quectel BG96 which has combined LTE technologies Cat.M1, Cat.NB1 and eGPRS.
It also supports GPS.
Before we start working with the HAT, let us setup our router settings and Raspberry pi.
Your router needs port forwarding for UDP connection. You can do it by following Port Forwarding Tutorial. Note down the IP address of your router and UDP port number.
The Serial port hardware of your Raspberry Pi should be enabled and Login shell to be accessible over serial should be disabled. This can be done from raspi-config.
- Attach the Cellular IoT HAT to your Raspberry Pi.
- Insert the Sim.
- Plug the antenna. You will need one LTE antenna with u.FL for this tutorial. Here, I am using LTE Full Band PCB Antenna.
Now we are ready to start.
Download/clone the library from github
git clone https://github.com/sixfab/Sixfab_RPi_CellularIoT_App_Shield.git
Now get into the cloned directory.
Now install the library
sudo python3 setup.py install
Make sure you are installing it with python3.
Now goto sample directory
Now open the basicUDP.py script.
Here, you will see following two lines.12your_ip = "xx.xx.xx.xx";your_port = "xxxx";
You have to replace these information with your own which have set in the preconfiguration step that is the routers IP and the UDP port address.
Check if the
node = cellulariot.CellularIoT()is uncommented.
Now save the python script and run with
Just before running the script open a new terminal in your laptop and type
netcat -ul -p5000
Here 5000 is my port number. Replace it with your port number. (This is to be done in the Device where you have directed the UDP port during the preconfiguration step)
Here you can see the Data that has been sent over UDP.
Hence, We are done with the tutorial here. Please write suggestions, questions and feedback in the comment section below.