Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Open source Tools and Frameworks for M2M - Sierra Wireless Developer Days


Published on

On June 14, 2013 were the first Sierra Wireless Developer Days. This is the presentation I gave about Sierra Wireless Open-Source activities, and the technologies being delivered together with the Eclipse M2M Industry Working Group.

Join our developer community at

Published in: Technology, Education

Open source Tools and Frameworks for M2M - Sierra Wireless Developer Days

  1. 1. PageOpen-source tools andframeworks for M2MSierra Wireless Developer Days 2013Benjamin Cabé
  2. 2. Who I am•  Benjamin Cabé•  Open Source M2M Evangelist•  Eclipse M2M IWG chairperson
  3. 3. Topics for this session•  Open-source?•  Eclipse Foundation•  M2M Industry Working Group•  Eclipse M2M projects•  Sierra products built on OSS
  4. 4. 50billiondevicesby 2020
  5. 5. SmartPill BoxHeartbeatSensorWeightScaleBloodPressureMedicalServicesGatewayNear fieldBloodSugarInternetof ThingsPatientClinical TrialDoctor
  6. 6. ?
  7. 7. Eclipse is an open source communityf o c u s e d o n d e v e l o p i n g adevelopment platform of runtimes,frameworks and exemplary toolsthat make it easy and cost-effectiveto build and deploy softwaresolutions.”“
  8. 8. •  190+ organizations are members ofthe Eclipse Foundation, working witheach other to leverage an opencollaboration model, as well asmarketing benefits.•  Strategic members:
  9. 9. Eclipse has grown from a place wheredevelopers have been working ondeveloping Open Source software,to a place where industry leaderswork to focus, promote, and augmentEclipse technologies to meet theneeds of specific industries.“Eclipse Industry Working Groups
  10. 10. Our open-source strategyIoT Building Blocks“We provide open-source developments tools andframeworks for M2M/IoT developers”
  11. 11. Our open-source strategyIoT Building Blocks“We provide open-source developments tools andframeworks for M2M/IoT developers”Interoperability“We provide reference implementations of openprotocols and API to encourage interoperability”.
  12. 12. Our open-source strategyIoT Building Blocks“We provide open-source developments tools andframeworks for M2M/IoT developers”Interoperability“We provide reference implementations of openprotocols and API to encourage interoperability”.Open-Source Community“We host samples, testing environments anddocumentation on the portal”
  13. 13.
  14. 14. Open ecosystem for M2MThird Party EcosystemOpen M2M applicationframework and runtimesOpen M2M communicationprotocolsInternet ofThingsOpen M2Mdevelopment tools…
  15. 15. FrameworkTools3 projectsProtocols
  16. 16. M2M embeddedprogramming•  low-level C•  memorymanagement•  multithreadedprogramming•  read sensor values•  control actuators•  consolidate data•  communicate
  17. 17. Example: Sending an SMSint main() { unsigned char char1[10]; unsigned char char_buf[8]="AT+CSQn"; // unsigned char sms_buf[20] = "AT+CMGS="xxxxxxxxx"; int wc_fd; /********* Init of serial port ************/ wc_fd = init_wc(wc_fd); sleep(3); //writing to serial port write(wc_fd,char_buf,sizeof(char_buf)); usleep(40000); //reading from serial port read(wc_fd,char1,sizeof(char1)); sleep(2); close(wc_fd); return 0; } // end of main // initialization of serial port struct termios options; ttys5_fd = open("/dev/ttyS5", O_RDWR ); if (ttys5_fd < 0) sms.send(
  18. 18. Simplify M2M programming
  19. 19. What is Lua?•  High-level programming language•  Scripting•  Simple•  Extensible•  Portable
  20. 20. Extensible by design•  Small– Trivial syntax and reduced keyword set•  Simple but not stupid– Simple enough for new users, powerful enoughfor advanced users (first-class functions,garbage collection, closures, tail calls, coercion,coroutines, metatables)•  Lua core is tiny– Compiled size is ~150kB– Lua uses libraries for its extensions
  21. 21. Lua vs. other high-level languages•  Same core features as Python, Ruby,Javascript •  Better concurrency management– Built-in – doesn’t rely on the OS•  Cutting-edge execution technology &performances
  22. 22. Lua vs. other high-level languages•  Restricted set of libraries– Stay simple, the developer brings his own •  Designed for C integration– Performance– Legacy
  23. 23. Lua for embedded and M2M?•  High-level languages usually tradehardware resources for development& maintenance resourcesLua allows to reconcile high-levellanguages accomplishmentswith embedded constraints
  24. 24. You need an IDE!•  Project structure•  Syntax coloring•  Content assist•  Code navigation•  Code formatting•  Documentation•  Code templates•  Debugger•  Remote development•  Embedded interpreterJune 2012: first release (0.8)Dec. 2012: 0.9 releaseJune 2013: 1.0 w/ Kepler60,000 installations already!
  25. 25. Koneki demo
  26. 26. How do wecommunicate?
  27. 27. M3DA*Compact … because in the wireless world, data overhead costs money–  Efficient in the transport of binary M2M dataInteroperable … because the M2M communication chain is heterogeneous–  Language-independent–  Tolerant to data schema changes–  Agnostic to transport layer (TCP, HTTP, SMS, …)Secure … because security is #1 concern for M2M adopters–  Ensure integrity and confidentiality of customer data–  Message ticket-id to enable acknowledgementOpen … because vendor lock-in hinders M2M adoption*Micro M2M Data Access
  28. 28. M3DA Layered ArchitectureTransport Layer M3DA Envelope Enables authentication, encryption, …Application Layer M3DA Message Specify access to the tree-oriented datamodelSerialization Layer Bysant Provides an efficient binary serializationbased on contextual information HTTPM3DA TransportM3DA PayloadM3DAMessageCommand/Event/Time stamped dataMessageCommand/Event/Time stamped data…Headers- Device /Server Identification- Securityauth, cipher, hmac, nonce…- Compression algo, dict selection, …TCP UDP SMS*TransportBysant Serializer
  29. 29. M3DA = M2M data optimization•  Object-oriented•  Provides basic classes–  Numbers (Integers, Floating point numbers, Boolean)–  Strings (Binary string)–  Container objects (List, Map)•  User-defined objects–  Allows to structure protocol objects (Message, Responses, DeltaVector,…)•  Serialization is optimized for M2M data–  Small numbers take less bytes–  5 ! 1 byte, 2040 ! 2 bytes–  String size header are adaptative–  1 byte for a 28-byte long string, but 3 bytes for 66k-byte long string.
  30. 30. •  Messaging protocol•  Low-bandwidth / Low-power•  Payload agnostic•  Adjustable QoS•  Large ecosystem
  31. 31. broker broker(optional) bridgepublishsubscribekeepalivelast will & testamentusername/passwordtopic/subtopictopic/#
  32. 32. Lua VM + M3DA to go?
  33. 33. Application framework for M2M•  Set of libraries providing building blocksto develop M2M applications:– Serial and I/O management, – Networking (FTP, HTTP, e-mail, …),– GPS, – Modbus, – Local storage,– etc.
  34. 34. Smart agent for M2M•  M2M data queues•  Network bearers•  Device management•  Application container•  Application configuration
  35. 35. Overall architecture
  36. 36. Asset management•  User applications use an API tocommunicate with Mihini– Send data or events– Register listeners to handle data writing orcommands•  The Mihini agent takes care ofnetwork connection, buffering andreliable storage of unsent data, etc.
  37. 37. Asset managementlocal gh_asset = asset_mgt.newAsset("greenhouse")gh_asset:start()gh_asset:pushdata("sensors.temperature", 22, "now")gh_asset:pushdata("sensors.humidity", 89, "hourly")
  38. 38. Device management•  A Tree Manager presents devices dataas– variables,– organized in a hierarchical tree,– that can be read, written, and monitored forchanges by user applications.
  39. 39. Device managementlocal devicetree = require devicetreelocal APN = system.cellular.apn.apnlocal RSSI = apn = devicetree.get (APN)log(LOG_NAME, "INFO", "Configure APN: %s", apn)local function print_callback (values)for name, value in pairs(values) dolog (LOG_NAME, "INFO"," - Variable %s changed: %s",name, value)endenddevicetree.register(RSSI, print_callback)devicetree.set(APN, foo)
  40. 40. Application Management•  Language-agnostic applicationcontainer– install/uninstall– start/stop, auto-start on boot– restart on failure•  Agent handles over-the-air softwaredownload and update mechanism•  Remote script execution
  41. 41. Let meshow you!
  42. 42. A very common use case•  Greenhouse business– Connect gardening equipment– Remote monitoring of sensors– Remote control•  M2M Gateway not selected yet,neither is the rest of the equipment(PLCs)
  43. 43. DO YOUKNOW US?
  44. 44. Raspberry Pi Web browserhumiditytemperatureilluminancelight ON/OFFModbus RTUM3DA REST API
  45. 45. WebHTML5 / JS–  OAuth–  AirVantage REST API–  Displays sensor data witha fancy UI–  Publish command toswitch on/off the lightTwo applicationsEmbedded–  Uses Modbus library tocommunicate w/ Arduino–  Collects sensor data/controlsactuators–  Publishes M3DA messages–  Subscribe to commands
  46. 46. Rugged wirelessgatewayscontrol sensors &actuatorsMobile phonesWeb applicationsIT applicationsModbus…M2M serverTelco&Billing& etc…&
  47. 47. Hardware differentiationruggedness | radio certificationextensibility | services | supportDeveloper Zone
  48. 48. Software differentiationindustrial protocolspower optimizationdevelopment toolsvertical applicationsreal-timeprofessional services…24/73rd party servicessecuritybillingcarrier integrationprofessional services…embedded server
  49. 49. In a nutshell•  Prototyping made as simple as can be•  Smooth experience for Linux-baseddevices•  New languages are coming•  A clear path towards Sierra Wirelessoffer
  50. 50. Thank you!Questions? | |