Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Softwareentwicklung für das Internet der Dinge

Softwareentwicklung für das Internet der Dinge

berndfischer63

November 28, 2014
Tweet

More Decks by berndfischer63

Other Decks in Technology

Transcript

  1. Agenda ž  19:00 ž  19:05 ž  19:15 ž  19:30 ž 

    21:00 Begrüßung Begrüßung durch den Gastgeber Why does IoT matter? Terms, Numbers and Use-Cases Architekturen für IoT Eclipse IoT – Das Projekt Eclipse IoT – Die Projekte (Protokolle) Eclipse IoT – Demo Kura Q&A / Diskussion / Catering 28.11.2014 MindApproach für Eclipse User Group Dresden 2
  2. Who’s that guy? ž  Studium Elektro-/Automatisierungstechnik ž  CTO MindApproach GmbH

    ž  Software-Engineer —  Java (Spring), C/C++, … —  arc42 —  Management 3.0 —  Continuous Delivery (Docker ;-) —  … ž  Kontakt —  [email protected] —  @berndfischer63 28.11.2014 MindApproach für Eclipse User Group Dresden 3
  3. Internet of Things 28.11.2014 MindApproach für Eclipse User Group Dresden

    5 Quelle http://upload.wikimedia.org/wikipedia/commons/a/ab/Internet_of_Things.jpg •  identifiable devices •  connected to the “(Inter-) net” •  supersedes / extends •  M2M •  Embedded Systems •  …
  4. Environmental Monitoring ž  water / air quality ž  earthquake /

    tsunami early-warning systems 28.11.2014 MindApproach für Eclipse User Group Dresden 6
  5. Infrastructure Management ž  urban and rural infrastructures —  bridges — 

    wind farms ž  wast management ž  improvement of —  incident management —  emergency response coordination 28.11.2014 MindApproach für Eclipse User Group Dresden 7
  6. Industrial Applications ž  Industrie 4.0 ž  supply chain networks (just

    in time) ž  (M2M) 28.11.2014 MindApproach für Eclipse User Group Dresden 8
  7. Energy Management ž  Remote Management —  e*Nergy von e*Message — 

    Steuerung Lastverteilung ž  Metering 28.11.2014 MindApproach für Eclipse User Group Dresden 9
  8. Medical and Healthcare ž  remote health monitoring ž  Medical Assistant

    Systems ž  Elektronische Patientendaten ž  … 28.11.2014 MindApproach für Eclipse User Group Dresden 10
  9. Building and Home Automation ž  Klima-Steuerung ž  Zugangs-Steuerung ž  Beleuchtungs-Steuerung

    ž  Warnanlagen —  Rauchmelder, Feuerwehr-Info-Systeme ž  … 28.11.2014 MindApproach für Eclipse User Group Dresden 11
  10. Transport Systems ž  Flottenmangement ž  Orts- und Zeitbestimmung ž  Metering

    —  Maut-Systeme —  Average-Speed-Measurement 28.11.2014 MindApproach für Eclipse User Group Dresden 12
  11. Retail ž  Customer Tracking ž  Customer Information System ž  Goods

    Tracking —  Kühlketten —  Haltbarkeitsdaten ž  … 28.11.2014 MindApproach für Eclipse User Group Dresden 13
  12. IoT is big 28.11.2014 14 MindApproach für Eclipse User Group

    Dresden Quelle http://www.businessinsider.com/growth-in-the-internet-of-things-2013-10
  13. Constraint Devices ž  RFC 7228 ž  Constraint Devices —  limited

    CPU, memory and power resources —  classified in Class 0, 1, 2 ž  Constrained Nodes —  limited networking capabilities ž  Constrained Network —  limited throughput + high package loss rate ž  Cross Development necessary 28.11.2014 MindApproach für Eclipse User Group Dresden 18
  14. Security and Safety ž  Encryption ž  Key-Infrastructure 28.11.2014 MindApproach für

    Eclipse User Group Dresden 20 Quelle: http://tools.ietf.org/html/draft-aks-crypto-sensors-02
  15. Device Management ž  device configuration —  identity —  autorisation /

    authentication ž  software update ž  monitoring ž  metering 28.11.2014 MindApproach für Eclipse User Group Dresden 21
  16. System Layer ž  Sensoren / Aktoren ž  (constraint) Networks ž 

    (Network) Nodes ž  (Central) Processing —  Big Data —  Cloud 28.11.2014 MindApproach für Eclipse User Group Dresden 22
  17. System Aspects ž  heterogeneous ž  central vs. distributed ž  autonomy

    —  “dezentrale Intelligenz” —  “Schwarm Intelligenz” 28.11.2014 MindApproach für Eclipse User Group Dresden 23
  18. System Designs – Classic Central 28.11.2014 MindApproach für Eclipse User

    Group Dresden 24 Quelle: WSO2 – Whitepaper – A Reference Architecture for the Internet of Things
  19. System Designs Eclipse Open IoT Stack for Java 28.11.2014 MindApproach

    für Eclipse User Group Dresden 25 IoT Applications IoT Solutions Framework -  Home Automation -  SCADA -  OM2M Java Virtual Machine OSGI Runtime (Concierge) IoT Gateway Services Remote and Application Management Connectivity Mqtt, CoAP, LWM2M Reporting Developer Tools (IDE, etc.) Alternative Languages (C, C++, Python, …) Quelle: http://iot.eclipse.org/java/open-iot-stack-for-java.html
  20. JDK 8 – Oracle ž  Java SE —  x86/x64, SPARC,

    ARM v7 32-Bit ž  Java SE Embedded (may require fee) —  x86, Power Architecture, ARM (v5)/v6/v7 —  to create customized JRE’s —  three “compact profiles” ž  Java for Mobile, TV Card (may require fee) 28.11.2014 MindApproach für Eclipse User Group Dresden 28
  21. Java ME 8 28.11.2014 MindApproach für Eclipse User Group Dresden

    29 may require fee many device configurations,
  22. JDK 8 – OpenJDK ž  x86/x64 ž  PowerPC/AIX, Mac OS

    X (x64), BSD ž  … 28.11.2014 MindApproach für Eclipse User Group Dresden 30
  23. JVM – Others Open Source ž  HaikuVM: Atmel AVRs (Arduino)

    ž  IeJOS: Lego Mindstorms RCX and NXT ž  IKVM.Net: Mono/.NET ž  NanoVM: Atmel AVR ATmega8 ž  RoboVM: iOS ž  TakaTuka: wireless sensor network devices (Uni Freiburg) 28.11.2014 MindApproach für Eclipse User Group Dresden 31
  24. JVM – Others Commercial ž  Azul Systems (dual) ž  HP

    —  HP-UX, OpenVMS and others ž  IBM —  J9 ž  JamaicaVM —  real-time ž  Atego PERC —  real-time 28.11.2014 MindApproach für Eclipse User Group Dresden 32
  25. Javascript •  executes Javascript on Board •  contains HTTP-Server and

    - Client •  “embedded” Web-IDE •  in progress: •  Socket support enabling MQTT and other IoT-Protocols 28.11.2014 MindApproach für Eclipse User Group Dresden 33 Quelle: https://www.kickstarter.com/projects/gfw/espruino-pico-javascript-on-a-usb-stick
  26. 28.11.2014 36 MindApproach für Eclipse User Group Dresden Eclipse IoT

    Projekte Mihini Paho Eclipse SCADA Ponte Concierge Mosquitto SmartHome Kura Krikkit OM2M Californium Wakaama Moquette
  27. Bausteine 28.11.2014 37 MindApproach für Eclipse User Group Dresden Eclipse

    IoT (iot.eclipse.org) Services & Frameworks Protocols Tools Community Sandbox
  28. Sandboxes ž  MQTT-Broker —  Mosquitto V1.3.1 (inzwischen Eclipse Projekt) — 

    tcp://iot.eclipse.org:1883 —  http://eclipse.mqttbridge.com ž  CoAP —  Eclipse Californium —  coap://iot.eclipse.org:5683 ž  Lightweight M2M (LWM2M) —  Leshan —  coap://iot.eclipse.org:5684 —  http://iot.eclispe.org/lwm2m 28.11.2014 MindApproach für Eclipse User Group Dresden 39
  29. Services & Frameworks “deliver extensible runtimes and services enabling IoT/M2M

    applications” ž  Frameworks for IoT/M2M Gateways —  Kura —  Mihini (http://eclipse.org/mihini/) ž  Industry Services —  SmartHome (http://eclipse.org/smarthome/) —  Eclipse SCADA (http://eclipse.org/eclipsescada/) —  OM2M 28.11.2014 MindApproach für Eclipse User Group Dresden 42
  30. IoT - MQTT ž  MQ Telemetry Transport ž  entwickelt 1999

    (IBM u.a.) ž  seit 2013 OASIS-Standard (aktuell V3.1.1) ž  simplicity ž  lightweight (bandwith, battery, …) ž  robust (network outages, …) 28.11.2014 MindApproach für Eclipse User Group Dresden 45
  31. IoT - MQTT - Overview 28.11.2014 46 MindApproach für Eclipse

    User Group Dresden Client::Producer Client::Receiver Broker decupled logical information flow
  32. IoT - MQTT - Broker ž  Eclipse Projects: —  Mosquitto

    (C), Moquette (Java, Netty, LMAX) ž  IBM: —  WebSphere MQ Telemetry —  MessageSight (Appliance) —  Integration Bus (via Adapter) ž  dc-square: —  HiveMQ ž  RabbitMQ, ActiveMQ, Apollo, Mosca (Node.js Modul) ž  … 28.11.2014 MindApproach für Eclipse User Group Dresden 47
  33. IoT - MQTT - Client ž  Eclipse Projects: —  Paho

    ◦  Java, Android, Javascript, C/C++, Python, Go, C# (.Net und WinRT) ž  weitere —  Clojure, Dart, Delphi, Erlang, Go, Haskell, Java, Javascript, Lua, .Net, Objective-C, Ocaml, Perl, PHP, Python, REXX, Ruby, Tcl, … 28.11.2014 MindApproach für Eclipse User Group Dresden 48
  34. IoT - MQTT - Basics ž  Producer.Connect ž  Receiver.Connect ž 

    Receiver.Subscribe ž  Producer.Publish ž  Broker.Publish (Receiver.Arrive) ž  Receiver.Unsubscribe ž  Receiver.Disconnect ž  Producer.Disconnect ž  ClientId ž  Connection ž  Session 28.11.2014 MindApproach für Eclipse User Group Dresden 49
  35. IoT - MQTT – Demo 1 ž  Moquette V0.7-SNAPSHOT ž 

    MQTTfx als “universeller” Client” 28.11.2014 MindApproach für Eclipse User Group Dresden 50
  36. IoT - MQTT - Topics ž  Names —  machine1/valve5/pressure — 

    machine1/valve5/temperature —  (dynamically) defined during publish —  $SYS ž  Filters —  used for subscription of topics —  Wildcards ◦  “+” / “#” => single / multi level ◦  machine1/# ◦  machine1/+/pressure 28.11.2014 MindApproach für Eclipse User Group Dresden 51
  37. IoT - MQTT - Quality of Service ž  to /

    (from) broker (not overall) per message ž  (practically) defined during publishing ž  QoS 0 —  at most once —  “fire and forget” ž  QoS 1 —  at least once ž  QoS 2 —  exactly once 28.11.2014 MindApproach für Eclipse User Group Dresden 52
  38. IoT - MQTT – Demo 2 ž  Unittests with embedded

    Moquette V0.7- SNAPSHOT ž  Demo2 28.11.2014 MindApproach für Eclipse User Group Dresden 53
  39. IoT - MQTT – Last Will ž  “Testament” ž  per

    connection ž  notification about abnormal disconnection of a client (producer) 28.11.2014 MindApproach für Eclipse User Group Dresden 54
  40. IoT - MQTT – Demo 3 ž  Last will with

    local Moquette broker and two clients —  mosquitto_sub –t EclipseUserGroup/Dresden —  MQTTfx-Client 28.11.2014 MindApproach für Eclipse User Group Dresden 55
  41. IoT - MQTT – Retained Message ž  (one) “durable” message

    per topic ž  stored in broker ž  flagged in message ž  use case: last know (good) state 28.11.2014 MindApproach für Eclipse User Group Dresden 56
  42. IoT - MQTT – Demo 4 ž  Unittest —  Demo4

    ◦  QoS0 ◦  QoS1 28.11.2014 MindApproach für Eclipse User Group Dresden 57
  43. IoT - MQTT - CleanSession ž  Broker maintains session state

    after disconnect or not —  subscriptions —  messages for subscribed topics 28.11.2014 MindApproach für Eclipse User Group Dresden 58
  44. IoT - MQTT – Demo 5 ž  Unittest —  Demo5

    28.11.2014 MindApproach für Eclipse User Group Dresden 59
  45. CoAP ž  Constrained Application Protocol ž  verwendet “Prinzipien” von Http/REST

    —  aber asynchron and stateful ž  Transportlayer (Datagramm) —  UDP, SMS, … ž  IETF Constrained RESTful (CoRE) environments working group —  RFC7252 28.11.2014 MindApproach für Eclipse User Group Dresden 60
  46. CoAP - Overview 28.11.2014 61 MindApproach für Eclipse User Group

    Dresden Client Server Server Client Anm.: Implementierungen enthalten i.d.R. Server und Client und werden “zweigleisig” benutzt
  47. CoAP - Methods ž  Resources / URI —  coap://iot.eclipse.org:5683/resource/sub ž 

    GET / POST / PUT / DELETE ž  Response Code —  Created, Deleted, Valid, Changed, … —  Bad Request, Unauthorized, … ž  (Demo: Copper) 28.11.2014 MindApproach für Eclipse User Group Dresden 63
  48. CoAP - Implementierungen ž  C for constrained devices —  Erbium,

    libcoap, tinydtls, SMCP, microcoap, cantcoap, Wakaama ž  Java for constrained devices: MR-CoAP ž  Java: —  Californium, nCOAP, Leshan ž  Smartphones: iOS, Android ž  Browser: Copper (Firefox) ž  C#, Go, Javascript, Python, Ruby 28.11.2014 MindApproach für Eclipse User Group Dresden 64
  49. CoAP - Californium ž  Californium core ž  Scandium —  security,

    DTLS 1.2 (ECC) ž  Actinium —  Runtime Container for Mashups (Javascript) ž  CoAP-Tools ž  Connector —  abstraction for different transport layers —  UDP-Connector 28.11.2014 MindApproach für Eclipse User Group Dresden 65
  50. CoAP - Demo ž  Unittest with Californium Client and Server

    ž  “Nachtest” mit Copper (Stop Unittest in Debugger) 28.11.2014 MindApproach für Eclipse User Group Dresden 66
  51. LWM2M ž  OMA (Open Mobile Alliance) / ETSI-Standards ž  on

    top of CoAP ž  Devicemanagement ž  Eclipse Projekte OM2M, Wakaama, … 28.11.2014 MindApproach für Eclipse User Group Dresden 67 Quelle: http://openmobilealliance.org/about-oma/work-program/m2m-enablers/
  52. Many More Protocols ž  TCPv6 ž  6LoWPAN —  IPv6 over

    Low power Wireless Personel Area Networks —  based on IEEE 802.15.4 —  RFC 6282 ž  ZigBee —  low-cost, low-power wireless mesh network —  non-free (ZigBee Alliance), nicht immer alles untereinander kompatibel ž  Bluetooth low energy ž  Wi-Fi 28.11.2014 MindApproach für Eclipse User Group Dresden 68