SIGFOX Makers Tour - Barcelona

96
#7 Barcelona — 26.11.2015

Transcript of SIGFOX Makers Tour - Barcelona

Page 1: SIGFOX Makers Tour - Barcelona

#7 Barcelona — 26.11.2015

Page 2: SIGFOX Makers Tour - Barcelona

Program

• Slides

• Demo(s)

• Workshop

• Fun

Page 3: SIGFOX Makers Tour - Barcelona

UsNicolas Lesconnec

Developer & Maker Evangelist

Anthony Charbonnier Startup Relations Manager

Jon Regueiro Support Engineer

Page 4: SIGFOX Makers Tour - Barcelona

ABOUT SIGFOX

Page 5: SIGFOX Makers Tour - Barcelona

About SIGFOX

• SIGFOX has invented a radiocommunication protocol

• SIGFOX is operating a global network

• SIGFOX does not sell hardware components

• SIGFOX does not build connected solutions

Page 6: SIGFOX Makers Tour - Barcelona

New possibilities

• Direct Internet connection.

• No battery drain. Years of autonomy.

• Detect. Send. Receive.

• No configuration

Page 7: SIGFOX Makers Tour - Barcelona

In a nutshell

• Power on

• Send a message

• It’s picked up by n of our base stations

• Instantly forwarded to your own server

• That’s it

Page 8: SIGFOX Makers Tour - Barcelona

Complexity

• AT$SF=0123456789

• No pairing or configuration of any kind

• HTTP request to your server

Page 9: SIGFOX Makers Tour - Barcelona

Proof

Page 10: SIGFOX Makers Tour - Barcelona

Why SIGFOX

• Hub-based technologies are not compatible with independent devices

• Need for a protocol designed for the IoT, and not one tweaked to address it.

Page 11: SIGFOX Makers Tour - Barcelona

Core concepts• Energy efficiency

• Very Long Range

• Out of the box connectivity

• Outdoor + Indoor

• Two-way communication

• Low bandwidth, small messages

• Ultra Narrow Band

Page 12: SIGFOX Makers Tour - Barcelona

Energy efficiency

• Tx : ~25/30 mA for a few seconds

• 99.x% of the time, device is silent

• Idle consumption is key

• Idle : a few µA

Page 13: SIGFOX Makers Tour - Barcelona

Very Long Range

• Countryside : Tens of kms

• Cities : A few kms

• Direct line of sight : wow !

Page 14: SIGFOX Makers Tour - Barcelona

Out of the box

• Network is serving the devices, not the other way round

• Device simply sends a frame, message is detected by n base stations

• Message is validated / deduplicated by our backend

Page 15: SIGFOX Makers Tour - Barcelona

Outdoor + indoor

• 868MHz has good propagation properties

• Radio waves are not magic

• Consider ~20dB of attenuation indoor, and ~30dB for light underground or tricky buildings

Page 16: SIGFOX Makers Tour - Barcelona

Two-way communication

• Send updates to your device(s)

• Default behaviour: wake up, send, back to sleep

• No passive Rx mode

• Device can receive a message upon request

• Every communication is instigated by the device

Page 17: SIGFOX Makers Tour - Barcelona

Low bandwidth

• 100 bits / s

• 12 bytes per message

Page 18: SIGFOX Makers Tour - Barcelona

12 bytes !?

• Yes. Seriously. 12 bytes.

• This is the available payload.

• You can put a lot of info in 96 bits

• 2^96 is a 30ish-digit number.

• 8 billions of billions of billions of possible values

Page 19: SIGFOX Makers Tour - Barcelona

Payload examples

• Full GPS Coordinates : 6 bytes

• Temperature : 2 bytes

• State reporting : 1 byte

• Hearbeat, update request : 0 byte

Page 20: SIGFOX Makers Tour - Barcelona

How frequently ?

• 140 times a day

Page 21: SIGFOX Makers Tour - Barcelona

140 times / day

• Not a technology limit

• Compliant with the European regulation: 1% duty cycle

Page 22: SIGFOX Makers Tour - Barcelona

Money• Most pricey subscription: €14/year

• A couple of devices, 140 messages/day

• The higher volume, the lower the price

