Mais conteúdo relacionado Semelhante a Building DASH7 Apps with OpenTag (20) Building DASH7 Apps with OpenTag1. OpenTag: Office Hours
JP Norair
12 May 2011
jpnorair@indigresso.com
skype: jpnorair
Copyright © DASH7 Alliance
2. ‣ Some information about DASH7 (for noobs)
‣ What you get [with OpenTag]
OpenTag: Office Hours
‣ Where to get it
JP Norair ‣ What you can do to help
12 May 2011
jpnorair@indigresso.com
‣ Project Roadmaps
skype: jpnorair ‣ Answering your Questions
Copyright © DASH7 Alliance
3. DASH7 Mode 2 is a 2nd Generation WSN/IoT/RFID Technology
433 MHz band
8 channels
Optimized for
Optimized for
Low Latency
Micro Power
(Bursty Data)
Mode 2
Universal Adaptive Data Rate
Interoperability 28 - 200 kbps
Very Fast Compact Stack
Multicast typ. 16KB
Copyright © DASH7 Alliance
4. About DASH7 Alliance
Next Meeting: 21 June
• Specification Development in San Francisco
‣ Mode 2 (basically done)
‣ “DNA” Middleware layer
‣ NFC integration
‣ More
• Market Development
• ISO Stewardship
• Go to dash7.org to see new membership
terms, and other information.
Copyright © DASH7 Alliance
5. What You Get [with OpenTag]
OpenTag is a very purpose-built OS that uses DASH7 I/O
OpenTag Component What it Does
Low Level Radio Driver PHY & MAC Control
System Event and Session Manager (OS-like)
Network Protocols (M2NP, M2DP, M2AdvP) Routing, Raw Data, Group Synchronization
Transport Protocols (M2QP) Query / Data Acquisition, Data Transfer
Filesystem Read, Write, Create, Delete, Etc.
Application Modules Built-in Apps (none yet)
C API Library functions (Programming apps in C on the same device)
Serial API(s) Client-Server (Communicating the apps via another device)
Copyright © DASH7 Alliance
6. Where to Get it
Signup, Forums, Mailing List, other support
http://sourceforge.net/projects/opentag
Latest Code Download (use Git)
git clone git://opentag.sourceforge.net/gitroot/opentag/OpenTag_M2
OpenTag and Mode 2 Wiki (in continuous development)
http://www.indigresso.com/wiki
Copyright © DASH7 Alliance
7. Where to Get it
Signup, Forums, Mailing List, other support
http://sourceforge.net/projects/opentag
Latest Code Download (use Git)
Don’t understand Git?
git clone git://opentag.sourceforge.net/gitroot/opentag/OpenTag_M2
Google is your friend
(Git documentation is good)
OpenTag and Mode 2 Wiki (in continuous development)
http://www.indigresso.com/wiki
Copyright © DASH7 Alliance
8. How You Can Help
Core
Beta Testing Development Documenting
Copyright © DASH7 Alliance
9. How You Can Help
Core
Beta Testing Development Documenting
• Currently about 3 Beta testers
(you know who you are: if you
want to be recognized, email me)
• Download the code, compile,
and play with it. You will find
bugs and have questions.
‣ Send messages on developers
mailing list (sourceforge).
‣ Skype me, for quick info
Copyright © DASH7 Alliance
10. How You Can Help
Core
Beta Testing Development Documenting
• Currently about 3 Beta testers • Currently just me (officially)
(you know who you are: if you
want to be recognized, email me) • Requires a good understanding
of the code and specification
• Download the code, compile, ‣ My estimation: will take you
and play with it. You will find 3-6 weeks to get here
bugs and have questions.
‣ Send messages on developers • Two possibilities
mailing list (sourceforge).
‣ OT library development
‣ Skype me, for quick info ‣ Porting to other platforms
Copyright © DASH7 Alliance
11. How You Can Help
Core
Beta Testing Development Documenting
• Currently about 3 Beta testers • Currently just me (officially) • Currently just me
(you know who you are: if you
want to be recognized, email me) • Requires a good understanding • Requires a good understanding
of the code and specification of the code or specification
• Download the code, compile, ‣ My estimation: will take you
and play with it. You will find 3-6 weeks to get here • Many possibilities
bugs and have questions.
‣ Wiki
‣ Send messages on developers • Two possibilities ‣ Formal documents
mailing list (sourceforge).
‣ OT library development ‣ Academic research papers
‣ Skype me, for quick info ‣ Porting to other platforms
Copyright © DASH7 Alliance
13. Feature Roadmap: Now it is a Race
SS Pre-alpha & Alpha:
Module testing and simulation
(usually on PC)
Copyright © DASH7 Alliance
14. Feature Roadmap: Now it is a Race
SS Pre-alpha & Alpha:
Module testing and simulation
(usually on PC)
SS Beta 0 (current):
Initial Platform Testing (CC430)
without Serial API, not all
features are complete
Copyright © DASH7 Alliance
15. Feature Roadmap: Now it is a Race
SS Pre-alpha & Alpha:
Module testing and simulation
(usually on PC) SS Beta 1:
Testing platform(s) using Serial
API, and completion of all
features for version 1.0
SS Beta 0 (current):
Initial Platform Testing (CC430)
without Serial API, not all
features are complete
Copyright © DASH7 Alliance
16. Feature Roadmap: Now it is a Race
SS Pre-alpha & Alpha:
Module testing and simulation
(usually on PC) SS Beta 1:
Testing platform(s) using Serial
API, and completion of all
features for version 1.0
SS Beta 2:
Feature complete debug and
official compliance testing
SS Beta 0 (current):
Initial Platform Testing (CC430)
without Serial API, not all
features are complete
Copyright © DASH7 Alliance
17. Feature Roadmap: Now it is a Race
SS Pre-alpha & Alpha:
Module testing and simulation
(usually on PC) SS Beta 1:
Testing platform(s) using Serial SS Version 1.0:
API, and completion of all Bundling of official code
features for version 1.0 packages for platforms
SS Beta 2:
Feature complete debug and
official compliance testing
SS Beta 0 (current):
Initial Platform Testing (CC430)
without Serial API, not all
features are complete
Copyright © DASH7 Alliance
18. Feature Roadmap: Now it is a Race
SS Pre-alpha & Alpha:
Module testing and simulation
(usually on PC) SS Beta 1:
Testing platform(s) using Serial SS Version 1.0:
API, and completion of all Bundling of official code
features for version 1.0 packages for platforms
SS Beta 2:
Feature complete debug and
official compliance testing
position
SS Beta 0 (current):
Initial Platform Testing (CC430)
without Serial API, not all
features are complete
Copyright © DASH7 Alliance
19. Planned Platform Support (Official)
Beta 0:
CC430, POSIX Simulator
Beta 1:
Beta 0 + ADuCRF101 +
SX1231 Module
Beta 2:
No additional, planned
“official” platforms
Copyright © DASH7 Alliance
20. Planned Platform Support (Official)
Beta 0:
CC430, POSIX Simulator
Beta 1:
Beta 0 + ADuCRF101 +
SX1231 Module
“Official” just means that I personally
know it works. If you develop a Beta 2:
working platform and send one to No additional, planned
me, I will make it official
“official” platforms
Copyright © DASH7 Alliance
21. Case Studies (Comprehensive Answers to Recently Asked Questions)
‣ How does OpenTag enable location derivation?
‣ Can OpenTag do multihop and mesh?
‣ How are events processed?
‣ How many simultaneous connections are supported?
‣ How is data stored and logged?
‣ What is the deal with wireless regulations at 433 MHz?
Copyright © DASH7 Alliance
23. DASH7 Mode 2 Has Two Features that Enable Location Derivation
Feature 1: Normalized RSSI
Without Normalized RSSI
With Normalized RSSI
Devices need to know
Devices in a network are free to
configurations of all other
use different power outputs
devices in the network
Open Loop Closed Loop
Copyright © DASH7 Alliance
24. DASH7 Mode 2 Has Two Features that Enable Location Derivation
Feature 1: Normalized RSSI
DASH7 Mode 2 Foreground Frame Architecture
Length TX EIRP Subnet Frame Other Data Footers CRC
(Bytes) (0.5 dBm) Filter Control Headers Payload (crypto)
1 Byte 1 Byte 1 Byte 1 Byte 0-52 Bytes 0-249 Bytes 0-40 Bytes 2 Bytes
0-255 -40 to 23.5 — — (optional) — (optional) —
Mode 2 transmissions tell the
receiver how much power was used,
so the receiver can normalize the
RSSI dynamically
Copyright © DASH7 Alliance
25. DASH7 Mode 2 Has Two Features that Enable Location Derivation
Feature 1: Normalized RSSI
DASH7 Mode 2 Foreground Frame Architecture
Length TX EIRP Subnet Frame Other Data Footers CRC
(Bytes) (0.5 dBm) Filter Control Headers Payload (crypto)
1 Byte 1 Byte 1 Byte 1 Byte 0-52 Bytes 0-249 Bytes 0-40 Bytes 2 Bytes
0-255 -40 to 23.5 — — (optional) — (optional) —
Mode 2 transmissions tell the This feature can be used to enable
receiver how much power was used, location derivation and also to filter
so the receiver can normalize the out transmissions that are too far
RSSI dynamically away (configurable)
Copyright © DASH7 Alliance
26. DASH7 Mode 2 Has Two Features that Enable Location Derivation
(2) Buferring Location Data
Location can be derived from
Location List an algorithm that uses data
Flags Device ID Loc. Data from multiple coordinates
coord 1
1 Byte 2/8 Bytes 3 Bytes
Flags Device ID Loc. Data
Location Coordinate coord 2
1 Byte 2/8 Bytes 3 Bytes
Flags Device ID Loc. Data
1 Byte 2/8 Bytes 3 Bytes Flags Device ID Loc. Data
coord 3
1 Byte 2/8 Bytes 3 Bytes
…
Data may contain normalized RSSI’s Flags Device ID Loc. Data
from 1 to 3 antennas, and also angle coord N
1 Byte 2/8 Bytes 3 Bytes
of incidence information
Copyright © DASH7 Alliance
27. DASH7 Mode 2 Has Two Features that Enable Location Derivation
(2) Buferring Location Data
Location can be derived from
Location List an algorithm that uses data
Flags Device ID Loc. Data from multiple coordinates
coord 1
1 Byte 2/8 Bytes 3 Bytes
Flags Device ID Loc. Data
Location Coordinate coord 2 DASH7 does not specify the
1 Byte 2/8 Bytes 3 Bytes
Flags Device ID Loc. Data
algorithm to use, just the way
data is stored. The algorithm
1 Byte 2/8 Bytes 3 Bytes Flags Device ID Loc. Data
coord 3 is up to you!
1 Byte 2/8 Bytes 3 Bytes
…
Data may contain normalized RSSI’s Flags Device ID Loc. Data
from 1 to 3 antennas, and also angle coord N
1 Byte 2/8 Bytes 3 Bytes
of incidence information
Copyright © DASH7 Alliance
28. OpenTag Implements Normalized RSSI
DASH7 Location Usage
Features RSSI is implemented in the Radio
Driver. During any reception,
Normalized RSSI
OpenTag buffers the non-
Angle of Incidence
normalized RSSI value on each
antenna (typically 1) You can get it
by calling radio_rssi()
Requires special HW, not
currently tested or
implemented in OpenTag
Copyright © DASH7 Alliance
29. OpenTag Implements Normalized RSSI
DASH7 Location Usage
Features RSSI is implemented in the Radio
Driver. During any reception,
Normalized RSSI
OpenTag buffers the non-
Angle of Incidence
normalized RSSI value on each
antenna (typically 1) You can get it
by calling radio_rssi()
OpenTag can be configured to
automatically normalize and
Requires special HW, not
populate the location list.
currently tested or
implemented in OpenTag
Copyright © DASH7 Alliance
30. OpenTag Implements Normalized RSSI
DASH7 Location Usage
Features RSSI is implemented in the Radio
Driver. During any reception,
Normalized RSSI
OpenTag buffers the non-
Angle of Incidence
normalized RSSI value on each
antenna (typically 1) You can get it
by calling radio_rssi()
OpenTag can be configured to
automatically normalize and
Requires special HW, not
populate the location list.
currently tested or
implemented in OpenTag
Your algorithm needs to read
this data and do the rest
Copyright © DASH7 Alliance
31. One Example of Using RSSI for Location
Using large numbers of low-cost, battery-powered fixed position nodes is cheap and precise
Fixed Position Node
Node with Location Algorithm
(knows positions of fixed nodes)
(packet data)
Mobile Node
Copyright © DASH7 Alliance
32. One Example of Using RSSI for Location
Using large numbers of low-cost, battery-powered fixed position nodes is cheap and precise
(packet data)
(location list)
(derived location
of mobile node)
Copyright © DASH7 Alliance
34. DASH7 Mode 2 & OpenTag Support Limited Multihopping
DASH7‘s advanced query functionality and long range deprecate needs for complex hopping
One Hop Two Hops 3 to 15 Hops
– Anycast Request – Anycast Request
Routing Support All
– Unicast Response – Unicast Response
Built-in, available to Requires 3rd Party
Integration Automated
application layer routing table algorithm
Copyright © DASH7 Alliance
35. DASH7 Mode 2 & OpenTag Support Limited Multihopping
DASH7‘s advanced query functionality and long range deprecate needs for complex hopping
One Hop Two Hops 3 to 15 Hops
– Anycast Request – Anycast Request
Routing Support All
– Unicast Response – Unicast Response
Built-in, available to Requires 3rd Party
Integration Automated
application layer routing table algorithm
Enables simple repeaters If you want to build a mesh
network, you would need to
integrate a routing algorithm.
RPL is one example.
Copyright © DASH7 Alliance
36. DASH7 Mode 2 Network Routing Template
Routable DASH7 Mode 2 frame, as seen by network protocol
Data Link Layer Mode 2 Network Protocol M2DLL
(M2DLL) (M2NP)
Length Data Link M2NLS Routing M2NP M2NLS DLLS
(Bytes) Headers Header Header Payload Auth. Data Auth. Data
1 Byte 7-38 Bytes 1-25 Bytes 1-18 Bytes 0-245 Bytes 0-20 Bytes 0-20 Bytes
(optional) (optional) (optional) (optional)
For Data Link Layer
Security
For Network Layer
Security
Copyright © DASH7 Alliance
37. DASH7 Mode 2 Network Routing Template
Routable DASH7 Mode 2 frame, as seen by network protocol
Data Link Layer Mode 2 Network Protocol M2DLL
(M2DLL) (M2NP)
Length Data Link M2NLS Routing M2NP M2NLS DLLS
(Bytes) Headers Header Header Payload Auth. Data Auth. Data
1 Byte 7-38 Bytes 1-25 Bytes 1-18 Bytes 0-245 Bytes 0-20 Bytes 0-20 Bytes
(optional) (optional) (optional) (optional)
For Data Link Layer
Hop Hop Origin Destination
Control Extension Device ID Device ID
Security
1 Byte 1 Byte 2/8 Bytes 2/8 Bytes
For Network Layer
(optional) (optional) (optional)
Security
The Built-in two hop leverages the Origin and
Destination IDs, which are additional to the
Data Link Layer addressing (Source and Target)
Copyright © DASH7 Alliance
38. Routing Functions in OpenTag Network Module
• Function network_route_ff() is
automatically called by OpenTag when
parsing an incoming frame
‣ returns 0 if the frame is routed to this device
So, to implement sophisticated multihop or
‣ returns positive number (corresponding to mesh routing, you need to integrate your
routing table index) if frame is routed to a routing table and routing algorithm into this
known device function, network_route_ff()
‣ returns -1 if frame should be discarded
• Function m2np_header() writes a properly
routed M2NP header to a new frame.
‣ routing algorithm needs to store the routing
information in the m2np data structure, so
m2np_header() can use it.
‣ m2np data structure is exposed, so you can
put routing algorithm anywhere you want.
Copyright © DASH7 Alliance
39. Routing Functions in OpenTag Network Module
• Function network_route_ff() is
automatically called by OpenTag when
parsing an incoming frame
‣ returns 0 if the frame is routed to this device
So, to implement sophisticated multihop or
‣ returns positive number (corresponding to mesh routing, you need to integrate your
routing table index) if frame is routed to a routing table and routing algorithm into this
known device function, network_route_ff()
‣ returns -1 if frame should be discarded
• Function m2np_header() writes a properly
routed M2NP header to a new frame. Remember, normalized RSSI
information is already part of
‣ routing algorithm needs to store the routing
DASH7, so routing algorithms
information in the m2np data structure, so
that use link budget data are
m2np_header() can use it.
well suited.
‣ m2np data structure is exposed, so you can
put routing algorithm anywhere you want.
Copyright © DASH7 Alliance
40. How are events processed?
(and, how good is the event
timing resolution)
Copyright © DASH7 Alliance
41. What is an Event?
(For those among us who are not software nerds)
An event is anything that causes a program to stop doing what it is doing,
and start doing something else.
Some Examples
Pushing a Button An API Call
Getting a Sensor
A Timer expiring
Reading
Copyright © DASH7 Alliance
42. Events in OpenTag
• OpenTag includes an event and task manager that runs parallel to the user’s application
• When an event occurs, OpenTag takes control of the system in order to run the task associated with the
event. It gives back control when the Task is done (or when it’s idle)
Event
Associated Tasks Notes
(Descending Priority)
Internal RF interrupt Low Level Radio Control Transparent to Application
API Call Generate new request Application dependent
Sensor Detect Generate new request Application dependent
Automated tasks:
- Listen for data [Mostly] Transparent to
System Timer Expires
- Prepare response Application
- Send Beacon
Copyright © DASH7 Alliance
43. Events in OpenTag
• OpenTag includes an event and task manager that runs parallel to the user’s application
• When an event occurs, OpenTag takes control of the system in order to run the task associated with the
event. It gives back control when the Task is done (or when it’s idle)
Event
Associated Tasks Notes
(Descending Priority)
For SoC’s/SiP’s,
Internal RF interrupt Low Level Radio Control Transparent to Application totally transparent
API Call Generate new request Application dependent
Sensor Detect Generate new request Application dependent
Automated tasks:
- Listen for data [Mostly] Transparent to Needs a dedicated
System Timer Expires timer resource.
- Prepare response Application
- Send Beacon
Copyright © DASH7 Alliance
44. What Actually Happens when an Event Occurs?
No Task
Automated Tasks
Pending (Descending Priority)
Event
Event Mgr checks Radio RX/TX
Occurs what task is
pending
Activate Session
Run Task
Initialize Channel Scan
Send Beacon
• Any event must call sys_event_manager() in the system module
(system.c) in order to bind a task to the event that just occurred.
‣ System Timer Events are managed internally by OpenTag, so when the
system timer expires, the appropriate task is automatically processed.
‣ The system timer is always running. So events can be queued up
during OpenTag tasks (expired events are discarded).
Copyright © DASH7 Alliance
45. How Fast is the Event Timing Resolution?
• The OpenTag system timer runs at a resolution The application layer, thus,
of “1 tick,” where 1 tick = 1/1024 sec needs to have worst case
‣ Roughly 1 ms latency of 1 tick.
‣ Allows usage of 32768 Hz crystal as source
• There is another timer unit called a “short tick”
equal to 1/32768 sec (~30.5 µs)
‣ Not used at all in OpenTag library (OTlib)
‣ Used only for internal radio processes,
although certain radios have internal timers
and don’t need to use an MCU timer at all.
‣ All DASH7 processes are timed in ticks. So Since this is internal, you could use
short ticks are only necessary if you are an another clock source and achieve a
optimizer and want to establish internal timer higher resolution, but you would need to
offsets that are shorter than 1 tick. write some new driver code.
Copyright © DASH7 Alliance
47. This Answer Depends on What You Mean by “Connection”
Connection Model 1 • Answer: 1
(Isochronous, streaming data) ‣ This is like cable-replacement, which is not
something DASH7 is designed to do well.
‣ Requires either complex time-slotting (like GSM,
Master Bluetooth) or even more complex MIMO
(802.11n, CDMA, OFDM) in order to support
multiple isochronous connections via wireless.
Slave Slave Slave
Copyright © DASH7 Alliance
48. This Answer Depends on What You Mean by “Connection”
Connection Model 1 • Answer: 1
(Isochronous, streaming data) ‣ This is like cable-replacement, which is not
something DASH7 is designed to do well.
‣ Requires either complex time-slotting (like GSM,
Master Bluetooth) or even more complex MIMO
(802.11n, CDMA, OFDM) in order to support
multiple isochronous connections via wireless.
Slave Slave Slave
In Hardware language, this is
usually referred to as a “bus”
Copyright © DASH7 Alliance
49. This Answer Depends on What You Mean by “Connection”
Connection Model 2 • Answer: a lot (potentially 1000’s)
(Bursty, queued data) ‣ This is broadcast-query-respond, which DASH7
is designed to do especially well.
‣ Basic queries of thousands of devices can be
Node accomplished without much overhead.
Collector
‣ Follow-up dialogs with queried devices is limited
Node by available memory and idle-time configuration
Node
Node Node
Copyright © DASH7 Alliance
50. How is data stored
and logged?
Copyright © DASH7 Alliance
51. Answer: The Built in Filesystem
GFB ISFB
(General File Block) (Indexed Short File Block)
Functions Read, Write, Create, Delete
Security POSIX-like, with optional crypto
Max File Size 65 KB 255 Bytes
Max Files 256 256
Files used by DASH7 0 33 reserved
Searchable No Yes
Executable Yes Yes
Byte-centric, Big-Endian + some files
File Structure Binary (App. Dependent) have standardized structure
Copyright © DASH7 Alliance
52. Using the OpenTag Filesystem (called Veelite)
• In C, it is a lot like using the POSIX C library
‣ FILE* — vlFILE*
‣ fopen() — vl_open(), vl_new()
‣ fclose() — vl_close()
‣ fgetc(), fputc() — vl_read(), vl_write()
• You can also access files by DASH7 itself,
using an Application Subprotocol (included in
OpenTag), as long as you have appropriate
user access to the files you want.
• The Application Subprotocol for file access is
also used over a wire, for the Serial-API, if you Client
are connecting an OpenTag module to another HW
piece of HW.
Copyright © DASH7 Alliance
53. What is the deal with wireless
regulations at 433 MHz?
Copyright © DASH7 Alliance
54. 433 MHz is Usually Available License-free (or cheaply)
Plus: no regulations in Antarctica!
FCC 15.231 & 240
North America uses the FCC
part 15 license-free spec
Korea & Japan
have their own regulations for
license-free 433 MHz use
Limited ERC 70-03
Some countries use basically the
ERC 70-03 spec, but with certain
limitations (e.g. small fees)
required to use the spectrum.
ERC 70-03 (or similar)
Most countries in the world
use the EU/ISM 433 MHz
spec, or something similar.
Copyright © DASH7 Alliance
55. 433 MHz Regulatory Policy Summary
Regulation Complexity Usage Notes Simplified Specification
Spectrum: 420 - 450 MHz (20 MHz)
Max EIRP: highly variable, but effectively -2.4 dBm
FCC Part 15.231 High General Use Max Duty Cycle: highly variable, but effectively 50%
Max TX time: highly variable, but effectively 100 ms
Beacons: requires very low duty cycle, or alternatively ! -14.4 dBm
Similar to 15.231 but with simpler rules, no allowance for beacons,
FCC Part 15.240 Moderate For Containers only and longer TX time permitted. In most cases it does not really
improve performance of DASH7 Mode 2 over 15.231.
Spectrum: 433.05 - 434.79 MHz (1.74 MHz)
ETSI ERC 70-03 Low General Use Class 1: 0 dBm @ 100% duty cycle, max TX 36 sec.
Class 2: 10 dBm @ 10% duty cycle, max TX 36 sec, listen before talk
Spectrum: 433.67 - 434.17 MHz (500 KHz)
Korean ETRI Low General Use
Max EIRP: 0 dBm
Max Duty Cycle: 100%
Max TX time: 100 ms
Japanese RR Low Logistics only
(Note: for guidance only, I am not an expert on ETRI & RR)
Copyright © DASH7 Alliance
56. See you next time…
No way! I only
How about date guys who use
that one? OpenTag
Copyright © DASH7 Alliance
57. See you next time…
Send more questions to:
jpnorair@indigresso.com
Subject: “OpenTag Question”
No way! I only
How about date guys who use
that one? OpenTag
Copyright © DASH7 Alliance