O slideshow foi denunciado.
Utilizamos seu perfil e dados de atividades no LinkedIn para personalizar e exibir anúncios mais relevantes. Altere suas preferências de anúncios quando desejar.

OMA LwM2M Workshop - Julien Vermillard, OMA LwM2M Projects in Eclipse Foundation

4.193 visualizações

Publicada em

Julien Vermillard from Sierra Wireless presented during the Open Mobile Alliance LwM2M Workshop event on January 28, 2015. This is a copy of the slides presented for his session titled, "OMA LwM2M Projects in Eclipse Foundation".

Publicada em: Tecnologia
  • Seja o primeiro a comentar

OMA LwM2M Workshop - Julien Vermillard, OMA LwM2M Projects in Eclipse Foundation

  1. 1. LwM2M Workshop 2015 Julien Vermillard - Sierra Wireless
  2. 2. Julien Vermillard / @vrmvrm Software Engineer at Sierra Wireless http://airvantage.net M2M Cloud Apache foundation member Eclipse committer on Californium, Wakaama Eclipse Leshan project lead
  3. 3. Eclipse Foundation & Eclipse IoT Open Standards and Open Source for the Internet of Things 5-Nov-2014
  4. 4. Eclipse History • Launched by IBM in 2001 – Initial release of the Eclipse technology platform (Platform, JDT,PDT) – Founding consortium board comprised Borland, IBM, Red Hat, … • Eclipse Foundation formed in 2004 – Independent not-for-profit organization formed in 2004 – Definition of bylaws, membership model, initial IP process • Eclipse Foundation today, 2014 – Members include IBM, Oracle, SAP, CA, Google, Bosch, etc. – 204 members, (10 strategic members), ~1000 committers – ~270 Open Source Projects 2Copyright (c) 2014, Eclipse Foundation, Inc. Made available under the Eclipse Public License 1.0
  5. 5. Eclipse at a Glance • Organization – 501(c)6 not-for-profit, USA (Delaware) incorporated, headquarters in Ottawa, Canada – 18 employees • License – Eclipse Public License is the default – Other licenses possible by approval of the Board • Focus areas – Most project implementations are in Java, but starting to move into web (JavaScript) and C/C++ – “Eclipse plug-in model” – Development tools, modeling tools, runtimes, web development, IoT, Cloud 3Copyright (c) 2014, Eclipse Foundation, Inc. Made available under the Eclipse Public License 1.0
  6. 6. Eclipse: a sustainable ecosystem “Eclipse is a vendor-neutral consortium of major software vendors, solution providers, corporations, educational and research institutions and individuals working together to create a sustainable eco-system that enhances, promotes and cultivates the Eclipse open platform with complementary products, services and capabilities.” 4Copyright (c) 2014, Eclipse Foundation, Inc. Made available under the Eclipse Public License 1.0
  7. 7. Governance IP Mgt & Licensing Projects & Process Ecosystem Development Infrastructure What do you need for open collaboration? 5Copyright (c) 2014, Eclipse Foundation, Inc. Made available under the Eclipse Public License 1.0
  8. 8. Governanc e IP Mgt & Licensing Projects & Process Ecossytem Developmen t Infra- structure Eclipse Working Groups • Eclipse is the industry’s best model for vendor- neutral collaboration • Eclipse Working Groups: – Licensing model for sharing co-developed innovation – IP management to maximize commercialization opportunities – Project model for coordinating investments and activities – Governance model to ensure a level playing field for all participants Eclipse gives you these “out of the box” 6Copyright (c) 2014, Eclipse Foundation, Inc. Made available under the Eclipse Public License 1.0
  9. 9. 7Copyright (c) 2014, Eclipse Foundation, Inc. Made available under the Eclipse Public License 1.0
  10. 10. IoT Architectures Copyright (c) 2014, Eclipse Foundation, Inc. Made available under the Eclipse Public License 1.0 8 New and existing devices IoT Gateways Backend systemsNetwork carriers
  11. 11. Open Source, Open Standards and Community for IoT IoT Architectures Copyright (c) 2014, Eclipse Foundation, Inc. Made available under the Eclipse Public License 1.0 9 New and existing devices IoT Gateways Backend systemsNetwork carriers
  12. 12. Protocols • MQTT – OASIS standard – Client and server implementations in Paho, Mosquitto and Moquette – Wide commercial adoption: IBM MessageSight, Facebook Messenger, Eurotech ESF, Sierra Wireless AirVantage, … • CoAP – IETF standard – Java implementation in Californium – Lots of traction in the WSN space (Thingsquare, Everythng, …) – Foundation for LWM2M – supported by Sierra Wireless, Bosch SI, Zebra Technologies 5 June 2014 Copyright (c) 2014, Eclipse Foundation, Inc. Made available under the Eclipse Public License 1.0 10
  13. 13. Frameworks • Application framework for IoT: Kura – Built on top of Java and OSGi – Foundation for Eurotech’s Everyware Software Framework • ETSI SmartM2M and oneM2M implementation: OM2M 5 June 2014 Copyright (c) 2014, Eclipse Foundation, Inc. Made available under the Eclipse Public License 1.0 11
  14. 14. Solutions • Home Automation: Eclipse SmartHome – Based on Java and OSGi – Very active community with ~100 home automation driver implementations – Foundation for Deutsche Telekom’s QIVICON • IoT network management: Krikkit – Rules engine for IoT devices – Powering Cisco’s Data in Motion. • Industrial control: EclipseSCADA 5 June 2014 Copyright (c) 2014, Eclipse Foundation, Inc. Made available under the Eclipse Public License 1.0 12
  15. 15. Tools • Eclipse Vorto – Information model for « things » + code generators – Bosch SI leading 5 June 2014 Copyright (c) 2014, Eclipse Foundation, Inc. Made available under the Eclipse Public License 1.0 13
  16. 16. Eclipse IoT Members 5 June 2014 Copyright (c) 2014, Eclipse Foundation, Inc. Made available under the Eclipse Public License 1.0 14
  17. 17. Eclipse IoT in Numbers • 17 projects • 90+ committers & contributors • 1.7 Million lines of code • 700K+ combined unique visitors • 3 developer sandboxes (MQTT, CoAP, LWM2M) 5 June 2014 Copyright (c) 2014, Eclipse Foundation, Inc. Made available under the Eclipse Public License 1.0 15
  18. 18. iot.eclipse.org 5 June 2014 Copyright (c) 2014, Eclipse Foundation, Inc. Made available under the Eclipse Public License 1.0 16
  19. 19. Thanks! Questions? 5 June 2014 Copyright (c) 2014, Eclipse Foundation, Inc. Made available under the Eclipse Public License 1.0 17
  20. 20. Leshan Open-source Lightweight M2M for Java
  21. 21. Directly as a library? Copy/pasted some code? Like TLV parser? Testing? Leshan: Who is using it? ?
  22. 22. Leshan A Java library for implementing LwM2M servers (and clients) Friendly for any Java developer (no framework, few dependencies) But also a Web UI for discovering and testing the protocol
  23. 23. History Started 22 Jul. 2013 @ Sierra Wireless First external contribution 10 March 2014 Public sandbox Jul. 2014 Proposed as an Eclipse project Sep. 2014 Client contributed Oct. 2014
  24. 24. Details Who? Move under Eclipse rules New sandbox: http://leshan.eclipse.org
  25. 25. Committers Simon Bernard - Sierra Wireless Kai Hudalla - Bosch Software Innovations J.F. Schloman - Zebra Technologies, Zatar Manuel Sangoï - Sierra Wireless Julien Vermillard - Sierra Wireless
  26. 26. Features Client initiated bootstrap Registration/Deregistration Read, Write, Create objects TLV encoding/decoding OSGi friendly
  27. 27. Features DTLS Pre shared key DTLS Raw public key Standalone web-UI for testing
  28. 28. Modules leshan-core commons elements leshan-server-core server lwm2m logic leshan-server-cf californium server leshan-client client leshan-all everything above in 1 jar leshan-client-example leshan-standalone application with web UI leshan-bs-server standalone bootstrap leshan-integration-tests
  29. 29. Server Simple Java library Build using “mvn install” Based on Californium and Scandium Under refactoring for accepting other CoAP lib
  30. 30. Server API example public void start() { // Build LWM2M server LeshanServerBuilder builder = new LeshanServerBuilder(); lwServer = builder.build(); lwServer.getClientRegistry().addListener(new ClientRegistryListener() { @Override public void registered(Client client) { System.out.println("New registered client with endpoint: " + client.getEndpoint()); } @Override public void updated(Client clientUpdated) { System.out.println("Registration updated”); } @Override public void unregistered(Client client) { System.out.println("Registration deleted”); } }); // start lwServer.start(); System.out.println("Demo server started"); }
  31. 31. Server API example // prepare the new value LwM2mResource currentTimeResource = new LwM2mResource(13, Value.newDateValue(new Date())); // send a write request to a client WriteRequest writeCurrentTime = new WriteRequest(client, 3, 0, 13, currentTimeResource, ContentFormat.TEXT, true); ClientResponse response = lwServer.send(writeCurrentTime); System.out.println("Response to write request from client " + client.getEndpoint() + ": " + response.getCode());
  32. 32. Implements your own store ClientRegistry: Store currently registered clients SecurityRegistry: Store security informations Default implementations are “in-memory” for demo only!
  33. 33. Client Under construction! API will probably change Create objects, answer to server requests DTLS supported in master Checkout: leshan-client-example
  34. 34. Next steps Eclipse.org migration DTLS X.509 CoAP shim, CoAP TCP Stable API for June To be done: Json SMS Server initiated bootstrap
  35. 35. How to help? Use it! Report bugs, issue, missing features Write documentation Talk about it (in your company, IoT meetup,...) Contribute code Questions? https://dev.eclipse.org/mailman/listinfo/leshan-dev
  36. 36. Eclipse Wakaama Lightweight M2M implementation in C Photo credits: https://www.flickr.com/photos/30126248@N00/2890986348
  37. 37. Wakaama: Who is using it? Directly as a library? Copy/pasted some code? Testing? ?
  38. 38. Wakaama A C client and server implementation of LwM2M Not a shared library (.so/.dll) Embedded friendly but using malloc/free Plug your own IP stack and DTLS implementation
  39. 39. History Started as liblwm2m by Intel on May 2013 https://github.com/01org/liblwm2m Proposed as Eclipse project Dec. 2013 Code imported at Eclipse July 2014
  40. 40. Who? David Navarro - Intel Julien Vermillard - Sierra Wireless
  41. 41. Features Register, registration update, deregister Read, write resources Read, write, create, delete object instances TLV or plain text Observe
  42. 42. Structure core : internals.h liblwm2m.c liblwm2m.h list.c management.c objects.c observe.c packet.c registration.c tlv.c transaction.c uri.c utils.c core/er-coap-13 : er-coap-13.c er-coap-13.h
  43. 43. Structure tests/client: lwm2mclient.c object_device.c object_firmware.c object_location.c object_security.c object_server.c test_object.c tests/server: lwm2mserver.c
  44. 44. lwm2m_object_t * get_object_device() { lwm2m_object_t * deviceObj; deviceObj = (lwm2m_object_t *)lwm2m_malloc(sizeof(lwm2m_object_t)); if (NULL != deviceObj) { memset(deviceObj, 0, sizeof(lwm2m_object_t)); deviceObj->objID = 3; deviceObj->readFunc = prv_device_read; deviceObj->writeFunc = prv_device_write; deviceObj->executeFunc = prv_device_execute; deviceObj->userData = lwm2m_malloc(sizeof(device_data_t)); if (NULL != deviceObj->userData) { ((device_data_t*)deviceObj->userData)->time = 1367491215; strcpy(((device_data_t*)deviceObj->userData)->time_offset, "+01:00"); } else { lwm2m_free(deviceObj); deviceObj = NULL; } } return deviceObj; } Create objects!
  45. 45. objArray[0] = get_object_device(); if (NULL == objArray[0]) { fprintf(stderr, "Failed to create Device objectrn"); return -1; } objArray[1] = get_object_firmware(); if (NULL == objArray[1]) { fprintf(stderr, "Failed to create Firmware objectrn"); return -1; } objArray[2] = get_test_object(); if (NULL == objArray[2]) { fprintf(stderr, "Failed to create test objectrn"); return -1; } lwm2mH = lwm2m_init(prv_connect_server, prv_buffer_send, &data); if (NULL == lwm2mH) { fprintf(stderr, "lwm2m_init() failedrn"); return -1; } result = lwm2m_configure(lwm2mH, "testlwm2mclient", BINDING_U, NULL, OBJ_COUNT, objArray); ... result = lwm2m_start(lwm2mH); Configure Wakaama
  46. 46. while (0 == g_quit) { struct timeval tv; tv.tv_sec = 60; tv.tv_usec = 0; /* * This function does two things: * - first it does the work needed by liblwm2m (eg. (re)sending some packets). * - Secondly it adjust the timeout value (default 60s) depending on the state of the transaction * (eg. retransmission) and the time between the next operation */ result = lwm2m_step(lwm2mH, &tv); if (result != 0) { fprintf(stderr, "lwm2m_step() failed: 0x%Xrn", result); return -1; } Active loop
  47. 47. Next? Device initiated bootstrap More example: https://github. com/jvermillard/Wakaama-mbed Server? Block transfer?
  48. 48. Hack it into real devices! Courtesy of Bosch Software Innovations!
  49. 49. Spark Core Cortex-M3 STM32, RAM/ROM 20/128k, 72MHz WiFi wakaama (old: 09.2014 version)+TinydTLS-0.5: ROM/RAM: 75,6kB/13,1kB
  50. 50. U-blox MBed.org Cortex-M3 (NXP LPC1768), RAM/ROM 20/128k, 96MHz GPRS Current BOSCH wakaama-snapshot: Function: observe, attribute: Objects: server, security, device, conn_m, firmware, location, ROM/RAM: 84kB/22kB
  51. 51. Arduino AVR, ATmega2560, RAM/ROM 8/256k, 16MHz Ethernet Current BOSCH wakaama-snapshot: Function: observe, attribute: Objects: server, security, device, conn_m, firmware, location, ROM/RAM: 67kB/5kB
  52. 52. Lua binding https://github.com/sbernard31/lualwm2m With DTLS support using: https://github.com/sbernard31/luadtls binding on http://tinydtls.sf.net
  53. 53. Thanks! More questions? jvermillard@sierrawireless.com http://twitter.com/vrmvrm

×