• The lower number of messages, the lower the price

• Down to €1/year for large volumes & a couple of messages/day

• Startup plan : €8/year, as if already 30k devices.

Page 23: SIGFOX Makers Tour - Barcelona

Security

Page 24: SIGFOX Makers Tour - Barcelona

Security

• Each device is identified by a unique ID on the network

• Each message is signed

• Servers managed by ourselves, in 2 french datacenters.

• Security is never finished, permanent effort.

Page 25: SIGFOX Makers Tour - Barcelona

Signature• Each message is accompanied by an hashed

signature, made from :

• the device id

• the device PK (unknown to the user)

• the payload

• internal increment

Page 26: SIGFOX Makers Tour - Barcelona

Signature

• Replayed messages

• Altered messages

• Spoofed messages

Page 27: SIGFOX Makers Tour - Barcelona

Encryption

• By default, the payload is not encrypted

• Encryption cost a lot of energy

• No « one size fits all » solution.

• Up to you to use the encryption most suited to your case

Page 28: SIGFOX Makers Tour - Barcelona

Radio properties

• Great resistance to interferors

• Very difficult to jam

• Interception is hard

• UNB

• Unpredictable frequency

Page 29: SIGFOX Makers Tour - Barcelona

Radio properties

Page 30: SIGFOX Makers Tour - Barcelona

Ultra Narrow Band

Page 31: SIGFOX Makers Tour - Barcelona

Ultra Narrow Band• The SIGFOX protocol relies on the Ultra Narrow

Band technology

• A message : ~100Hz wide

• Each base station watch a 200KHz part of the spectrum

• Hard part: detect message without knowledge of the precise frequency or schedule

Page 32: SIGFOX Makers Tour - Barcelona

Ultra Narrow Band

• Why Ultra Narrow Band ?

• Easy analogy : cars vs motorbikes

Page 33: SIGFOX Makers Tour - Barcelona

Quiet Base station

Page 34: SIGFOX Makers Tour - Barcelona

Undesired signals

Page 35: SIGFOX Makers Tour - Barcelona

Message received

Page 36: SIGFOX Makers Tour - Barcelona

Frequency used

• SIGFOX uses unlicensed sub-GHz bands :

• 868MHz in Europe

• 902MHz in the US

Page 37: SIGFOX Makers Tour - Barcelona

Unlicensed != unregulated

• SIGFOX complies with both ETSI (Europe) & FCC (US) regulations

• ETSI : 1% duty cycle

• FCC : duration of emission

Page 38: SIGFOX Makers Tour - Barcelona

Coverage

Page 39: SIGFOX Makers Tour - Barcelona

Global network

• Roaming is included in the basic subscription

• Your device can switch from one country to another without additional charges.

Page 40: SIGFOX Makers Tour - Barcelona

Current - Nationwide

• France

• Netherlands

• Spain

• UK

Page 41: SIGFOX Makers Tour - Barcelona

Current - cities• Bogota

• Dublin

• Milan

• Munich

• Santiago

• San Francisco

• …

Page 42: SIGFOX Makers Tour - Barcelona

Rollout in progress• Belgium

• Denmark

• Italy

• Luxembourg

• Portugal

• USA

Page 43: SIGFOX Makers Tour - Barcelona

USA

• Currently: San Francisco

• Early 2016 : 10 majors cities, including Atlanta, Boston, Chicago, Dallas, Houston, Los Angeles

• And we’re just starting :)

Page 44: SIGFOX Makers Tour - Barcelona
Page 45: SIGFOX Makers Tour - Barcelona

Hello World

Page 46: SIGFOX Makers Tour - Barcelona

Hello World

• Send a dummy message

• Check it on the SIGFOX website

• Forward it through the callback mechanism

• Store message in a database

• Display list of recorded events

Page 47: SIGFOX Makers Tour - Barcelona

Use cases

Page 48: SIGFOX Makers Tour - Barcelona

IoT != Connected gadgets

Sexy Stuff

BORING BUT USEFUL

IOT

Page 49: SIGFOX Makers Tour - Barcelona

Good use cases

• Not that talkative devices : small messages every now and then

• Independent devices

Page 50: SIGFOX Makers Tour - Barcelona

