m4m 2 the rescue of m2m - eclipse democamps fall 2013

44
M4M 2 the Rescue of M2M Werner Keil Eclipse DemoCamp Stuttgart 6 th December 2013 Standards for The Internet of Things

Upload: werner-keil

Post on 22-Apr-2015

518 views

Category:

Technology


4 download

DESCRIPTION

M4M or Measure 4 Measure, ever since Shakespeare's play with the same name we know, people can be mistaken for one another. A Duke (like the beloved Java mascot) claims to be a monk, the head of a dead pirate is presented to be that of the young hero. So can important information like Units of Measurement be misinterpreted. While humans reading 10°C, 10 C or 10 Degree Celsius, each of those could be interpreted and understood well enough. For M2M communication, unless a program is provided with a large glossary of alternate terms, only ONE of these would be acceptable. This is where the Unified Code for Units of Measurement (UCUM) among similar approaches like UnitsML, SensorML or a few others are vital for error-free M2M transactions, not just between sensors or measurement devices, but also and especially vehicles or distributed devices. OSGi Measurement has been around for some time (R3) but never gained as much momentum, as many other bundles of OSGi did. Except for very few use cases in the Embedded or Automotive sector it is practically unused and based on statements by its contributors in the OSGi Alliance to be considered legacy with no plans continue development.

TRANSCRIPT

Page 1: M4M 2 the Rescue of M2M - Eclipse DemoCamps Fall 2013

M4M 2 the Rescue of M2M

Werner Keil

Eclipse DemoCamp Stuttgart

6th December 2013

Standards forThe Internet of Things

Page 2: M4M 2 the Rescue of M2M - Eclipse DemoCamps Fall 2013

Overview

• Introduction•Sensors and Measurement

• Historic IT Errors and Bugs• UOMo, Unit-API, UCUM

• Demo• M2M

• Sensor Web, SensorML• Use Cases, Framework, Protocols, Tools

•Embedded Standards• Embedded Java Standards, Other Trends

•Q&A

2 © 2007-2013 Creative Arts & Technologies

Page 3: M4M 2 the Rescue of M2M - Eclipse DemoCamps Fall 2013

Who am I?

3 © 2007-2013 Creative Arts & Technologies

Werner Keil

• Consultant – Coach

• Creative Cosmopolitan

• Open Source Evangelist

• Software Architect

• Java Godfather

• UOMo Project Lead

• ETCS Guy …

Email [email protected]

Twitter @wernerkeil

Page 4: M4M 2 the Rescue of M2M - Eclipse DemoCamps Fall 2013

Let the Games begin

4 © 2007-2013 Creative Arts & Technologies Images © Copyright 2007 Cyberslayer

Page 5: M4M 2 the Rescue of M2M - Eclipse DemoCamps Fall 2013

Measure for Measure

5 © 2007-2013 Creative Arts & Technologies

Mistaking a Pirate…

Images © Copyright 2011 Getty Images

Page 6: M4M 2 the Rescue of M2M - Eclipse DemoCamps Fall 2013

Measure for Measure

6 © 2007-2013 Creative Arts & Technologies

For a heroof the story...

Images © Copyright 2012 The Old Globe, San Diego CA

Page 7: M4M 2 the Rescue of M2M - Eclipse DemoCamps Fall 2013

Measure for Measure

7 © 2007-2013 Creative Arts & Technologies

Mistaking a Duke…

Page 8: M4M 2 the Rescue of M2M - Eclipse DemoCamps Fall 2013

Measure for Measure

8 © 2007-2013 Creative Arts & Technologies

For afriar...

Images based on poster created for the Oregon Shakespeare Festival © 2011 by Jeff Rauch

Page 9: M4M 2 the Rescue of M2M - Eclipse DemoCamps Fall 2013

Type-Safety

•Java does not have strongly typed base types (like e.g. Ada or Smalltalk).

• This could change around Java 10 or 11 (based on Oracle Road Map and statements)

•For performance reasons most developer prefer primitive types over objects in their interface.

•Primitive type arguments can more easily lead to name clashes (methods with the same signature) or other problems (“Auto-Boxing”,…)

