SigFox for Raspberry Pi

The hardware

First you need to find a Sigfox hat for your Raspberry Pi. Just Google “Sigfox for Raspberry Pi” and you will find the latest solution available. I am using a RPISIGFOX, made my SNOC. Pretty easy to setup and use. Just plug it in, change the serial port parameters, and it is ready to work. It comes with 1 year SigFox subscription that requires activation on Sigfox website. Depending on where you intend to use your Pi, you may need a different version of Sigfox radio (that one is mainly for Europe – US and Asia have different frequency bands for non regulated spectrum).

The Software

  1. Disable Raspberry Pi terminal on serial port with raspi-config utility: sudo raspi-config. Go to Interfacing Options then choose Serial then NO and OK
  2. Install pyserial: sudo apt-get install python-serial
  3. Download scripts: git clone
  4. Enable script execution: chmod +x
  5. Plug antenna with its cable and send your first message: ./ 0123

Setting up the Callbacks and your server

You also need to setup the callbacks on Sigfox system, and your server to manage the data. This is pretty straightforward with the documentation for the uplink messages. You are limited to 6 uplink messages per hour. On reception of the uplink message, the server will call your API, as you have defined in Sigfox interface. What you do with the data on your server is up to you!

Downlink messages are a little more complex to manage. You are limited to 4 downlink messages per day, and it was not very easy to make sure my Rasberry Pi application was remaining inside this budget, specially with a solar powered Pi and without a RTC … It took me some time to understand that the server was in fact the one making sure you stay in the budget, as if there is no downlink message to send, it won’t count into the 4 messages per day.

To request a downlink message, you just need to send ack=true with your uplink message.

On reception of the uplink request through the above API, your server will have to provide the answer: "[device ID]":{"downlinkData":"[data]"} if there is a downlink payload or "[device ID]":{"noData":true} when there is no payload to send. In that case, the downlink message will not count in your daily budget.

You can find more details on this great post on Sigfox downlink messages.

Keeping the Pi on time

As my Raspberry Pi is solar powered (with a 20W solar panel, which is enough for the Pi, but not for the RTL-SDR dongle that has a much bigger power consumption), I don’t necessarily have enough power to keep the Pi on 24/24. When it is off, the time stops to progress, as the Pi doesn’t have a RTC by default. After few days, time and date are completely wrong. That makes it difficult to control the downlink messages budget from the Pi. At the same time, SigFox is a great solution to get the network time to and update the time of the Pi. With the downlink messages, I was able to get the network time when the Pi is starting and update the date and time of the Pi with the simple command sudo date --set="9 JUN 2017 19:15:00".

How I use it?

With the payload limitations at 6 uplink messages per hour (12 bytes) and 4 downlink messages per day (8 bytes), Sigfox doesn’t really replace a Wifi connection, I cannot report all the detected aircrafts and their positions as I am normally doing. As, this is for an ADS-B tracker, I decided to focus on new aircraft and special ones (such as military) for the uplink direction, transmitting only the ModeS hex code and the timestamp at which it was detected, the remaining 4 bytes are used for maintenance purpose (HHHHHHYYYYMMDDHHMMSSXXXX).

To avoid going over 6 uplink messages per hour, each detection will go into a buffer, that is checked every 10 minutes. I have been working on some more compressed way to encode these data but practically I don’t need it, as I am very seldom over budget (meaning I am sending a message every 10 minutes as long as my Pi is powered by the battery). We will see if this is still the case after COVID-19 and the airlines start to have a more international flights. Each time my server receive an uplink message it will automatically generate a tweet (with the #Sigfox hashtag).

Downlink messages are used only to keep the time of the Pi in sync, as described before. As sometimes the Pi doesn’t receive the downlink message or is switched off again when battery is low and weather is grey, it may need more than one downlink per day for time sync. In addition of the network timestamp, I still have 2 bytes available to send other data to the Pi. I am using this for maintenance purpose (YYYYMMDDHHMMSSXX). Note that the uplink message must be exactly 8 bytes in size or it will not go through.

It has been a long time I wanted to play with a Sigfox hat, and it has been quite fun: not that difficult to make it work, but enough issues to solve to make that interesting!

How to build an ADS-B tracker

In order to build your ADS-B tracker you will need just few items: a Raspberry Pi, a RTL-SDR dongle, an antenna, and some free time! For the tracker, I am using a Raspberry Pi.

I started with the A version, but it was a little limited (it was often at 100% CPU load, running dump1090, Piaware and my own software). I then moved to the B+ version, and I was down to 10% which was much better. I now run a Raspberry Pi version 4.

To setup your tracker, follow these steps:


– First you need to download the latest NOOBS from Raspberry Pi website, onto a SD card formated in FAT (your Raspberry Pi is not recognizing FAT32 format). I do recommand to use minimum 32 GB of flash, specially if you want to have some space for recording positions of the aircraft you will track. If not, 8 GB is enough.

– Insert the SD card into the slot on the Raspberry Pi and power the board. Then follow the instructions. For this step, you will need a keyboard, a mouse and a TV with HDMI input.

– When it is done, upgrade the Raspberry Pi software and firmware:

        sudo apt-get update
        sudo apt-get upgrade
        sudo rpi-update

– Install tightvnc:

        sudo apt-get install tightvncserver

– You now have a working Pi, that you can manage from a remote computer with a VNC software (I am using tightvncjviewer.jar on Mac)

– Next step is to install the ADSB tracker. For this, you will need a SDR (Software Define Radio) dongle, that you will plus to your Pi. I am using both that one and Piaware Pro-stick. The pro-stick has an integrated amplifier that will give you some additional range. Now there is a new version with integrated filter which is working great. I recommend to switch to one of the Piaware Pro-sticks as they consistently show better results than other sticks that I have tried over the years.

Install Piaware – that will give you a free access to cool features from Flightaware at the same time. You can first create credentials on Flightaware, to get a USERNAME and a PASSWORD.

        #install piaware
        sudo dpkg -i piaware-repository_4.0_all.deb
        sudo apt-get update
        sudo apt-get install piaware
        sudo piaware-config allow-auto-updates yes
        sudo piaware-config allow-manual-updates yes
        sudo apt-get install dump1090-fa

– You now have a working tracker and you can see your data on Flightaware. This is already quite fun.

See what else you can do from there on