Metering & utilities

Page 51: SIGFOX Makers Tour - Barcelona

Smart City

Page 52: SIGFOX Makers Tour - Barcelona

• Track the location of any good or equipment

• Post theft devices

Logistics

Page 53: SIGFOX Makers Tour - Barcelona

Ifttt-like

• Press the button, send an empty frame & trigger any pre determined action

• « Mom I’m home ! »

• « Get me a taxi»

• Replay last order, ~Amazon Dash

Page 54: SIGFOX Makers Tour - Barcelona

« Silver economy »

• Health monitoring, fall alerts, ..

• Without the locked-in effect of gateway-based solutions

• Track the community-payed services effectiveness

• Did the carer really come every day for 2 hours ?

Page 55: SIGFOX Makers Tour - Barcelona

• Know when some equipment is about to fail

• Schedule maintenance works efficiently

Predictive maintenance

Page 56: SIGFOX Makers Tour - Barcelona

Agriculture

• Monitor environment values all over an exploitation : light, soil moisture, ..

• Animal health & location tracking

Page 57: SIGFOX Makers Tour - Barcelona

DIY Projects

• Connected wine cellar. Because french.

• Connected cat food dispenser. Because cats.

• Kitchen garden: temperature, moisture, …

• GPS Tracking of anything

Page 58: SIGFOX Makers Tour - Barcelona

You ?• You can build a PoC very quickly

• Lot of funny stuff to make

• And lot of $$$ to make too ;)

• KISS, dumb device means:

• Cheap

• Less prone to failure

Page 59: SIGFOX Makers Tour - Barcelona

Hardware

Page 60: SIGFOX Makers Tour - Barcelona

Hardware SIGFOX

• SIGFOX is not a hardware vendor

• Many established partners offer SIGFOX-ready chips: Atmel, TI, Silicon Labs, Axsem, Atim, …

• Most Sub-GHz radio transceivers are compatible, it’s just about a software upgrade.

Page 61: SIGFOX Makers Tour - Barcelona

Prototyping

• Arduino : Snootlab, SmartEverything

• Raspberry Pi : Yadom

• Can be bought one unit a time

• Get started within minutes

• Not for industrial use

Page 62: SIGFOX Makers Tour - Barcelona

Modules

• Easy to work with : AT commands

• Price range from ~10 to 20€

• Evaluation boards available from manufacturers : Adeunis, Telecom Design, Telit, ..

Page 63: SIGFOX Makers Tour - Barcelona

SoC, transceivers

• Texas Instruments, Atmel, SiLabs, Axsem, ..

• Cheap, a few $

• More complex to work with if not familiar

• Certification needed if you don’t stick to the provided ref design.

Page 64: SIGFOX Makers Tour - Barcelona

Antenna

• Critical when doing radio

• 868MHz -> best case is 17cm (lambda/2)

• Helicoidal, patch, … antennas possible.

Page 65: SIGFOX Makers Tour - Barcelona

Cloud

Page 66: SIGFOX Makers Tour - Barcelona

Get your data

• Part of the standard service.

• 3 ways

• View - website

• Pull - HTTP API

• Push - HTTP Callback

Page 67: SIGFOX Makers Tour - Barcelona

Common use case : push callbacks

• Get notified each time of your devices send a message

• Can trigger whatever you want : alarm, notification, data processing, …

• Example here: http://github.com/nicolsc/sigfox-callback-demo

Page 68: SIGFOX Makers Tour - Barcelona

Set up a callback

Page 69: SIGFOX Makers Tour - Barcelona

Downlink

• Message sent to a device can be

• Automatic with a pre configuration

• Sent from your own server

Page 70: SIGFOX Makers Tour - Barcelona

Downlink auto

• Simply set what message you want to send back

• Hardcoded

• Time, Station ID, .. for sync purposes

Page 71: SIGFOX Makers Tour - Barcelona

Downlink callback

• Same mechanism than the uplink callback

• Set up an URL

• An when called, send your 8-byte frame within the response body

Page 72: SIGFOX Makers Tour - Barcelona
Page 73: SIGFOX Makers Tour - Barcelona

Real demo

Page 74: SIGFOX Makers Tour - Barcelona