9 © 2007-2013 Creative Arts & Technologies

Page 10: M4M 2 the Rescue of M2M - Eclipse DemoCamps Fall 2013

What do these disasters have in common?•Patriot Missile

The cause was an inaccurate calculation of the time since boot due to a computer arithmetic error.

•Ariane 5 ExplosionFloating point number which a value was converted from had a value greater than what would be represented by a 16 bit signed integer.

• Gimli Glider (near disaster)Fuel loading was miscalculated through misunderstanding of the recently adopted Metric System, replacing the Imperial System in Canada

10 © 2007-2012 Creative Arts & Technologies

Page 11: M4M 2 the Rescue of M2M - Eclipse DemoCamps Fall 2013

•Mars Orbiter Preliminary findings indicate that one team used US/English units (e.g. inches, feet and pounds) while the other used metric units for a key spacecraft operation.

• NASA lost a $125 million Mars orbiter because a Lockheed Martin engineering team used English units of measurement while the agency's team used the more conventional metric system for a key spacecraft operation

• A credible source disclosed, there was a manual step with an outsourced person to convert these calculations between the different teams, and NASA budget cuts caused them to fire him and have the wrong, unpatched data transmitted!!!

• This also underlines the added risk when 3rd party contractors are involved or projects are developed Offshore

What do these disasters have in common?

11 © 2007-2012 Creative Arts & Technologies

Page 12: M4M 2 the Rescue of M2M - Eclipse DemoCamps Fall 2013

23rd March 1983. Ronald Reagan announces SDI (or “Star Wars”): ground-based and space-based systems to protect the US from attack by strategic nuclear ballistic missiles.

NASA “Star Wars” Initiative, 1983

12 © 2007-2012 Creative Arts & Technologies

Page 13: M4M 2 the Rescue of M2M - Eclipse DemoCamps Fall 2013

1985

Mirror on underside of shuttle

SDI Experiment: The Plan

Big mountain in Hawaii

13 © 2007-2012 Creative Arts & Technologies

Page 14: M4M 2 the Rescue of M2M - Eclipse DemoCamps Fall 2013

1985

SDI Experiment: What really happened

14 © 2007-2012 Creative Arts & Technologies

Page 15: M4M 2 the Rescue of M2M - Eclipse DemoCamps Fall 2013

15 © 2007-2012 Creative Arts & Technologies

1985: Why it happened?

Page 16: M4M 2 the Rescue of M2M - Eclipse DemoCamps Fall 2013

Unit Tests wouldn‘t find these…

•All previous examples illustrate three categories of errors difficult to find through Unit Testing:

• Interface Errors (e.g. millisecond/second, radian/degree, meters/feet).

• Arithmetic Errors (e.g. overflow).

• Conversion Errors.

Despite their name

16 © 2007-2013 Creative Arts & Technologies Images © Copyright, American Shakespeare Center

Page 17: M4M 2 the Rescue of M2M - Eclipse DemoCamps Fall 2013

Causes of Conversion Errors

•Ambiguity on the unit• Gallon Dry / Gallon Liquid - Gallon US / Gallon UK

• Day Sidereal / Day Calendar

• Foot in various regions, at least historically, see: http://en.wikipedia.org/wiki/German_obsolete_units_of_measurement#Fu.C3.9F_.28foot.29

• Degree Celsius / Degree Fahrenheit• Did you know that Gabriel Fahrenheit was born in Gdansk (Danzig) in northern

Poland?

• …

•Wrong conversion factors:static final double PIXEL_TO_INCH = 1 / 72;

double pixels = inches * PIXEL_TO_INCH

17 © 2007-2013 Creative Arts & Technologies

Page 18: M4M 2 the Rescue of M2M - Eclipse DemoCamps Fall 2013

ALL OF THEM HAPPENED IN MOBILE, REAL TIME OR EMBEDDED SYSTEMS!

What else do they have in common?

18 © 2007-2012 Creative Arts & Technologies

Page 19: M4M 2 the Rescue of M2M - Eclipse DemoCamps Fall 2013

Measurement Package

• Namespace: org.osgi.util.measurement

