Building Modular Applications for Embedded Devices EclipseRT Day - November 2009 Brett Hackleman Copyright © 2009  Band XI International, LLC
Overview OSGi, Equinox DeviceKit (interfacing with external hardware) Industrial Graphics Framework (custom SWT widgets) Remote Provisioning with p2 Applied to: Industrial, Mining, Construction Systems US Army Distributed WMD Sensor System (Cyrano) Best practices
Challenges of Embedded Systems Platforms Availability, variability, scarcity, stability, cost  (future of Java?) Peripheral hardware: sensors and actuators Availability, scarcity, size, cost User interfaces Input methods, desktop vs. appliance Constraints “Realtime”, memory/CPU limitations, development vs runtime costs Applications Yes, you still have to write the application(s) too!
Accepting the Challenge Lots of Risk == More Fun!  (yes, we’re sick) Tackle risks head-on Build simulators, identify alternate paths and representative systems Embrace change Agile development methodologies build change into the process Use agile methods, frameworks, and tools Testing frameworks (JUnit, FitNesse) Continuous integration build systems (Jazz) Software Configuration Management (Jazz) And, of course…
Copyright © 2009 Band XI International, LLC OSGi / Equinox
OSGi: Introduction OSGi has been an open standard for over a decade Original domain (home gateways) has yet to take off Instead, OSGi has gained significant traction as a well-designed software componentization and deployment framework Eclipse, as the base platform J2EE server providers (Server-side OSGi) Mobile (Nokia, Sprint Titan) Embedded (MicroDoc & Band XI) Equinox is the most widely used OSGi implementation Bundle development well-supported by Eclipse PDE tooling
Our Perspective: A Decade of Embedded OSGi Automotive, Fleet Management, Remote Monitoring OnStar scenarios, diagnostics, infotainment, hands-free, navigation Industrial Controls, RFID Sensors, scaling, configuration management, deployment National Guard: WMD Sensors, Situational Awareness Provisioning new apps, biometric sensors, P2P comms Army: Vehicle Diagnostics & Prognostics Architecture Provisioning new algorithms, flexible UI, provisioning Mining Equipment: Diagnostics, Machine Control Rapid turnaround on new applications, flexible architecture
OSGi: Highly Cohesive, Loosely Coupled Component Model Strong  component model , common language Forces  best practices  from day one Core specification is  pure and simple Logical and clear  mapping with whiteboard drawings Dynamic life-cycle  allows install/unintall/update without restart Integrated and sophisticated  deployment mechanism  Isolation of external  libraries to monitor and consume capabilities Discourages spaghetti code : bundle partitions are like firebreaks  Discourages code rot : containment lowers barrier to refactoring
Copyright © 2009 Band XI International, LLC DeviceKit
DeviceKit Tooling and components for communicating with hardware devices Provides high-level APIs for commands, signals, measurements Includes support for common interface types RS232, RS485 - serial port interfaces TCP, UDP network interfaces CAN, J1939, J1850, J1708 vehicle communications buses MIL-STD-1553 avionics communication bus JNI (onboard GPIO, transceivers, etc) OSGi-enabled out of the box Provides smooth path: Development --> Testbench --> Field-testing -> Production Currently lives in the Eclipse OHF project
DeviceKit: Development Path
DeviceKit: J1939 Protocols J1939-21: Datalink Basic Protocol Data Unit (PDU), PGNs, priorities, etc. Transport Protocol (multi-packet, broadcast and point to point) J1939-81: Network Management Address Claim (fixed, arbitrary address) Discovery J1939-73: Diagnostic Messages DM1: Active Diagnostic Trouble Codes (DTCs) DM2: Logged DTCs DM14/15/16: Memory Configuration Additional information for active/logged DTCs Proprietary J1939 Messages  For solution-specific ECU’s
DeviceKit: In-Vehicle J1939 Software Stack CAN BUS CAN Connection J1939 Transport J1939 Diagnostics DTC Lamp Status J1939 Message J1939 Address Claim Data Transfer Record JP CAN Peak CAN Fake CAN
DeviceKit: J1939 Interfaces Supported Dearborn  Group Gryphon (Ethernet to CAN) Peak  CAN (USB to CAN) Wachendorff  on-board PCAN transceiver Eurotech  Zeus on-board CAN transceiver DriverTech  DT-3000A DRS TEM  BlueRing Platform RP1210A library (CAN/J1939 on Windows, CMPD)
Copyright © 2009 Band XI International, LLC Industrial Graphics Framework
Industrial Graphics Framework Desktop metaphors do not work in industrial control settings Designed for touchscreen and hard-/soft-button navigation Set of custom SWT widgets and exemplary sample applications Includes application shell, menu bar, graphics oriented widgets, and pop-ups
Copyright © 2009 Band XI International, LLC p2: Remote Provisioning
p2 in Eclipse Transports Director Profiles Runtimes Provisioning operation requested Metadata fetched and constraints analyzed IU install, uninstall, update operations Artifact availability and mirroring Mirroring Data transfer IUs configured into runtimes Profile updated Http/Https File system Volume Repositories p2 Update Site Engine Eclipse/OSGi Native/OS
p2: Embedded Transports Director Profiles Runtimes Provisioning operation requested Metadata fetched and constraints analyzed IU install, uninstall, update operations Artifact availability and mirroring Mirroring Data transfer IUs configured into runtimes Profile updated and Synchronized Server Profiles Text Server Client Http/Https File system Volume Repositories p2 Update Site Engine Eclipse/OSGi Native/OS
p2: Device Management Portal
Copyright © 2009 Band XI International, LLC Applications
Cyrano™ Overview ACAA   MultiRAE   AreaRAE   Thermo FH40   Identifinder Gamma Spec HAZMAT ID VDR 2 VDR 13 Barcode/RFID Scanner Sample Collection Hazard Detection SCBA Tank   Pulse Oximeter Heart Rate & BP Monitor   Others… CAN   J1939   J1850   OBD II Others… Health Status Monitoring Vehicle Mounted Systems for Status Monitoring   WIFI Network Location Tracking   Decision Support;  Command and Control   Sensor Fusion   Mapping Services   Software Updates   Voice Over IP Comms   Multicast to Other Units   Existing WMD CST CBRN Sensors Wireless Digital Media Remote Expert Input    Biometrics Vehicle Diagnostics GPS Joint Operation  Command Sensor Fusion System ™
Industrial, Mining, Construction, & Military Applications Building field production applications for mining and construction machines Salt Harvester Foundation Drill Train Engines Proves viability of the architecture and implementation in fielded environments
Mining & Construction Systems: Goals & Challenges Goals Shorten Application Development Time from 6-9 months to 2 weeks! Tackle this in stages by building and refining the foundation 1st application: Duplicate existing reference application (6 months) 2nd application: Salt Harvesting Machine (10 weeks) 3rd application: Foundation Drill Machine (5 weeks) Challenges 2 platforms to be supported: one legacy, one newly selected Legacy platform: 400MHz ARM, 32MB RAM/ROM, WindowsCE New Platform: 400MHz PPC, 1GB RAM, 64MB ROM, Linux Machinery does not exist yet; we will never touch it Incumbent native application to be displaced
Challenge: New Platform Integration Risks at Development Start Platform not available until late in project schedule SWT not running on the platform CAN native JNI libraries did not exist Coping Strategy to Get Started Started development with similar Linux platform Used Gryphon (Ethernet-to-CAN) transport bundles Found a CAN transport supported by same driver (PCAN-USB) Built native JNI libraries and bundles to access CAN bus When Platform Became Available Validated JNI libraries and bundles against platform CAN transceiver Ran application headless while SWT in development Ran entire application once SWT had been ported
Copyright © 2009 Band XI International, LLC Best Practices
Best Practices (1 of 2): Eclipse Use Eclipse PDE and p2 tooling  - bundles are first class citizens! Identify target platform early, put under version control Use product files to describe/build runtime configurations Get involved
Best Practices (2 of 2): OSGi Use only  Import-Package  and  Export-Package  for visibility Use Declarative Services to manage optional and required services Separate interfaces from implementation Separate application logic implementation from OSGi specific code Build fake, simulated, and real devices to keep moving Keep application work off OSGi threads (activation or call-backs) Assume nothing about start order Test shutdown behavior obsessively to expose loose ends Have at least one OSGi/Equinox expert on your team Develop using OSGi  – even if it will not be used in final product
Discussions & Demo Questions, Comments? Demo
DeviceKit: CAN/J1939 Test Bench Gryphon Ethernet to J1939 Protocol Bridge DPA III RS232 to J1939 Protocol Bridge J1939 2-wire CAN bus J1939 Sensors Industrial  A5M2 ECU Embedded Platform w/CAN tranceiver DT3000 (Windows) Eurotech Zeus (Linux) Wachendorff A5 (Linux)

