Skip to main content
All CollectionsConnect your Devices
Connect a Pycom SiPy to Ubidots using Sigfox over HTTP
Connect a Pycom SiPy to Ubidots using Sigfox over HTTP

Learn to connect the SiPy to Ubidots using the Sigfox network over HTTP.

Sergio M avatar
Written by Sergio M
Updated over a week ago

With Sigfox, Wifi, and BLE, the SiPy is the only triple-threat MicroPython enabled micro controller on the market today – the hardware is perfect for IoT Applications at home, in the office, or on the go. With the latest Espressif chipset, the SiPy offers a perfect combination of power, usability, and flexibility. Sigfox is a good mix of speed to deployment and coverage (depending on the area you are deploying).

No matter the board type you are using WiPy, SiPy, LoPy, or FiPy, the entire Pycom family communicates with Ubidots the same. 

For more information about the Pycom family of hardware just click here.

By following this guide you will be able to send data from your SiPy to Ubidots using the Sigfox network over HTTP.  



  1. Setting up the Hardware

  2. Setting up the Sigfox callback to the Ubidots

  3. Sending (POST) Data to Ubidots

  4. Summary

1. Setting up the Hardware 

Hardware Setup

Before beginning, it is important check the points below to make sure your board is programmed correctly:

If this is your first time working with a Pycom board, we recommend that you reference this getting started guide and then return to this guide for further instruction once you have become more familiar.

1. Using Pymakr Plugin - (Atom) 

To make it as easy as possible, the Pycom Team develop a series of tools known as the Pymakr Plugins, which allow you to connect to any program with your Pycom device.

To get started with your Pymakr, please reference the Pycom installation documentation and follow all the steps provided.

Once finished the "Initial Configuration", you are now able to communicate with your Pycom SiPy using the Pymakr Plugin and you can continue with this guide.

2. Registering the SiPy with Sigfox

In order to send a Sigfox message, you will need to register your SiPy with the Sigfox Backend. Navigate to and then select the Sigfox. Then select Pycom to proceed.

Next, you will need to choose a Sigfox Operator for the country in which you will be activating your SiPy. Find your country and select the operator to continue.

Go to the Pycom doc to know how to get the Device ID and PAC number. 

Once your device is registered in the Sigfox backend you should see it on the Device section as shown on the image below:

NOTE:  Don't forget to connect the antenna to the board. 

2. Setting up the Sigfox callback to the Ubidots Cloud

The management of the data between Sigfox and Ubidots is done via "Callbacks". 

The Sigfox device will read the sensors and send the values to Sigfox's backend. Once the data is received in the Sigfox Backend, you will be able to configure a Sigfox Callback which let you handle the incoming data with 3-Party Platform by using HTTP requests. 

The Sigfox callback allows you to decode the incoming data from the sensors inside the field "custom payload config". Once the data is decoded, the message POST a body to Ubidots containing the data previously decoded. 

DEVELOPMENT NOTE: In the following steps you will find a detailed explanation of how to manage the data in the custom payload config

Now it is time to set up the callback. Go to the Device section and click on the registered device:

Next, verify your device information and select "CALLBACKS" from the menu on the left of the page, as you can see below:

Sigfox callbacks allow you to report data to an external system like Ubidots. To setup a callback to Ubidots API, use these parameters:

  • Type: DATA  - UPLINK 

  • Channel:  URL 

  • Custom payload config: temperature::float:32:little-endian pressure::uint:8 

  • URL pattern:{device}

  • Use HTTP method: POST 

  • Send SNI: Disable 

  • Headers: x-auth-token  - {your_ubidots_token} 

  • Content Type: application/json 

  • Body: 

  "snr" : "{snr}",
  "avgSnr" : "{avgSnr}",
  "rssi" : "{rssi}",
  "temperature" : {"value":"{customData#temperature}"},
  "pressure" : {"value":"{customData#pressure}"}

IMPORTANT NOTE: The field "custom payload config" allows you to specify how you would like Sigfox to decode your device's payload. You might, for example, wish to decode an incoming byte as an unsigned integer. An example of this is the first line of the sample below:

int1::uint:8 // Unsigned integer of 8 bits with name int1
str::char:6 // Character String of 6 letters with name str
b1::bool:7 // Boolean based on value of bit in position 7 with name b1

Where "int1" is the name of the value, "uint:8" specifies the datatype and the number of bits, respectively. To know more about how to build the custom payload config, please reference to the Sigfox documentation pressing the question icon to display help.

