sigfox workshop with akeru & thethings.io

38
Workshop AKERU + THETHINGS.IO

Upload: nicolas-lesconnec

Post on 16-Jan-2017

612 views

Category:

Engineering


3 download

TRANSCRIPT

Page 1: Sigfox Workshop with Akeru & TheThings.io

WorkshopAKERU + THETHINGS.IO

Page 2: Sigfox Workshop with Akeru & TheThings.io

Contribute

Page 3: Sigfox Workshop with Akeru & TheThings.io

Contribute

Don’t forget to publish your experiments

Code Samples, HW design, fails … will be useful to other

people

We all start by copy/pasting ;)

Your own website, github, hackster.io, instructables … your

call!

Page 4: Sigfox Workshop with Akeru & TheThings.io

We’re hiring !

Maker In Residence

(internship)

Build useful and/or funny

prototypes

Test new hardware

Publish & document them

Field Evangelist Europe

Run workshops

Talk at conferences

Support the community

Page 5: Sigfox Workshop with Akeru & TheThings.io

Useful Resources

Workshop slides

http://bit.ly/SigfoxMakersTour

Q&A

http://

sigfox.cloud.answerhub.com/

Github

http://github.com/sigfox/makers-tour-resources

http://github.com/nicolsc

http://github.com/thethings/thethings.iO-Sigfox-SDK

Add your own !

Page 6: Sigfox Workshop with Akeru & TheThings.io

Register

http://backend.sigfox.com/activate

Provider: Snootlab

Country : Ireland

Device ID: sticker on the board

PAC: check the list

Page 7: Sigfox Workshop with Akeru & TheThings.io

The things.io

Data management platform

Free to use for attendees

Page 8: Sigfox Workshop with Akeru & TheThings.io

thethings.iO analytics (1 of 3)Go to https://sigfox.thethings.io

Page 9: Sigfox Workshop with Akeru & TheThings.io

Register @ thethings.iO

https://sigfox.thethings.io

Register user

Create a Sigfox product

Page 10: Sigfox Workshop with Akeru & TheThings.io

HELLO WORLD

Page 11: Sigfox Workshop with Akeru & TheThings.io

Hello World Sketch

Open the Arduino IDE

Select the board

Board type : Arduino Uno

Port : USB-something

Page 12: Sigfox Workshop with Akeru & TheThings.io

Hello World Sketch#include <SoftwareSerial.h>

SoftwareSerial sigfox(5,4);

void setup(){

Serial.begin(9600);

sigfox.begin(9600);

sigfox.write("AT$SF=48 45 4c 4c 4f 20 57 4f 52 4c 44\r");

}

void loop(){

while (sigfox.available()){

Serial.print(sigfox.read());

}

}

Page 13: Sigfox Workshop with Akeru & TheThings.io

Message received ?

http://backend.sigfox.com

Navigate to the devices menu in the top bar

Click on the ID of your device

Enter the messages menu from the left navigation

column

Page 14: Sigfox Workshop with Akeru & TheThings.io

First callback

Page 15: Sigfox Workshop with Akeru & TheThings.io

Callback setup

Device Type menu

Click on your device type name

Enter the Callbacks menu

Select new default callback

Page 16: Sigfox Workshop with Akeru & TheThings.io

Callback setup

TYPE : DATA UPLINK

Choose a CHANNEL : URL (EMAIL for a quick test)

Url pattern: URL of your own server

Use HTTP method: GET/POST/PUT

Page 17: Sigfox Workshop with Akeru & TheThings.io

Callback status

In the Devices > Messages panel, you have a indicator of the callback

status (an arrow)

Black : in progress

Green : Callback OK

Red : Callback KO

Click the arrow to display details.

KO means at least one of the callbacks failed

Page 18: Sigfox Workshop with Akeru & TheThings.io

Downlink

Page 19: Sigfox Workshop with Akeru & TheThings.io

How does it work ?

Send a message, with a downlink flag

Once message is sent, the module gets back to sleep

After 20s, it will wake up automatically, in Rx mode

It will wait 20s for a downlink message

Afterwards it will get back to sleep

Page 20: Sigfox Workshop with Akeru & TheThings.io

Downlink setup