• SI only Unit API “in the closet”• Unit

Essentially an SI singleton holding relevant unit constants, too.• Measurement

Represents a value with an error, a unit and a time-stamp. • State

Groups a state name, value and timestamp.

•Some usage, e.g. by Automotive

► no further development by OSGi

OSGi

19 © 2007-2013 Creative Arts & Technologies

Page 20: M4M 2 the Rescue of M2M - Eclipse DemoCamps Fall 2013

• Namespace: javax.microediton.sensor*

• Focusing on Sensors, but it got a minimalistic Unit API “in the closet”

• UnitEssentially an SI singleton holding relevant unit constants, too.JavaDoc: http://pandora.la/java/javadocs/sensor/javax/microedition/sensor/Unit.html

• ChannelInfoHolding name, accuracy, data type,measurement ranges, scale and unit

• MeasurementRangeRange of possible values from minimum to maximum

► Dead Meat (few actual handsets and no vendors except Nokia still use it, nor does Java ME Embedded)

JSR-256

20 © 2007-2013 Creative Arts & Technologies

Mobile Sensor API

Page 21: M4M 2 the Rescue of M2M - Eclipse DemoCamps Fall 2013

•Namespace: javax.measure.*

•Only one interface and one abstract class• public interface Measurable<Q extends Quantity>

• public abstract class Measure<V, Q extends Quantity>

•Three sub-packages• quantity (holds dimensions mass, length)

• unit (holds the SI and NonSI units)

• converter (holds unit converters)

JSR-275

21 © 2007-2012 Creative Arts & Technologies

Units Specification

Page 22: M4M 2 the Rescue of M2M - Eclipse DemoCamps Fall 2013

•JScience

•Groovy/Grails• DSLs e.g. for Healthcare

•GeoAPI (OGC standard) and implementations, e.g.• uDig (see slide 32)

•Parfait• Java Monitoring, part of Performance Co-Pilot (PCP)

•…

JSR-275

22 © 2007-2013 Creative Arts & Technologies

Users and popular Downstream Projects

Page 23: M4M 2 the Rescue of M2M - Eclipse DemoCamps Fall 2013

•Namespace: org.unitsofmeasurement.*

•Only interfaces (and exception classes)• public interface Quantity<Q extends Quantity<Q>>

• public interface Unit<Q extends Quantity<Q>>

•Three sub-packages• quantity (holds dimensions mass, length,...)

• unit (holds units)

• service (holds services)

The King is Dead…

23 © 2007-2013 Creative Arts & Technologies

Units of Measurement API

Walking

Page 24: M4M 2 the Rescue of M2M - Eclipse DemoCamps Fall 2013

Eclipse UOMo

One Small Step…

Page 25: M4M 2 the Rescue of M2M - Eclipse DemoCamps Fall 2013

One Unit Framework to Measure them All

•Namespace: org.eclipse.uomo.*

•Two main areas• Static Type Safe Units of Measure Support

• Based on Units of Measurement API

• On top of ICU4J, the Globalization standard at Eclipse and others (Android, GWT, Google Financial, etc.)

• Prime UCUM Implementation• Successor to Eclipse OHF UCUM Bundle

Eclipse UOMo

25 © 2007-2012 Creative Arts & Technologies

Page 26: M4M 2 the Rescue of M2M - Eclipse DemoCamps Fall 2013

Unified Code for Units of Measure

The Unified Code for Units of Measure is inspired byand heavily based on

• ISO 2955-1983

• ANSI X3.50-1986

• HL7's extensions called ISO+

UOMo UCUM

26 © 2007-2012 Creative Arts & Technologies

Page 27: M4M 2 the Rescue of M2M - Eclipse DemoCamps Fall 2013

JSR 354 Implementation

“Sisu” equivalent for 354 if you want

• ICU4J based implementation of types like

• CurrencyUnit

• MonetaryAmount

• CurrencyConverter

• ExchangeRate• …

• Bridge to Unit-API where possible for cross-quantity arithmetic (e.g. “$ per gram CO² per mile”)

UOMo Business

27 © 2007-2013 Creative Arts & Technologies