IMPORTANT DEPLOYMENT NOTE:  Ubidots and Sigfox communicate via either URL or Batch URL (used for large deployments). This tutorial explains the standard URL channel. If you have a large scale sensor network, please contact to receive additional information for Batch URL integrations.

The Sigfox payload will decode the message and it will be received on the Ubidots side without matter the format used on it, but take in count that you have to set the same format into your device's code because if not, the data will not be received by Sigfox. To verify if the message is received at Sigfox go to the Device section, then select the device's ID:

Next, at the left menu select "message" to visualize the messages received:

Please note the "customData#..." from the body field will contain the actual sensor information, in the example shown as "temperature"and "pressure". If you desire to send more values, you have to assign it at the custom payload config, then assign it at the body following the same structure.

Following this guide, we configured two variables "temperature" as float and "pressure" as uint; You can use the format that you desire but take in count that the device have to send the values using the same format assigned by you at the custom payload config

  • The temperature is configured as "float" which can be either 16, 32 or 64 bits, optionally the endianness for multi-bytes floats, and optionally the bit offset where to start the reading of the first byte. Depending of the bits that you assigns you will be able to send 2 values(16 bits) and 4 values (32 bits) 


  • The pressure is configured as "uint" the parameters are the number of bits to include in the value, optionally the endianness for multi-bytes integers, and optionally the bit offset where to start the reading of the first byte. Using this configuration you will be able to send 12 values.


To know more about how to build the custom payload config, please reference to the sigfox documentation pressing the question icon to display help.

After configuring the callback, your Sigfox backend setup should look like this:

Once you verify the callback, press "OK". Now your callback is ready and enabled to post data o the Ubidots Cloud.

3. Sending (POST) Data to Ubidots 

Setting up the project

1. Open the Atom editor, and activate the Pymakr plugin.

2. Connect the board with the Atom editor. Once the board is connected you will see the message "connected" in the status:

3. To start, create a new directory called "ubidots" to manage the codes and libraries. Once the directory is created, in the Atom editor select Open a Project, and search for the directory "ubidots," which was previously created and open it. 

4. In the file "ubidots" will be managing the libraries and main/boot codes. Please reference and follow the structure below to build your project properly: 

> ubidots
  > lib

DEPLOYMENT NOTE: In the case that you need to use an external micro-python library add a folder for the management of the libraries. Right click on the folder "ubidots" and select "New folder", assign "lib" as name.

Now, we're going to add the main and boot files:

  • Right click the folder "ubidots" and select "New File", assign "" as the name

  • Repeat the above steps to create the main called "":

Once both files are created, the structure of your project will look like this: 

Coding time 

1. Next, copy and paste the code below into the "" file: 

from machine import UART
import machine
import os

uart = UART(0, baudrate=115200)


Save your code once you've uploaded to the "" file.

2. Next, copy and paste the code below into the "" file: 

from network import Sigfox
import socket
import struct

# init Sigfox for RCZ1 (Europe)
sigfox = Sigfox(mode=Sigfox.SIGFOX, rcz=Sigfox.RCZ4)

# create a Sigfox socket
s = socket.socket(socket.AF_SIGFOX, socket.SOCK_RAW)

# make the socket blocking

# configure it as DOWNLINK specified by 'True'
s.setsockopt(socket.SOL_SIGFOX, socket.SO_RX, True)

# send values as little-endian and int, request DOWNLINK
s.send(struct.pack("<f",  23.2)+struct.pack("<B",  45))

# await DOWNLINK message

Save your code once you've uploaded to the "" file.

3. Now synchronize the project. Press the "Sync" icon from the console, or select Packages > Pymakr > Synchronize project.

NOTE: As you can see last part of the "" code the values are sent following the same format assigned at the custom payload config

  • Code: s.send(struct.pack("<f",  23.2)+struct.pack("<B",  45)) 

  • Custom payload config:  temperature::float:32:little-endian pressure::uint:8 

Go to your Ubidots account to visualize the new device created with the variables.

Please note that the "Device API Label" will be the same as the Sigfox {device} field.

IMPORTANT NOTE: If you desire to returns device messages where at least one callback has failed, reference to the Sigfox API to know how to implement it.

4. Summary 

With this, your Sigfox Callback is ready to transmmit the incoming data from the Sigfox devices to Ubidots. 

If you desire to learn how to manage Uplink & Downlink messages, by using Sigfox Callbacks and UbiFunction Egnine, refer to the guides below: 

Now it is time to create a dashboard to control and manage the variables of your Sigfox device. To learn more about Ubidots widgets and events, check out these video tutorials.

Other readers have also found useful...

Did this answer your question?