Spivey
Published © MIT

Publish Any Event to Wia Using Your Pycom SiPy

How to setup a Pycom SiPy and publish an event or location to Wia.

BeginnerFull instructions provided1 hour647
Publish Any Event to Wia Using Your Pycom SiPy

Things used in this project

Hardware components

SiPy
Pycom SiPy
×1
Sigfox Antenna
×1

Software apps and online services

Wia
Wia

Story

Read more

Schematics

SiPy

Code

boot.py

Python
from network import Sigfox
import binascii
from machine import UART
import machine
import os

# initalise Sigfox for RCZ1 (Europe) (You may need a different RCZ Region)
sigfox = Sigfox(mode=Sigfox.SIGFOX, rcz=Sigfox.RCZ1)

# print Sigfox Device ID
print("ID: ", binascii.hexlify(sigfox.id()))

# print Sigfox PAC number
print("PAC: ", binascii.hexlify(sigfox.pac()))

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

machine.main('sigfox_message.py')

sigfox_message.py

Python
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("Hello Wia")

Credits

Spivey
82 projects • 59 followers
Tourist in a Tutu || US Born || Melbourne/Mexico/California Raised || New Yorker at ❤️ || SF to Dublin to be COO of Wia the best IoT startup
Thanks to Alan Donoghue.

Comments