SigfoxTracker: Difference between revisions

From RevSpace
Jump to navigation Jump to search
 
(5 intermediate revisions by the same user not shown)
Line 25: Line 25:


Next steps:
Next steps:
* build a very simple tracker with the SNOC board
* get the STM32WL55 board working again (e.g. re-flash my arduino program to it, or simply erase it over SWD).
* get the STM32WL55 board working again (e.g. re-flash my arduino program to it, or simply erase it over SWD).


Line 49: Line 48:
==== LWT-100 ====
==== LWT-100 ====
This is a tracker made by Invoxia, features:
This is a tracker made by Invoxia, features:
* sends positions using sigfox, configured via bluetooth
* sends GPS positions using sigfox, configured via bluetooth
* fcc id ZVS-LWT1: https://fccid.io/ZVS-LWT1/Internal-Photos/Internal-Photos-3734578
* fcc id ZVS-LWT1: https://fccid.io/ZVS-LWT1/Internal-Photos/Internal-Photos-3734578
* ESP-8285 chip, this is a microcontroller similar to ESP-8266, used as a 'WiFi coprocessor'?
* ESP-8285 chip, this is a microcontroller similar to ESP-8266, used as a 'WiFi coprocessor'?
Line 72: Line 71:
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.
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,
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 see this as end user.
registered before you bought the development kit, so you never really get to (or need to) see this as end user.


==== Callbacks ====
==== Callbacks ====
Line 83: Line 82:
* Add an 'uplink' callback:
* Add an 'uplink' callback:
** Type: DATA / UPLINK
** Type: DATA / UPLINK
** Channel: URL
** Channel: URL, URL pattern: http://stofradar.nl:9001/sigfox/uplink
** URL pattern: http://stofradar.nl:9001/sigfox/uplink
** Use HTTP method: POST
** Use HTTP method: POST
** Headers: -
** Headers: -, Content-type: application/json
** Content-type: application/json
** Body:
** Body:
<pre>
<pre>
Line 98: Line 95:
}
}
</pre>
</pre>
===== data advanced =====
===== data advanced =====
* Add an 'data advanced' callback:
* Add an 'data advanced' callback:
** (see also https://support.sigfox.com/docs/data-advanced)
** (see also https://support.sigfox.com/docs/data-advanced)
** Type: SERVICE / ADVANCED
** Type: SERVICE / ADVANCED
** Channel: URL
** Channel: URL, URL pattern: http://stofradar.nl:9001/sigfox/advanced
** URL pattern: http://stofradar.nl:9001/sigfox/advanced
** Use HTTP method: POST
** Use HTTP method: POST
** Headers: -
** Headers: -, Content-type: application/json
** Content-type: application/json
** Body:
** Body:
<pre>
<pre>
Line 125: Line 121:
</pre>
</pre>


===== status =====
The 'status' callback notifies out-of-band messages:
The 'status' callback notifies out-of-band messages:
* Type: SERVICE / STATUS
* Type: SERVICE / STATUS
* URL pattern: http://stofradar.nl:9001/sigfox/status
* URL pattern: http://stofradar.nl:9001/sigfox/status
* User HTTP method: POST
* User HTTP method: POST
* Headers: -
* Headers: -, Content-type: application/json
* Content-type: application/json
* Body:
* Body:
<pre>
<pre>

Latest revision as of 16:26, 16 June 2022

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