Eclipse RT Day

  • 1.
    Building Modular Applicationsfor Embedded Devices EclipseRT Day - November 2009 Brett Hackleman Copyright © 2009 Band XI International, LLC
  • 2.
    Overview OSGi, EquinoxDeviceKit (interfacing with external hardware) Industrial Graphics Framework (custom SWT widgets) Remote Provisioning with p2 Applied to: Industrial, Mining, Construction Systems US Army Distributed WMD Sensor System (Cyrano) Best practices
  • 3.
    Challenges of EmbeddedSystems Platforms Availability, variability, scarcity, stability, cost (future of Java?) Peripheral hardware: sensors and actuators Availability, scarcity, size, cost User interfaces Input methods, desktop vs. appliance Constraints “Realtime”, memory/CPU limitations, development vs runtime costs Applications Yes, you still have to write the application(s) too!
  • 4.
    Accepting the ChallengeLots of Risk == More Fun! (yes, we’re sick) Tackle risks head-on Build simulators, identify alternate paths and representative systems Embrace change Agile development methodologies build change into the process Use agile methods, frameworks, and tools Testing frameworks (JUnit, FitNesse) Continuous integration build systems (Jazz) Software Configuration Management (Jazz) And, of course…
  • 5.
    Copyright © 2009Band XI International, LLC OSGi / Equinox
  • 6.
    OSGi: Introduction OSGihas been an open standard for over a decade Original domain (home gateways) has yet to take off Instead, OSGi has gained significant traction as a well-designed software componentization and deployment framework Eclipse, as the base platform J2EE server providers (Server-side OSGi) Mobile (Nokia, Sprint Titan) Embedded (MicroDoc & Band XI) Equinox is the most widely used OSGi implementation Bundle development well-supported by Eclipse PDE tooling
  • 7.
    Our Perspective: ADecade of Embedded OSGi Automotive, Fleet Management, Remote Monitoring OnStar scenarios, diagnostics, infotainment, hands-free, navigation Industrial Controls, RFID Sensors, scaling, configuration management, deployment National Guard: WMD Sensors, Situational Awareness Provisioning new apps, biometric sensors, P2P comms Army: Vehicle Diagnostics & Prognostics Architecture Provisioning new algorithms, flexible UI, provisioning Mining Equipment: Diagnostics, Machine Control Rapid turnaround on new applications, flexible architecture
  • 8.
    OSGi: Highly Cohesive,Loosely Coupled Component Model Strong component model , common language Forces best practices from day one Core specification is pure and simple Logical and clear mapping with whiteboard drawings Dynamic life-cycle allows install/unintall/update without restart Integrated and sophisticated deployment mechanism Isolation of external libraries to monitor and consume capabilities Discourages spaghetti code : bundle partitions are like firebreaks Discourages code rot : containment lowers barrier to refactoring
  • 9.
    Copyright © 2009Band XI International, LLC DeviceKit
  • 10.
    DeviceKit Tooling andcomponents for communicating with hardware devices Provides high-level APIs for commands, signals, measurements Includes support for common interface types RS232, RS485 - serial port interfaces TCP, UDP network interfaces CAN, J1939, J1850, J1708 vehicle communications buses MIL-STD-1553 avionics communication bus JNI (onboard GPIO, transceivers, etc) OSGi-enabled out of the box Provides smooth path: Development --> Testbench --> Field-testing -> Production Currently lives in the Eclipse OHF project
  • 11.
  • 12.
    DeviceKit: J1939 ProtocolsJ1939-21: Datalink Basic Protocol Data Unit (PDU), PGNs, priorities, etc. Transport Protocol (multi-packet, broadcast and point to point) J1939-81: Network Management Address Claim (fixed, arbitrary address) Discovery J1939-73: Diagnostic Messages DM1: Active Diagnostic Trouble Codes (DTCs) DM2: Logged DTCs DM14/15/16: Memory Configuration Additional information for active/logged DTCs Proprietary J1939 Messages For solution-specific ECU’s
  • 13.
    DeviceKit: In-Vehicle J1939Software Stack CAN BUS CAN Connection J1939 Transport J1939 Diagnostics DTC Lamp Status J1939 Message J1939 Address Claim Data Transfer Record JP CAN Peak CAN Fake CAN
  • 14.
    DeviceKit: J1939 InterfacesSupported Dearborn Group Gryphon (Ethernet to CAN) Peak CAN (USB to CAN) Wachendorff on-board PCAN transceiver Eurotech Zeus on-board CAN transceiver DriverTech DT-3000A DRS TEM BlueRing Platform RP1210A library (CAN/J1939 on Windows, CMPD)
  • 15.
    Copyright © 2009Band XI International, LLC Industrial Graphics Framework
  • 16.
    Industrial Graphics FrameworkDesktop metaphors do not work in industrial control settings Designed for touchscreen and hard-/soft-button navigation Set of custom SWT widgets and exemplary sample applications Includes application shell, menu bar, graphics oriented widgets, and pop-ups
  • 17.
    Copyright © 2009Band XI International, LLC p2: Remote Provisioning
  • 18.
    p2 in EclipseTransports Director Profiles Runtimes Provisioning operation requested Metadata fetched and constraints analyzed IU install, uninstall, update operations Artifact availability and mirroring Mirroring Data transfer IUs configured into runtimes Profile updated Http/Https File system Volume Repositories p2 Update Site Engine Eclipse/OSGi Native/OS
  • 19.
    p2: Embedded TransportsDirector Profiles Runtimes Provisioning operation requested Metadata fetched and constraints analyzed IU install, uninstall, update operations Artifact availability and mirroring Mirroring Data transfer IUs configured into runtimes Profile updated and Synchronized Server Profiles Text Server Client Http/Https File system Volume Repositories p2 Update Site Engine Eclipse/OSGi Native/OS
  • 20.
  • 21.
    Copyright © 2009Band XI International, LLC Applications
  • 22.
    Cyrano™ Overview ACAA  MultiRAE  AreaRAE  Thermo FH40  Identifinder Gamma Spec HAZMAT ID VDR 2 VDR 13 Barcode/RFID Scanner Sample Collection Hazard Detection SCBA Tank  Pulse Oximeter Heart Rate & BP Monitor  Others… CAN  J1939  J1850  OBD II Others… Health Status Monitoring Vehicle Mounted Systems for Status Monitoring  WIFI Network Location Tracking  Decision Support; Command and Control  Sensor Fusion  Mapping Services  Software Updates  Voice Over IP Comms  Multicast to Other Units  Existing WMD CST CBRN Sensors Wireless Digital Media Remote Expert Input  Biometrics Vehicle Diagnostics GPS Joint Operation Command Sensor Fusion System ™
  • 23.
    Industrial, Mining, Construction,& Military Applications Building field production applications for mining and construction machines Salt Harvester Foundation Drill Train Engines Proves viability of the architecture and implementation in fielded environments
  • 24.
    Mining & ConstructionSystems: Goals & Challenges Goals Shorten Application Development Time from 6-9 months to 2 weeks! Tackle this in stages by building and refining the foundation 1st application: Duplicate existing reference application (6 months) 2nd application: Salt Harvesting Machine (10 weeks) 3rd application: Foundation Drill Machine (5 weeks) Challenges 2 platforms to be supported: one legacy, one newly selected Legacy platform: 400MHz ARM, 32MB RAM/ROM, WindowsCE New Platform: 400MHz PPC, 1GB RAM, 64MB ROM, Linux Machinery does not exist yet; we will never touch it Incumbent native application to be displaced
  • 25.
    Challenge: New PlatformIntegration Risks at Development Start Platform not available until late in project schedule SWT not running on the platform CAN native JNI libraries did not exist Coping Strategy to Get Started Started development with similar Linux platform Used Gryphon (Ethernet-to-CAN) transport bundles Found a CAN transport supported by same driver (PCAN-USB) Built native JNI libraries and bundles to access CAN bus When Platform Became Available Validated JNI libraries and bundles against platform CAN transceiver Ran application headless while SWT in development Ran entire application once SWT had been ported
  • 26.
    Copyright © 2009Band XI International, LLC Best Practices
  • 27.
    Best Practices (1of 2): Eclipse Use Eclipse PDE and p2 tooling - bundles are first class citizens! Identify target platform early, put under version control Use product files to describe/build runtime configurations Get involved
  • 28.
    Best Practices (2of 2): OSGi Use only Import-Package and Export-Package for visibility Use Declarative Services to manage optional and required services Separate interfaces from implementation Separate application logic implementation from OSGi specific code Build fake, simulated, and real devices to keep moving Keep application work off OSGi threads (activation or call-backs) Assume nothing about start order Test shutdown behavior obsessively to expose loose ends Have at least one OSGi/Equinox expert on your team Develop using OSGi – even if it will not be used in final product
  • 29.
    Discussions & DemoQuestions, Comments? Demo
  • 30.
    DeviceKit: CAN/J1939 TestBench Gryphon Ethernet to J1939 Protocol Bridge DPA III RS232 to J1939 Protocol Bridge J1939 2-wire CAN bus J1939 Sensors Industrial A5M2 ECU Embedded Platform w/CAN tranceiver DT3000 (Windows) Eurotech Zeus (Linux) Wachendorff A5 (Linux)