3. Tutorials and examples

Great, so you’ve connected your board and ran some basic scripts, now it’s time to delve a little deeper. This section contains some tutorials and examples for your Pycom module.

Chapter 3.1 General Pycom tutorials contains tutorials that can be run on any Pycom board, such as connecting to a WIFI network, Bluetooth, controlling I/O pins etc. Sections 3.2 and 3.3 are specific to the LoPy and SiPy such as setting up a LoRa node or connecting to the Sigfox network.

Before starting, make sure that you are running the latest firmware, for instructions see Firmware Upgrades.

The source code for these tutorials, along with the required libraries can be found in in the pycom-libraries repository on Pycom’s Github account here.

3.2 LoPy Tutorials

The following tutorials demonstrate the use of the LoRa functionality on the LoPy. LoRa can work in 2 different modes; LoRa-MAC (which we also call Raw-LoRa) and LoRaWAN mode.

LoRa-MAC mode basically accesses de radio directly and packets are sent using the LoRa modulation on the selected frequency without any headers, addressing information or encryption. Only a CRC is added at the tail of the packet and this is removed before the received frame is passed on to the application. This mode can be used to build any higher level protocol that can benefit from the long range features of the LoRa modulation. Typical uses cases include LoPy to LoPy direct communication and a LoRa packet forwarder.

LoRaWAN mode implements the full LoRaWAN stack for a class A device. It supports both OTAA and ABP connection methods, as well as advanced features like adding and removing custom channels to support “special” frequencies plans like the those used in New Zealand.

3.3 SiPy Tutorials

To ensure your device has been provisioned with Device ID and PAC number, please update to the latest firmware.

The following tutorials demonstrate how to register and get started with the SiPy. The SiPy can be configured for operation in various countries based upon specified RCZ zones (see the Sigfox class for more info). The SiPy supports both uplink and downlink Sigfox messages as well as device to device communication via its FSK Mode Sigfox.