To setup an automatic callback :

Device Type > Info > Edit

In the Downlink data settings, set the following :

Downlink Mode : DIRECT

Set the following value : 123400000BADCAFE

Page 21: Sigfox Workshop with Akeru & TheThings.io

How to request a downlink

Same AT command, with additional parameters

AT$SF=[hex byte]*, 2, 1

Page 22: Sigfox Workshop with Akeru & TheThings.io

Handle the response

When entering Rx mode, the module will display

+RX BEGIN

Received frame (if any) will be displayed as:

+RX= [byte] [byte] [byte] [byte] [byte] [byte] [byte] [byte]

End of Rx mode

+RX END

Page 23: Sigfox Workshop with Akeru & TheThings.io

Downlink callback

In Device Type > Info > Edit

change Downlink mode to CALLBACK

Create a new default callback, with TYPE : DATA |

BIDIR

Then set up your URL

Page 24: Sigfox Workshop with Akeru & TheThings.io

Sample input output

AT$SF=55 50 4C 49 4E 4B, 2, 1

OK

+RX BEGIN

+RX=44 4F 57 4E 4C 49 4E 4B

+RX END

Page 25: Sigfox Workshop with Akeru & TheThings.io

Sample code

Arduino

https://github.com/sigfox/makers-tour-resources/tree/

master/Akeru/downlink

Server side

https://github.com/nicolsc/sigfox-downlink

PR welcome in different languages

Page 26: Sigfox Workshop with Akeru & TheThings.io

FIRST SKETCHWITH THETHINGS.IO CODE

Page 27: Sigfox Workshop with Akeru & TheThings.io

Random number Sketch

Download the akeru library inside thethings.iO sigfox github

and place it to your Documents > Arduino > Libraries folder.

Open the Arduino IDE

Copy & Paste thethings.iO Arduino code from thethings.iO

Sigfox github

Board type : Arduino Uno

Page 28: Sigfox Workshop with Akeru & TheThings.io

Message received ?http://backend.sigfox.com

Navigate to the devices menu in the top bar

Click on the ID of your device

Enter the Statistics menu from the left navigation

column

Page 29: Sigfox Workshop with Akeru & TheThings.io

thethings.iO analytics (1 of 3)Go to Things Manager > Product Details

Page 30: Sigfox Workshop with Akeru & TheThings.io

thethings.iO analytics (2 of 3)

Page 31: Sigfox Workshop with Akeru & TheThings.io

TheThings.io callback

TYPE : DATA UPLINK

Choose a CHANNEL : URL

Url pattern: Paste your subscription URL

Use HTTP method: POST

Page 32: Sigfox Workshop with Akeru & TheThings.io

thethings.iO analytics (3 of 3)Go to Cloud Code > Functions

Edit the sigfox_parser Function (thethings.iO

github)

Page 33: Sigfox Workshop with Akeru & TheThings.io

thethings.iO analytics (3 of 3)Make a cool dashboard!

Page 34: Sigfox Workshop with Akeru & TheThings.io

Go furtherUSING AN AKERU BOARD

Page 35: Sigfox Workshop with Akeru & TheThings.io

Other AT commands

AT&V : Detailed info about the module

AT$SF=[hex byte]* : Send a frame

ATS300=[int] Schedule the emission of a keep-alive frame every [int] hours

AT&W : Save settings

ATI26 :Module temperature in °C

ATI27 : Module idle power supply voltage

Page 36: Sigfox Workshop with Akeru & TheThings.io

Other AT commands

Arduino sample code + link to full references of

the TD1208 module

https://github.com/sigfox/makers-tour-resources/tree/

master/Akeru/mirror

Page 37: Sigfox Workshop with Akeru & TheThings.io

Use the module only

The module has a Cortex M3 than you can

reprogram

Checkout the TD Next website for instructions

http://rfmodules.td-next.com/sdk/

Page 38: Sigfox Workshop with Akeru & TheThings.io

Keep in touchNicolas

nicolas.lesconnec@sigf

ox.com

twitter: @nlesconnec

Anthony

anthony.charbonnier@sigf

ox.com

twitter: @Anth0_Carles & Bastian [email protected] [email protected]

twitter: @thethingsiO