Page 28: M4M 2 the Rescue of M2M - Eclipse DemoCamps Fall 2013

DEMO

UOMo Examples

Page 29: M4M 2 the Rescue of M2M - Eclipse DemoCamps Fall 2013

“A coordinated observation infrastructure composed of a distributed collection of resources that can collectively behave as a single, autonomous, task-able, dynamically adaptive and reconfigurable observing system that provides raw and processed data, along with associated meta-data, via a set of standards-based service-oriented interfaces.” (Glenn, 2007)

29 © 2007-2012 Creative Arts & Technologies

Sensor Web | What is it?

Page 30: M4M 2 the Rescue of M2M - Eclipse DemoCamps Fall 2013

OGC O&M Observations & Measurements Approved

SensorML Sensor Model Language Approved

TransducerML Transducer Model Language Approved

OGC SOS Sensor Observations Service Approved

OGC SPS Sensor Planning Service Approved

OGC SAS Sensor Alert Service In progress

OGC WNS Web Notification Services In progress

Sensor Web | OpenGIS Standards

• SW Enablement working group at OGC have developed a number of standards governing different aspects of Sensor Web

30 © 2007-2012 Creative Arts & Technologies

Page 31: M4M 2 the Rescue of M2M - Eclipse DemoCamps Fall 2013

Sensor Web | LocationTech

•uDig is a desktopapplication framework, built with EclipseRich Client (RCP)

• Internet: supporting standards (WMS, WFS,WCS, KML) …

• GIS: framework for spatial data exploration and analysis

• Based on JSR-275

http://locationtech.org/projects/technology.udighttp://locationtech.org/projects/technology.udig

31 © 2006-2013 Creative Arts & Technologies , Eclipse Foundation, Inc. Made available under the Eclipse Public License 1.0

Page 32: M4M 2 the Rescue of M2M - Eclipse DemoCamps Fall 2013

Sensor Web | Mozambique floods

•The task under study is floods in different parts of the world

•Particular test case was flooding of Mozambique

32 © 2007-2012 Creative Arts & Technologies

Page 33: M4M 2 the Rescue of M2M - Eclipse DemoCamps Fall 2013

SensorML

• Sensor modeling language is the cornerstone of all SW services

• It provides comprehensive description of sensor parameters and capabilities

• It can be used for describing different kind of sensors:– Stationary or dynamic– Remote or in-situ– Physical measurements or simulations

33 © 2007-2012 Creative Arts & Technologies

Page 34: M4M 2 the Rescue of M2M - Eclipse DemoCamps Fall 2013

SensorML | Example..............<inputs> <InputList> <input name="ambiantTemperature"> <swe:Quantity definition= "urn:ogc:def:phenomenon:temperature"/> </input> <input name="atmosphericPressure"> <swe:Quantity definition= "urn:ogc:def:phenomenon:pressure"/> </input> <input name="windSpeed"> <swe:Quantity definition= "urn:ogc:def:phenomenon:windSpeed"/> </input></InputList></inputs>..............

.............<outputs> <OutputList> <output name="weatherMeasurements"> <swe:DataGroup> <swe:component name="time"> <swe:Time definition="urn:ogc:def:phenomenon:time“ uom="urn:ogc:def:unit:iso8601"/> </swe:component> <swe:component name="temperature"> <swe:Quantitydefinition="urn:ogc:def:phenomenon:temperature uom="urn:ogc:def:unit:celsius"/> </swe:component> <swe:component name="barometricPressure"> <swe:Quantity definition="urn:ogc:def:phenomenon:pressure“ uom="urn:ogc:def:unit:bar" scale="1e-3"/> </swe:component> <swe:component name="windSpeed"> <swe:Quantity definition="urn:ogc:def:phenomenon:windSpeed“ uom="urn:ogc:def:unit:meterPerSecond"/> </swe:component> </swe:DataGroup> </output> </OutputList></outputs>.............

34 © 2007-2012 Creative Arts & Technologies

Page 35: M4M 2 the Rescue of M2M - Eclipse DemoCamps Fall 2013

Transportation & Logistics Logistics

Medical &

Healthcare

Industrial &

EnergyCommunication

Infrastructure

