osgi: best tool in your embedded systems toolbox

18
www.bandxi.com Copyright © 2009 Band XI International, LLC OSGi: The Best Tool in Your Embedded Systems Toolbox OSGi DevCon Europe 2009 Brett Hackleman & James Branigan

Upload: brett-hackleman

Post on 21-May-2015

2.093 views

Category:

Technology


0 download

DESCRIPTION

We discuss several of our past and current OSGi-based solutions for defense systems, mining equipment, construction equipment, industrial automation, and automotive/telematics domains. We present some best practices for building flexible, cross-platform, high-performance embedded application and the resulting lessons learned along the way. We demonstrate how the Eclipse Runtime Components and Frameworks can be used to access communication buses such as CAN, J1939, J1850, and MIL-STD-1553. Finally, we explain how using OSGi and Equinox can simplify the development, testing, and deployment of your next application, whether embedded or not.

TRANSCRIPT

Page 1: OSGi: Best Tool In Your Embedded Systems Toolbox

www.bandxi.com

Copyright © 2009 Band XI International, LLC

OSGi: The Best Tool in Your Embedded Systems Toolbox

OSGi DevCon Europe 2009

Brett Hackleman & James Branigan

Page 2: OSGi: Best Tool In Your Embedded Systems Toolbox

Copyright © 2009 Band XI International, LLC

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)

– Telecommunications (Sprint Titan)

– Embedded (MicroDoc & Band XI)

Page 3: OSGi: Best Tool In Your Embedded Systems Toolbox

Copyright © 2009 Band XI International, LLC

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

Page 4: OSGi: Best Tool In Your Embedded Systems Toolbox

Copyright © 2009 Band XI International, LLC

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!

Page 5: OSGi: Best Tool In Your Embedded Systems Toolbox

Copyright © 2009 Band XI International, LLC

Accepting the Challenge

• Lots of Risk == More Fun!

• 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…

Page 6: OSGi: Best Tool In Your Embedded Systems Toolbox

Copyright © 2009 Band XI International, LLC

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

Page 7: OSGi: Best Tool In Your Embedded Systems Toolbox

Copyright © 2009 Band XI International, LLC

Vehicle Bus Control: DeviceKit Support of 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

Page 8: OSGi: Best Tool In Your Embedded Systems Toolbox

Copyright © 2009 Band XI International, LLC

In Vehicle J1939 Device Software Stack

CAN BUS

DTC

Lamp Status

J1939 Message

J1939 Address Claim

Data Transfer Record

JP CAN

Peak CAN

Fake CAN

CAN Connection

J1939 Transport

J1939 Diagnostics

Page 9: OSGi: Best Tool In Your Embedded Systems Toolbox

Copyright © 2009 Band XI International, LLC

J1939 (CAN) Test Bench

GryphonEthernet to J1939Protocol Bridge

DPA IIIRS232 to J1939Protocol Bridge

J1939 2-wire CAN bus

J1939 Sensors

Caterpillar A5 M2 ECU Embedded Platformw/CAN tranceiver

DT3000 (Windows)Eurotech Zeus (Linux)

Wachendorff A5 (Linux)

Page 10: OSGi: Best Tool In Your Embedded Systems Toolbox

Copyright © 2009 Band XI International, LLC

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, Cat CMPD)

Page 11: OSGi: Best Tool In Your Embedded Systems Toolbox

Copyright © 2009 Band XI International, LLC

Industrial Graphics Framework

• Desktop metaphors do not work in industrial control settings

• Funded by US Army under Small Business Innovation Research (SBIR) Grant

• 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

Page 12: OSGi: Best Tool In Your Embedded Systems Toolbox

Copyright © 2009 Band XI International, LLC

Cyrano™ Overview

Existing WMD CSTCBRN Sensors

ACAA MultiRAE AreaRAE Thermo FH40 IdentifinderGamma SpecHAZMAT IDVDR 2VDR 13

Barcode/RFID Scanner

SampleCollection

Wireless Digital Media

RemoteExpert Input

HazardDetection

Biometrics

SCBA Tank Pulse OximeterHeart Rate & BP Monitor Others…

Vehicle Diagnostics

CAN J1939 J1850 OBD IIOthers…

Health StatusMonitoring

Vehicle MountedSystems for StatusMonitoring

WIFINetwork

GPSLocationTracking

Joint Operation Command

Decision Support; Command and Control

Sensor Fusion

Mapping Services Software Updates Voice Over IP Comms Multicast to Other Units

Sensor FusionSystem

Page 13: OSGi: Best Tool In Your Embedded Systems Toolbox

Copyright © 2009 Band XI International, LLC

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

Page 14: OSGi: Best Tool In Your Embedded Systems Toolbox

Copyright © 2009 Band XI International, LLC

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

Page 15: OSGi: Best Tool In Your Embedded Systems Toolbox

Copyright © 2009 Band XI International, LLC

Challenge #1: 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

Page 16: OSGi: Best Tool In Your Embedded Systems Toolbox

Copyright © 2009 Band XI International, LLC

Challenge #2: Salt Harvesting Controls (Sensors & Actuators)

• Risks at Development Start– Custom machine that was still in design and development– Assembled on-site in Australia, half way around the world, remote– Limited testbench testing time available

• Coping Strategy to Get Started– Agreed on logical messages and application screen layour and flow– Built HTTP based simulator (self hosted)– Agreed on J1939 message specs: mix of standard and proprietary– Encoded as DeviceKit ML, built Device bundles– Ran against real ECU via Gryphon gateway from development box

• When Platform Became Available– Ran same stack on target platform– Swapped in target platform CAN transceiver bundles– Created HTTP based publisher

• Simulated ECU and advanced scenarios over real CAN link

Page 17: OSGi: Best Tool In Your Embedded Systems Toolbox

Copyright © 2009 Band XI International, LLC

Best Practices for Embedded OSGi (or any OSGi effort)

• Use Eclipse PDE and p2 tooling - bundles are first class citizens!

• Identify target platform early, put under version control

• 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 expert on your team

• Develop using OSGi – even if it will not be used in final product

Page 18: OSGi: Best Tool In Your Embedded Systems Toolbox

Copyright © 2009 Band XI International, LLC

Open for Discussion

• Questions?

• Comments?