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.
**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
Connect to the BoardThere 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:
Once you've got it connected to your computer, get the name of your device using one of the following steps:
Linux and Mac OS X- Open a terminal window and run the command
ls /dev/tty*
- Look for a device with the name that begins with
/dev/tty
e.g./dev/tty.usbmodemPy343431
on MAC or/dev/ttyUSB0
/dev/ttyACM0
on Linux.
- Download and install the FTDI drivers from here
- 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)
Note: For Linux, you may need to run the following commands and logoff and on again to add permissions to upload a sketch to the board
sudo usermod -a -G tty ${USER}sudo usermod -a -G dialout ${USER}
Setup Your Project- 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
- Select
Settings > Project
Settings. In theaddress
field replace the value with the device name from the step above e.g./dev/tty.usbmodemPy343431
(/Mac OS X), /dev/ttyACM0 (LInux),COM3
(Windows) then save the file
Note: To ensure the device has been provisioned with Device ID and PAC number, please update to the latest firmware.
To retrieve your devices:
- Create a new file, name it
boot.py
- Copy and paste the code named boot.py
NOTE - 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
- Click
Run
to run your code on the board
In order to send a Sigfox message, the device needs to register with the Sigfox Backend. Navigate here to find the list of Sigfox enabled development kits.
Choose the Sigfox operator that represents your country.
- Add the
Device ID
andPAC
number obtained from the code earlier and place them into the corresponding fields below
- Click
next
to register your device
- In Atom, right click on your project and click
New File
. Entersigfox_message.py
as the filename
- Copy and paste the code named sigfox_message.py below into the file
- Click
Upload
in the Pymakr plugin at the bottom of your window in Atom and send the code to your Pycom board
- Click
Run
to run your code on the board
- Go to the Sigfox dashboard, found here
- On your Sigfox account, click on the
Device
tab, click on yourDevice ID
and clickMessages
First, Sigfox must be integrated with Wia to see your Sigfox messages in Wia.The tutorial can be accessed here
Receiving the message on WiaIf the callback has been properly setup between Sigfox and Wia, the message 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
Note: 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.
Comments