SigfoxTracker

From RevSpace
Jump to navigation Jump to search
Project SigfoxTracker
Whyunopicture.png
Investigating sigfox location trackers
Status Initializing
Contact bertrik
Last Update 2022-06-16

What

This page is about investigation of Sigfox location trackers, e.g.:

  • how existing trackers work
  • coverage of the sigfox network
  • how to interact with the sigfox backend
  • ultimately, help develop a sigfox tracker for tracking small animals, like bats

Scope limits for now:

  • focus on *one* use case, toward a super-light-weight tag for bats: no GPS, location fix comes from the network (on the order of 1 km)
  • focus on *one* wireless technology, sigfox for the tracker on this page
  • focus on getting position fixes, the only other interesting property is
    • air pressure, to estimate flight altitude: look up local sea level air pressure, calculate theoretical altitude-above-sealevel
  • for bat tracking, solar panels are no good, bats generally avoid daylight
  • battery powered, not use some magical yet-to-be-invented power source (kinetic, moonlight, tiny windmill, radioactive?)
  • use something that has a well-defined radio interface, not re-invent (D)BPSK, just use a radio that has native BPSK support
  • try to use a chip-antenna, for miniaturisation and more isotropic/omni-directional radio behaviour

Next steps:

  • get the STM32WL55 board working again (e.g. re-flash my arduino program to it, or simply erase it over SWD).

Investigation

Interesting reading:

How to get the keys:

coverage

Sigfox coverage, bike trip Gouda-Leidschendam

Existing hardware

LWT-100

This is a tracker made by Invoxia, features:

Apparently this was originally a LoRa tracker, contains a LoRa transceiver, but now uses SigFox! The radio waveform is created by the SX1272, not by a specialized Sigfox chip.

BRKWS01

This is a stand-alone module that can be controlled through "AT" commands to perform sigfox communication: https://partners.sigfox.com/products/sigfox-breakout-board-brkws01

The module is controlled over a 9600 bps serial port connection. Further it requires a 3.3V + GND power connection.

registration

This module comes with a piece of paper containing the device id and the PAC, 2 of the 3 components needed to communicate over the Sigfox network. You can register the module using just this information. The third component (key) is known at the backend and is contained in the module itself, registered before you bought the development kit, so you never really get to (or need to) see this as end user.

Callbacks

I'm using the 'uplink' and 'data advanced' HTTP callbacks to receive the data from the sigfox network:

uplink
  • Log in to backend.sigfox.com
  • Under 'Device types', select a device type and select 'edit'
  • Open 'Callbacks' (left hand menu), add a new callback using 'new' (top-right)
  • Add an 'uplink' callback:
{
  "device":"{device}",
  "time":{time},
  "data":"{data}",
  "seqNumber":{seqNumber},
  "deviceTypeId":"{deviceTypeId}"
}
data advanced
{
  "device": "{device}",
  "time": {time},
  "data": "{data}",
  "seqNumber": {seqNumber},
  "lqi": "{lqi}",
  "linkQuality": {linkQuality},
  "fixedLat": {fixedLat},
  "fixedLng": {fixedLng},
  "operatorName": "{operatorName}",
  "countryCode": {countryCode},
  "deviceTypeId": "{deviceTypeId}",
  "computedLocation": {computedLocation}
}
status

The 'status' callback notifies out-of-band messages:

{
  "device": "{device}",
  "time": {time},
  "seqNumber": {seqNumber},
  "batt": "{batt}",
  "temp": "{temp}"
}

Software

The ST package 'STM32Cube_FW_WL_V1.0.0' has examples for Sigfox: https://www.st.com/en/embedded-software/stm32cubewl.html

In directory XX you can find the following examples:

  • Sigfox_AT_Slave
  • Sigfox_AT_Slave_DualCore
  • Sigfox_PushButton
  • Sigfox_PushButton_DualCore

It appears that, typically, you should edit a file sigfox_data.h to enter the sigfox credentials (device id, pac and key)

The Sigfox credentials can be retrieved from a STM32WL chip as follows:

  • install STM32 cube programmer (I used v2.8.0)
  • connect the STM32WL chip through a STLINK2
  • select the sigfox logo in the left of the screen
  • there is a button "copy chip certificate" and "open sigfox page" that sends you to https://my.st.com/sfxp
  • on that page you can submit the chip certificate data and get a zip in return containing the dev id, pac and key

Arduino tracker

Sigfox coverage, bike trip around Gouda

For investigation purposes, I've created a simple tracker consisting of:

  • a Wemos WROOM-02 board with ESP8266 and an 18650 battery
  • a BRKWS01 sigfox breakout
  • a GPS module

It sends the GPS location fix every minute (so you can do one 140 minute tracking session per day). Payload consists of:

  • latitude in 1E-6 degrees, encoded as 4-bytes signed big endian
  • longitude in 1E-6 degrees, encoded as 4-bytes signed big endian
  • altitude in 0.1m, encoded as 2-bytes signed big endian
  • number of satellites, encoded as 1 -byte unsigned

Arduino software: https://github.com/bertrik/SigfoxTracker Backend logger: https://github.com/bertrik/sigfox-receiver