DASH7 Webinar: Working With Open Tag For Mode 2


Published on

Learn the latest about the DASH7 open source firmware project, OpenTag, with support for new DASH7 capabilities like RTLS, better sensor and security support, and bitrates of up to 200kbps.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

DASH7 Webinar: Working With Open Tag For Mode 2

  1. 1. OpenTag Mode 2 Webinar JP Norair 12 January 2011 jpnorair@indigresso.comCopyright © DASH7 Alliance
  2. 2. Webinar Agenda ‣ Stuff you need to know ‣ Stuff you probably want to know ‣ Stuff you might not care about, that I’m going to tell you anywayCopyright © DASH7 Alliance
  3. 3. About the Author • JP Norair ‣ jpnorair@indigresso.com ‣ skype: jpnorair • Chair of DASH7 Technology Working Group • Chief architect of Mode 2 spec • Leader of OpenTag project (Open source DASH7 firmware stack) • Developer of products using DASH7 and related technologies • Lover of all-night debug sessionsCopyright © DASH7 Alliance
  4. 4. How You Can Help OpenTag • Sponsor a port to your platform ‣ Helps fund general development ‣ Fast path to official platform support ‣ I will talk about your stuff all the time DASH7 Alliance Annual Meeting 31 Jan - 2 Feb 2011: San Diego, CA • Join DASH7 Alliance and support Mode 2 (Contact pat@dash7.org) (the spec that OpenTag implements) I will be presenting a 3 hour demo and • Write your own code, and submit it to the developer seminar on OpenTag repository (I will make a branch for you) • Get involved in the Beta Testing • Send me energy drinks: 2025 Broderick St. #08 San Francisco, CA 94115Copyright © DASH7 Alliance
  5. 5. Webinar Agenda ‣ Stuff you need to know History & Timelines ‣ Stuff you probably want to know Feature Overview ‣ Stuff you might not care about, Architecture Overview that I’m going to tell you anyway Getting OpenTagCopyright © DASH7 Alliance
  6. 6. OpenTag Design Philosophy Adding power makes you faster on the straights. Subtracting weight makes you faster everywhere. – Colin Chapman, founder of Lotus CarsCopyright © DASH7 Alliance
  7. 7. OpenTag Has Been Revised Many Times Development of OpenTag Mode 2 has been in parallel to the Mode 2 spec development itself 2008 2009 2010 2011 1st Half 2nd Half 1st Half 2nd Half 1st Half 2nd Half 1st Half 2nd Half Early test OpenTag DASH7 Mode 2 OpenTag versions Mode 1 Alphas Spec Drafted Mode 2 Betas OpenTag Mode 1 Betas Begin total rewrite of Mode 2 Spec FCD, OpenTag for Mode 2 OpenTag 1.x OpenTag for Mode 1 was abandoned, in part due to lack of any Mode 1 SoC’s, but also because developing for Mode 1 is too painful to be practical.Copyright © DASH7 Alliance
  8. 8. 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. 16KBCopyright © DASH7 Alliance
  9. 9. Near-Term Alpha and Beta Schedule Nightly Alpha/Beta builds will be available on the sourceforge code repository Beta 1 Alpha Alpha Beta 0 Beta 1 • Alpha Milestone: The core code works • Beta 2 Milestone: Passes regulatory testing and attains DASH7 compliance/certification • Beta 0 Milestone: A feature subset runs on HW • 1.0: First Official Release • Beta 1 Milestone: All 1.0 features run on HWCopyright © DASH7 Alliance
  10. 10. A Great Effort to Keep the Codebase Small & Light Design elegance leads to reliability and low cost Small Size Less Code Less to go wrong Lower HW requirements Lower Cost Comm Stack ROM/ Open Multihop Multicast File- Crypto IPv6 Scriptable Shellable Userspace RAM KB Source Support Queries system Security Programmable OpenTag DASH7 Mode 2 16 / 1 • optional • • • optional • • • Contiki Proprietary 40 / 2 • • • • • ZigBee ZigBee 115 / 4 • • • ZigBee PRO ZigBee 136 / 4 • • •Copyright © DASH7 Alliance
  11. 11. OpenTag Can Run on Damn-Near Anything 95%+ of Code is Platform-Agnostic ANSI C OS Support Known Memory Support Known Core Support Known Transceivers [SoC] MSP430 (Confirmed) FLASH CC11xx [CC430] “Bare Metal” ARM (Confirmed) (No OS) EEPROM ADF7023 [ADµCRF101] x86 (Confirmed) Most RTOS’s DRAM SX1212 [SX1282] AVR (Likely) POSIX Shell SRAM SX1231 (in simulation) CoolRISC (Likely) FRAM Si442x [Si10xx] 8051 (Likely)Copyright © DASH7 Alliance
  12. 12. List of Main OpenTag Features Or: “What you get for your hard-earned kilobyte” Module Feature Availability Status Approx. KB* C-based API Beta 0 Compile-time option 1 API Serial Console API-shell Beta 0 Compile-time option 0.1 Event-Based MAC Task Engine Beta 0 Mandatory 2 Wake-on Radio Sequencing Beta 0 Runtime option 0.06 MAC Automatic Beacon Sequencing Beta 0 Runtime option 0.03 Real-Time Event Scheduling Beta 1 Compile/Runtime option 0.2 Base Mode 2 Protocol Beta 0 Mandatory 2 Protocol Extended Mode 2 Protocol(s) Beta 1 Compile-time option 2+ Radio Full Mode 2 PHY/MAC Support Beta 0 Mandatory 1 Streaming CRC Engine Beta 0 Mandatory 0.1 CRC SW-based CRC Calculator Beta 0 Compile-time option 0.5** Streaming Codec Framework Beta 0 Mandatory 0.1 SW-based FEC Codec Beta 0 Compile-time option 1 Encoder SW-based PN9 Codec Beta 0 Compile-time option 0.1** HW-based Codec pass through Beta 0 Compile-time option 0.1 POSIX-like Virtual Filesystem Beta 0 Mandatory 1 FLASH Wear Leveling Beta 0/1 Compile-time option 2 Veelite Data Storage Encryption Beta 1 Runtime option 0.05 File Heap Beta 0 Compile-time option 4+†*Compiled on CC430 with mixed speed/size optimization **Not required for CC430 build †User file storage allocation Total: 16.8 KBCopyright © DASH7 Alliance
  13. 13. How to Download Nightly OpenTag Builds If you are a developer, you probably already know this routine 1.Go to the OpenTag sourceforge page http://sourceforge.net/projects/opentag 2.Browse Code repository http://sourceforge.net/projects/opentag — OR — 1.Download any Git client “git” is the original (POSIX command line) 2.Go to (or create) an empty directory 3.Clone my repository to your directory. For classic git, see below. $ git clone git://opentag.git.sourceforge.net/gitroot/opentag/OpenTag_M2Copyright © DASH7 Alliance
  14. 14. Webinar Agenda ‣ Stuff you need to know ‣ Stuff you probably want to know The world’s easiest tag code ‣ Stuff you might not care about, Exploring the API that I’m going to tell you anyway Configuring the BuildCopyright © DASH7 Alliance
  15. 15. The World’s Easiest Tag Code • Yes: this is simplified pseudocode, but the concept is accurate and even workable for simple “Tag” devices. • One extra layer of complexity is to determine the longest runtime of my_program(): ‣ Let’s say it is 5 ms ‣ Add a condition to skip my_program() if ot_run() returns 5 ms or less • If you use an RTOS with a “system tick” period of 5 ms, then integration with the RTOS follows the same idea. • As we will see later, my_program()can actually feed information back to OpenTag in a variety of ways.Copyright © DASH7 Alliance
  16. 16. OpenTag API: Shock & Awe OpenTag is like a shell and possibly an OS, too. OpenTag can be controlled directly, with C, or indirectly, over a message pipe. Any kind of data interface will do MAC (often it is a serial wire). Control Veelite: (Virtual EEPROM Lite) C API User LLDP: Data Message Pipe (Low Level Directive POSIX-like filesystem (optional) Protocol) for Mode 2 Data. Short messaging directives that Script User can be used in combination Engine Program to do large tasks Protocol (optional) (optional) LayerCopyright © DASH7 Alliance
  17. 17. OpenTag API: Shock & Awe Running stored programs is the same as running API directives This is the feedback loop that allows users to script and store MAC custom routines. This can be dangerous! By default it is disabled. Control On the plus side, it allows for users to load complex “stored procedures” or other sorts of programs, such as a PPP daemon. Veelite: Programs are stored in Veelite, they run in userspace, and they Lite) (Virtual EEPROM C API require authentication to LLDP: run. They cannot affect data that is not User accessible to the(Low (i.e. root-only data) user Level Directive Data Message Pipe POSIX-like filesystem (optional) Protocol) for Mode 2 Data. Short messaging directives that Script User can be used in combination Engine Program to do large tasks Protocol (optional) (optional) LayerCopyright © DASH7 Alliance
  18. 18. OpenTag API: A Practical Perspective Writing Data to a Mode 2 Data Element via the Messaging API (LLDP) • Does this make any sense to you? (Probably not) • This code changes the value of the Mode 2 Sleep Scan Sequence UDB, which in turn changes the way the device monitors channels for activity. • The otapi_set...() and get functions are accessing a message pipe. • This kind of code would generally never run on a tiny embedded device. It is meant to run on the thing that is connected to your tiny device. ‣ If you are a developer, this means the PC that is connected to your dev kit with a wire. ‣ If you are a system integrator, this means the piece of edgeware that is driving your stuff.Copyright © DASH7 Alliance
  19. 19. OpenTag API: A Practical Perspective Writing Data to a Mode 2 Data Element via the C API • Does this make any sense to you? (It probably does, if you’ve seen stdio.h) • This code does the same job as the last code • The UDB_open_su() opens the UDB as the root user, which guarantees write access. • This kind of code is used all over the place inside OpenTag. You could use it in my_program() just as easily. ‣ The UDB contains all sorts of configuration registers that control OpenTag behavior. ‣ The UDB contains data elements, like location Still confused? Don’t worry too much: lists and sensor data lists. It won’t be long before there are libraries of cookbook-type OpenTag functions on SourceForge.Copyright © DASH7 Alliance
  20. 20. Configuring a Build The secret to OpenTag’s portability This is an OpenTag Feature. It only compiles if you want to use streaming CRC • You don’t need to understand this code, it is just an example of Compile-Time options • Without touching any of the code (apart from the config headers), you can dramatically change the scope of features available to your build of OpenTag. It is even address size and endian agnostic at the C code level. This is a Platform Feature. It only compiles if your HW cannot encode PN9 per the Mode 2 SpecCopyright © DASH7 Alliance
  21. 21. Configuring a Build Configuration File Examples (CC430 in this example) /OTlib/OT_config.h /Platforms/CC430/platform_config_CC430.h Software Features for Any Platform Features (or Limitations) of the Hardware Some of these lists go on for hundreds of lines and allow deep-drilling optimizationCopyright © DASH7 Alliance
  22. 22. Wakeup! (The code example part is over)Copyright © DASH7 Alliance
  23. 23. Webinar Agenda ‣ Stuff you need to know ‣ Stuff you probably want to know ‣ Stuff you might not care about, Porting OpenTag to New HW that I’m going to tell you anyway Running in Simulation Pending ReleasesCopyright © DASH7 Alliance
  24. 24. Porting OpenTag to New HW Stuff you don’t really need to touch • The OTlib directory is all ANSI C, and has hooks that allow it to be as close to 100% platform agnostic as a C program can be. • You will need to add your Platform Name to platform_support.h (pretty easy) • You will need to add your Platform header to platform_config.h (pretty easy)Copyright © DASH7 Alliance
  25. 25. Porting OpenTag to New HW Stuff you need to create • You WILL need to write some drivers and headers for anything that interacts directly with the platform. • Create a new directory in /Platforms/ • A lot of platforms are similar. Most of the time I am able to copy the files from one port to another, and modify them only slightly.Copyright © DASH7 Alliance
  26. 26. Using the Simulator • Since the code is portable and doesn’t hook into hardware at the library level, it is pretty easy to test compared to the traditional embedded build-load-debug cycle. • I have written a handful of test programs - as simple as make & run • On a modern PC I can go take a nap, and when I come back, 100 billion test vectors have run. ‣ This is orders of magnitude more transactions than all WSN & active RFID devices have been put through, combined, to date. I use a pleasant sea anemone motif for my shellCopyright © DASH7 Alliance
  27. 27. What Each Release Entails Alpha Beta 0 Beta 1 Beta 2 Beta 0 OTlib featureset Platform layer tested Beta 0/1 OTlib featureset Regulatory Testing tested to exhaustion via thoroughly on CC430 tested to exhaustion via Simulator Simulator, and HW Work with DASH7 Alliance to define Mode 2 Get Platform layer to run Port to ADµCRF101 Full-scale interoperability Certification process just once on CC430 tests between CC430 and ADµCRF101 By most accounts, Beta 2 will be a deployable version. Changes between Beta 2 and v1.0 should just be configuration settings.Copyright © DASH7 Alliance
  28. 28. When this is all over, I will treat myself to some fine wine.Copyright © DASH7 Alliance
  29. 29. Questions & CommentsCopyright © DASH7 Alliance