Connected RFID reader

• Standard 125KHz RFID reader & tags

• Once a tag is detected, send its ID through SIGFOX

• Update a live dashboard

• Do something else :)

Page 75: SIGFOX Makers Tour - Barcelona
Page 76: SIGFOX Makers Tour - Barcelona

Resources

• https://github.com/ameltech/

• + Checkout http://github.com/nicolsc for some demos & sample codes

Page 77: SIGFOX Makers Tour - Barcelona

First steps with the SmartEverything

Page 78: SIGFOX Makers Tour - Barcelona

Register• http://backend.sigfox.com/activate

• Click SmartEverything

• Enter the device id of your board + the provided PAC number

• Check http://192.168.5.38:1234/

• Operator : select SIGFOX_Spain

• Enter your personal info

Page 79: SIGFOX Makers Tour - Barcelona

Getting started• Plug the SmartEverything board using a micro USB cable

• Plug the antenna ;)

• Check that it’s recognised by your computer

• $ ls /dev/tty.*

• Windows

• Launch Powershell

• > [System.IO.Ports.SerialPort]::getportnames()

Page 80: SIGFOX Makers Tour - Barcelona

Arduino setup• Install the Arduino Zero core

• Tools > Boards > Board Manager

• Install the ASME core

• Tools > Boards > Manager (Again !), filter on type=Partner

• Choose the SmartEverything Board Type

• Tools > Boards

• Install the libs associated to each sensor (... and to the SIGFOX module)

• Sketch > Include Library > Manage Libraries ; Filter on Type=Partner ; install each library

Page 81: SIGFOX Makers Tour - Barcelona

1st Arduino Sketch• Open the Arduino IDE

• Select Board Type > Smart Everything Fox (USB)

• Select the correct port

• File > Examples > SmartEverything > VL6180X > AmbientLight

• Upload

• The blue LED on the board should blink

Page 82: SIGFOX Makers Tour - Barcelona

Hello World

• File > Examples > SmartEverything > Sigfox > DataModeEU

• Upload

Page 83: SIGFOX Makers Tour - Barcelona

Check message

• http://backend.sigfox.com

• Navigate to the « device » menu

• Click on the device ID

• « Devices messages »

Page 84: SIGFOX Makers Tour - Barcelona

Set up a callback

Page 85: SIGFOX Makers Tour - Barcelona

Callbacks menu

• On your device page, go to Info & click on the device type

• On the device type page, you have a Callbacks menu

• Then, click New on the top right corner

Page 86: SIGFOX Makers Tour - Barcelona
Page 87: SIGFOX Makers Tour - Barcelona

Callback Setup

• You can choose to receive an email, or redirect each message to a URL of your choice

• You can set the headers (content-type, ..), and body format of the HTTP request

Page 88: SIGFOX Makers Tour - Barcelona

Downlink

Page 89: SIGFOX Makers Tour - Barcelona

How does it work ?

• The Module send the frame, then sleep for 20s

• Then it enters Rx mode

• Waits 20s for a response

• Quits Rx mode & goes to deep sleep

Page 90: SIGFOX Makers Tour - Barcelona

Request a downlink

• Use the AT$SF command, with an additional parameters

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

Page 91: SIGFOX Makers Tour - Barcelona

Set up the downlink

Page 92: SIGFOX Makers Tour - Barcelona

Handle the response• When entering Rx mode, the module will display

• +RX BEGIN

• Received frame will be displayed as

• +RX=[hex byte] [hex byte]…

• When leaving Rx mode, it will display

• +RX END

Page 93: SIGFOX Makers Tour - Barcelona

Handle the response

• Detect an input line starting with +RX= & parse it as a series of hex bytes

• If no downlink message has been sent, you’ll have no +RX= line, just the BEGIN & END flags

Page 94: SIGFOX Makers Tour - Barcelona

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 95: SIGFOX Makers Tour - Barcelona

Contribute

Page 96: SIGFOX Makers Tour - Barcelona

Share• Please share what you’ll make with SIGFOX

• Hackster.io, instructables, github … your move.

• Q&A

• http://sigfox.cloud.answerhub.com/

• Keep in touch :

[email protected]

• twitter: @nlesconnec