sigfox world expo - advanced workshop
TRANSCRIPT
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
Twitter: @aureleq
Nicolas Lesconnec
Twitter: @nlesconnec
Register
http://backend.sigfox.com/activate
Provider: Thinxtra
Country: Czech Republic
ID/PAC: check sticker
Xkit Demo App
Copy libraries and DemoApp from github
Upload code (board: Arduino/Genuino Uno)
Open Serial Monitor
Check messages on backend
libraries location
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
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 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
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 Applet
Create new applet « IF Webhooks THEN Google Spreadsheet »
Webhook: custom URL to listen to HTTP requests
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
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
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