Sigfox World Expo - Advanced Workshop

30
IOT World Expo Sigfox Advanced Workshop September 2017

Transcript of Sigfox World Expo - Advanced Workshop

IOT World Expo Sigfox Advanced Workshop

September 2017

Topics

Downlink callback

Event monitoring

Geolocation callback

Advanced callbacks with custom payloads

AT commands to Xkit shield

Useful resources

https://www.thinxtra.com/xkit/

https://github.com/aureleq/Xkit-Sample

https://resources.sigfox.com/

https://build.sigfox.com/

Contact

Aurelien Lequertier

[email protected]

Twitter: @aureleq

Nicolas Lesconnec

[email protected]

Twitter: @nlesconnec

Register

http://backend.sigfox.com/activate

Provider: Thinxtra

Country: Czech Republic

ID/PAC: check sticker

Hello World

Xkit Demo App

Copy libraries and DemoApp from github

Upload code (board: Arduino/Genuino Uno)

Open Serial Monitor

Check messages on backend

libraries location

Downlink Callback

How does it work?

Downlink flag included in Sigfox message

20 sec after first frame transmission, the module wakes up and waits for downlink response (25 sec window)

Downlink Callback setup

Automatic callback: Device Type > Informations > Edit

Set Downlink mode to DIRECT

Enter an 8 bytes value

Xkit Demo App – Downlink

In Send_Pload() function, comments the « No Downlink message require » part

Uncomment the « non-blocking downlink message » part

Upload the code and check RX message in Serial Monitor

Event monitoring

Monitor break in sequence number

New Event: Device > Event Configuration > New

Select Event Type « Out of message sequence »

Select « EMAIL » as channel and enter your email address and email content

Monitor break in sequence number

Remove the antenna of the Xkit to simulate a coverage issue

Send a message

Re-attach the antenna and send a new message

Check reception of email notification

Geolocation Callback

Geolocation CallbackCreate a new Service > Geoloc callback

Use following URL to center the map: https://maps.googleapis.com/maps/api/staticmap?center={lat},{lng}&zoom=13&scale=1&size=600x300&maptype=roadmap&format=png&visual_refresh=true

Advanced Callbacks with IFTTT

Advanced Callbacks

Goal: Save Xkit temperature and light intensity in a Google Drive spreasheet

How: Transfer message to IFTTT webhook and save content to a linked GDrive spreadsheet

IFTTT?

IF this THEN that

Free service to create conditional statements (no coding)

IFTTT Applet

Create new applet « IF Webhooks THEN Google Spreadsheet »

Webhook: custom URL to listen to HTTP requests

IFTTT Applet

IFTTT Applet

IFTTT Applet

Value[1-3] are variables forwarded by webhook

Value1 will contain Temp

Value2 will contain Light

Callback Configuration

Retrieve your IFTTT webhook URL here: https://ifttt.com/maker_webhooks > Documentation

Callback Configuration

Create a new Custom Callback (> Device Type)

Configure custom payload , URL pattern and JSON content

Running Demo App

Send a message using Xkit

Check your Google Doc has been created/updated

Bonus

Configure your callback URL with following value to send a message to LaMetric clock:

curl https://maker.ifttt.com/trigger/sigfox/with/key/c5sHKSNd1SK7rtY5s5S_0z -X POST -v -H "Content-Type:application/json" -d '{"value1":"one", "value2":"two"}'

AT Commands to Xkit shield

AT commands to Xkit shield

Disconnect shield from Arduino board

Set jumpers to « Power from USB Port »

Open your favorite terminal app (ie: Tera Term) with parameters:

- Speed 9600

- Data bits: 8

- Stop bits: 1

- Parity: None

AT commands to Xkit shield

Testing UART connection: AT (returns OK)

Getting device ID: AT$I=10

Sending payload: AT$SF=CAFE1234

Sending payload with downlink request: AT$SF=CAFE1234,1

Full list of AT commands: https://github.com/Thinxtra/Xkit-Sample/tree/master/Document/Wisol_Comands_and_Schematics