Security & Surveillance

Internetof Things

M2M | Integrated Processes

35 © 2007-2013 Creative Arts & Technologies Eclipse Foundation, Inc. Made available under the Eclipse Public License 1.0,

Public/Private Cloud Deployment Infrastructures

Page 36: M4M 2 the Rescue of M2M - Eclipse DemoCamps Fall 2013

• Barrier-type bolt seal• RFID: ID-number + integrity• Bar code• Battery 1 year transmitting• 50 cycles• Range up to 50 meters• 915 MHz + 2.4 GHz• Data transmission rate 500 kbps• Storage 64 bytes

M2M | Smart ContainerRFID e-Seal Example

36 © 2005-2012 Creative Arts & Technologies, Prof. Jens Froese – TU Hamburg-Harburg

Page 37: M4M 2 the Rescue of M2M - Eclipse DemoCamps Fall 2013

A Publish Subscribe messaging protocol allowing a message to be published once and multiple consumers (applications / devices) to receive the message providing decoupling between the producer and consumer(s)

A producer sends (publishes) a message (publication) on a topic (subject)A consumer subscribes (makes a subscription) for messages on a topic (subject)

A message server / broker matches publications to subscriptions • If no matches the message is discarded• If one or more matches the message is delivered to each matching subscriber/consumer

M2M | MQTT

37 © 2007-2013 Creative Arts & Technologies, Eclipse Foundation, Inc. Made available under the Eclipse Public License 1.0

Publish Subscribe Messaging

Page 38: M4M 2 the Rescue of M2M - Eclipse DemoCamps Fall 2013

•2 new JSRs for Mobile and Embedded•JSR-360: CLDC 8

• CLDC 8 is an evolutionary update to CLDC 1.1.1 to bring the VM, Java Language, and libraries up to date with Java SE 8.

• More: http://java.net/projects/jsr360/pages/Home

•JSR-361: Java ME Embedded Profile• Update IMP(-NG) to align with state-of-the-art features and current

embedded device market requirements.• More: http://java.net/projects/jsr361/pages/Home

Embedded Standards | JSR-360, 361

38 © 2007-2012 Creative Arts & Technologies

Page 39: M4M 2 the Rescue of M2M - Eclipse DemoCamps Fall 2013

Embedded Standards | Gemalto M2M

39 © 2007-2013 Creative Arts & Technologies, Gemalto

Page 40: M4M 2 the Rescue of M2M - Eclipse DemoCamps Fall 2013

•Xively• Language bindings for Java/Android, Python or Ruby contain support for Units of

Measurement Website: http://www.xively.com

•OpenXC• Feels quite a bit like a modernized OSGi Measurement bundle. Offering only SI

units by default, but a more sophisticated Unit and Quantity concept somewhat similar and clearly inspired by Unit-API / JSR-275

• Website: http://openxcplatform.com/• ► Without proper security, Connected Car hacks like that on

Tesla pose a great risk to this and all other critical sectors (Health, Avionics,...)

•CSS 3• Mostly UI/rendering, but promises almost UCUM-like arithmetic and quantity-

checking See: http://www.w3.org/TR/css3-values/

Other Trends for Sensors | Measurement

40 © 2007-2013 Creative Arts & Technologies

Page 41: M4M 2 the Rescue of M2M - Eclipse DemoCamps Fall 2013

Q & A

Page 42: M4M 2 the Rescue of M2M - Eclipse DemoCamps Fall 2013

Eclipse – Project UOMo

http://www.eclipse.org/uomo/

Units of Measurement API

http://www.unitsofmeasurement.org

UCUM

http://www.unitsofmeasure.org

Links

Page 43: M4M 2 the Rescue of M2M - Eclipse DemoCamps Fall 2013

Eclipse – M2M IWG

http://m2m.eclipse.org

Open Geospatial Consortium

http://www.opengeospatial.org

Java Community Process

http://www.jcp.org

Links (2)

Page 44: M4M 2 the Rescue of M2M - Eclipse DemoCamps Fall 2013

Contact

[email protected]

or

[email protected]

Twitter: @wernerkeil

Hashtag #EclipseUOMo