The Wia Developer Hub

Welcome to the Wia developer hub. You'll find comprehensive guides and documentation to help you start working with Wia as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    

SiPy

How to setup a Pycom SiPy and publish an event to Wia

Pycom SiPy

Pycom SiPy

Want to connect via Wi-Fi?

Follow our WiPy tutorial here.

Components

  • Pycom SiPy
  • Sigfox antenna

Setup Your Development Environment

We'll be using Atom as our development environment. You can download the latest version from here. Once you've got it setup, install the Pymakr plugin. Follow the steps in this tutorial to get it setup.

Connect to the Board

There are two ways to connect your board to your computer. You can do so either via the USB port on the Expansion Board or Pysense/Pytrack boards (more on that here).

Alternatively you can communicate with the board via a USB to TTL cable. Connect the following pins:

SiPy
USB TTL

GND

GND

TX0

RX

RX0

TX

3.3V

VCC

SiPY pinout diagram

SiPY pinout diagram

Ensure your external antenna is connected before attempting to send Sigfox messages. If you do not do this, you can risk damaging your dev board

The connection is the small gold circle on the bottom left of the SiPy board. Simply snap the antenna in place.

Sigfox antenna

Sigfox antenna

Preparing the USB serial port

Once you've got it connected to your computer, you'll need to make sure the correct serial port is available.

Linux and Mac OS X

  • Download and install the FTDI drivers from here. Select the appropriate version for your operating system and architecture.

For Linux, you may need to run the two commands below. Once you've completed that, reboot your computer. This will add permissions that will allow you to upload a sketch to the board.

sudo usermod -a -G tty ${USER}
sudo usermod -a -G dialout ${USER}

Windows

  • Download and install the FTDI drivers from here. Select the appropriate version for your operating system and architecture.
  • Open the Windows start menu and search for Device Manager
  • The COM port for the Pycom device will be listed as USB Serial Device or something similar
    • Keep note of the COM port (e.g. COM4)

Setup Your Project

Important

Make sure you have the latest version of the Pymakr plugin!

  • Create a new folder for your project
  • In Atom, go to File > New Window to open a new window
  • Add your newly created folder by clicking File > Add Project Folder and navigating to it
  • If the Pymakr plugin is not open at the bottom of your Atom window, click on the arrow on the right hand side to open it
  • In the Pymakr console at the bottom, click 'More' in the top right menu, then click 'Get serial ports'. This will copy the name of the correct serial port to your clipboard.
  • Select Settings > Project Settings. In the address field replace the value with the contents of your clipboard e.g. /dev/tty.usbmodemPy343431 (/Mac OS X), /dev/ttyACM0 (LInux), COM3 (Windows) then save the file.

Retrieve your Device ID and PAC number

To ensure the Device is provisioned with Device ID and PAC number, please update to the latest firmware. This should be completed if your Device has not been used before. You can find the latest firmware update tool and steps here

Remember to save the Device Id and PAC number. When you have updated the firmware as you'll need them to register the Device with Sigfox.

Registering with Sigfox

In order to send a Sigfox message, the device needs to register with the Sigfox Backend. Navigate here to complete the registration process.

  • First choose your country from the Search bar as shown below.
  • Click Next
Choose Country

Choose Country

  • Enter the Device Id and PAC number obtained earlier
  • Add a description of the project you attend on using the Sigfox Device for
Device Id and PAC

Device Id and PAC

  • Add the Device ID and PAC number obtained from the code earlier and place them into the corresponding fields below
  • Click next to register your device

  • If you haven't already, sign up with Sigfox then you will be taking back

Sending Your First Sigfox Message

  • Create a new file, name it boot.py
  • Copy and paste the code below
from machine import UART
import machine
import os


uart = UART(0, baudrate=115200)
os.dupterm(uart)

machine.main('main.py')

  • In Atom, right click on your project and click New File. Enter main.py as the filename
  • Copy and paste the code below into the file
from network import Sigfox
import socket

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

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

# make the socket blocking
s.setblocking(True)

# configure it as uplink only
s.setsockopt(socket.SOL_SIGFOX, socket.SO_RX, False)

# send some bytes
s.send(bytes([0x01, 0x02, 0x03]))

Ensure your external antenna is connected before attempting to run the code. If you do not do this, you can risk damaging your device!

  • Go to Packages > Pymakr > Toggle Pycom Console
  • Click Upload in the Pymakr plugin at the bottom of your window in Atom and send the code to your Pycom board

View your message in the Sigfox dashboard

  • Go to the Sigfox dashboard, found here
  • On your Sigfox account, click on the Device tab, click on your Device ID and click Messages
Device message

Device message

Connecting Sigfox with Wia

First, Sigfox must be integrated with Wia to see your Sigfox messages in Wia.
The tutorial can be accessed here

Receiving the message on Wia

If the callback has been properly setup between Sigfox and Wia, when you send a message to Sigfox. it should also be displayed in Wia

  • Go to your Space that has your Sigfox integration
  • Click on Device that matches the Sigfox device on the Sigfox website
  • Click on the events tab and the Sigfox messages should be displayed

Troubleshooting

If your board gets stuck with the message "Uploading project (main folder)...", try updating the firmware. For the development board click here. For additional firmware for the Pysense/Pytrack board click here.

SiPy


How to setup a Pycom SiPy and publish an event to Wia

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.