partner webcast – oracle internet of things platform: java 8 connecting the world

51

Upload: oracle-isv-migration-center

Post on 30-Oct-2014

221 views

Category:

Technology


0 download

DESCRIPTION

The Internet of Things Revolution is gaining speed. There are more and more devices, data and connections, thus more and more complexity to handle. But in the first place it brings complete new opportunities to innovative companies. Learn why Java is the answer for many of today and future IoT challenges. Explore new capabilities of Java ME Embedded 8 which has been specifically designed to run modern IoT platform. Understand the immediate opportunities Java brings to the table in the M2M world. [Read More https://blogs.oracle.com/imc/entry/oracle_internet_of_things_platform1]

TRANSCRIPT

Page 1: Partner Webcast – Oracle Internet of Things Platform: Java 8 connecting the world
Page 2: Partner Webcast – Oracle Internet of Things Platform: Java 8 connecting the world

Stay Connected

BLOGS.ORACLE.COM/IMC

TWITTER.COM/ORACLEIMC

YOUTUBE.COM/ORACLEIMCTEAM

FACEBOOK.COM/ORACLEIMC

Page 3: Partner Webcast – Oracle Internet of Things Platform: Java 8 connecting the world

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Oracle Internet of Things Platform Java 8 connecting the world

Lukasz Romaszewski IMC Migration Consultant ISV Migration Center, Partner Business Development September 11, 2014

Page 4: Partner Webcast – Oracle Internet of Things Platform: Java 8 connecting the world

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Webcast Agenda

1

2

3

4

5

Why Java matters in the IoT world

Programming for edge devices using IMLets

Overview on the new features of JMEE 8

Live demonstration

Wrap up and Q&A

Page 5: Partner Webcast – Oracle Internet of Things Platform: Java 8 connecting the world

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Webcast Agenda

1

2

3

4

5

Why Java matters in the IoT world

Programming for edge devices using IMLets

Overview on the new features of JMEE 8

Live demonstration

Wrap up and Q&A

Page 6: Partner Webcast – Oracle Internet of Things Platform: Java 8 connecting the world

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Why Java matters in the IoT world Introduction to Java ME 8 Embedded

Page 7: Partner Webcast – Oracle Internet of Things Platform: Java 8 connecting the world

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

The Embedded Ecosystem Today Diversity of hardware, need for ubiquitous software

Highly diverse and rapidly

changing use cases &

technologies

Value is in software, but

embedded software

development is difficult

Expensive to reinvent and

reintegrate must-have features

(management, security, etc.)

The value of data gaining

importance as a business

driver

Time-to-market and flexibility

are key to success

Hardware capabilities &

connectivity evolving rapidly

Page 8: Partner Webcast – Oracle Internet of Things Platform: Java 8 connecting the world

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Why Java? Business Value of Java on Embedded Devices

Extended Product Lifecycle

Enhanced Experience

Increased Market Reach/multiple UEs

Proven, Reliable, Secure Control over BOM and Roadmap

Strong Resource Availability

Shorter Time-to-Market

Reduced Support Costs

Reduced Risk

Grow Revenue

Increase Efficiency

New IoT Services

Reduce Cost

Page 9: Partner Webcast – Oracle Internet of Things Platform: Java 8 connecting the world

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Java Embedded Product Portfolio Devices spectrum

Java Card

SECURITY SMALL EMBEDDED MEDIUM EMBEDDED LARGE EMBEDDED

50KB-1MB

1MB-10MB

10MB-100MB

Footprint

Java SE Embedded Java Embedded Suite Oracle Event Processing Embedded

100MB+

Java ME Embedded

Java SE Embedded has been discussed in

details during a previous session:

http://bit.ly/1AzCppm

Page 10: Partner Webcast – Oracle Internet of Things Platform: Java 8 connecting the world

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Java ME 8: Key Themes and Features Next-Generation Software Platform for the Internet of Things

• Unifying Java Embedded ecosystem & unleashing innovation

• Dedicated and optimized embedded software platform

• Enable increased range of use cases and markets

Themes

Key Features

• Modern, flexible, standards-based software platform

• Value-add new & enhanced features for embedded and wireless

• Improved configurability and optimized footprint

• Target devices as low as at 128 KB RAM, 1 MB Flash/ROM (see note)

Target Markets

• Small to mid-embedded covering wide range of use cases/markets

• Intelligent edge devices, communication nodes, healthcare devices, smart sensors, smart

meters, general IoT/M2M solutions

Note: MEEP 8 Minimal Profile Set, optimized for single-function devices. Actual footprint will vary based on target device and use case.

Page 11: Partner Webcast – Oracle Internet of Things Platform: Java 8 connecting the world

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Java ME 8 Platform Overview

Java VM

Additional APIs (Examples)

Java ME Connected Limited Device Configuration (CLDC) 8 (JSR 360)

Additional

Optional APIs

On-Device I/O Access

Vertical Specific

APIs Location

Messaging Wireless

Communication

Web Services

Protocols and

Data Conversion

Sensors Additional

Optional JSRs

Security and

Management

Use Case Software

(e.g. smart pen) Use Case Software

(e.g. wireless module)

Use Case Software

(e.g. control unit)

Use Case Software

(e.g. smart meter)

Application Platform

Java ME Embedded Profile

(MEEP) 8 (JSR 361)

On-Device I/O Access

Device I/O

API SATSA

(JSR 177)

Security and Trust Services Generic Connection Framework

GCF 8

Page 12: Partner Webcast – Oracle Internet of Things Platform: Java 8 connecting the world

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Java ME Embedded 8 - Key Features Unique and optimized functionality for small embedded devices

• Multi-tasking VM to enable parallel operations

• Designed for robust and long-running operation

• Tuned for low footprint and efficiency

Highly Optimized VM

• Direct access to hardware from Java

• Versatile I/O and networking, including cellular

• Extensibility by OEM or Integrator

Embedded Extensions

• Remote application provisioning and management

• Application monitoring, start-up and recovery

• Flexible software authentication and authorization

Remote Operations

• Multiple RTOS as well as bare metal support

• Low memory and system requirements

• Portable and configurable for a wide range of target platforms

Low-footprint embedded targets

Page 13: Partner Webcast – Oracle Internet of Things Platform: Java 8 connecting the world

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Java ME Embedded 8 Device Profile Scaling from resource-constrained IoT devices and up

Aspect Description

System Architecture ARM architecture SOCs incl. ARM9, ARM11, Cortex-M, -R, and –A

Device Type Resource-constrained, headless, always-on

Operating System Simple embedded kernel or more capable OS/RTOS

Network IP-based wired (Ethernet) or wireless (cellular or other)

Peripheral Device I/O

Versatile access to peripheral device I/O • Serial, file, GPS, I2C, SPI, GPIO, ADC/DAC, AT Cmds, Pulse C., mem.-

map, more

Footprint

(Note: Build configurations can be used to select sets of features to match the requirements, subject to technical conditions)

Starting at: 128 KB RAM, 1 MB (see note) Scales up to 32 MB RAM *Note: MEEP 8 Minimal Profile set, optimized for single-function devices.

Actual footprint will vary based on target device and use case.

Page 14: Partner Webcast – Oracle Internet of Things Platform: Java 8 connecting the world

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Java ME vs Java SE Java ME specifics

• API is a subset of full Java SE

• No standard UI (Swing, AWT...)

• No JDBC, JPA, etc

Java SE

Java ME • Wireless gateways

• eHealth devices

• Remote sensors

• Micro controllers

8

8

Page 15: Partner Webcast – Oracle Internet of Things Platform: Java 8 connecting the world

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Tooling – Developing Efficiently

• Java ME 8 SDK

– Tools and emulation for rapid development of embedded Java ME applications

– Includes device emulator, application management interface, memory monitor, network monitor, and more

– Live code deployment and debugging on devices

• NetBeans Plug-ins

– Integration with Java ME SDK

– Full-featured, integrated development environment for embedded

Java ME SDK, IDEs, Reference Binaries

Free Tools

Page 16: Partner Webcast – Oracle Internet of Things Platform: Java 8 connecting the world

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Webcast Agenda

1

2

3

4

5

Why Java matters in the IoT world

Programming for edge devices using IMLets

Overview on the new features of JMEE 8

Live demonstration

Wrap up and Q&A

Page 17: Partner Webcast – Oracle Internet of Things Platform: Java 8 connecting the world

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Programming for edge devices Introduction to IMlets

Page 18: Partner Webcast – Oracle Internet of Things Platform: Java 8 connecting the world

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

What is an IMLet?

• A new name for a MIDLet (known from previous versions of JME)

• Basic runnable unit in Java ME

– Similar to applet or servlet

– Has its own lifecycle

– Needs to extend javax.microedition.midlet.MIDlet

• No „main” method!

• No „java(.exe)” executable to run the app!

Page 19: Partner Webcast – Oracle Internet of Things Platform: Java 8 connecting the world

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

MIDlet vs IMLet

• MIDlet refers to the old J2ME profile

– Mobile Information Device Profile (MIDP)

– Suitable mostly for feature phones

• IMlet refers to a newer IMP-NG profile – Information Module Profile – Next Generation (IMP-NG)

– JSR 228 implementation

– Designed with embedded devices in mind

• Java Micro Edition Embedded Profile (MEEP) – The latest and greatest JME profile (JSR 361)

– Designed for Internet of Things

Page 20: Partner Webcast – Oracle Internet of Things Platform: Java 8 connecting the world

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Getting back to IMLets...

IMLet lifecycle explained

1. AMS (Application Management System) instantiates the IMLet class after deployment

– IMLet instance is in the Paused state

2. AMS invokes the startApp method on the new instance

– IMLet instance moved to the Active state

3. AMS invokes the destroyApp method upon termination of the app

– IMLet instance moved to the Destroyed state

New

Paused

Active

Destroyed

new MyIMlet()...

startApp() {...}

destroyApp() {...}

Page 21: Partner Webcast – Oracle Internet of Things Platform: Java 8 connecting the world

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Webcast Agenda

1

2

3

4

5

Why Java matters in the IoT world

Programming for edge devices using IMLets

Overview on the new features of JMEE 8

Live demonstration

Wrap up and Q&A

Page 22: Partner Webcast – Oracle Internet of Things Platform: Java 8 connecting the world

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

What’s new in version 8? Overview on the new features of Java ME Embedded 8

Page 23: Partner Webcast – Oracle Internet of Things Platform: Java 8 connecting the world

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

New or updated APIs General Purpose Input/Output (GPIO) API

• Provides programmatic access to the binary IO pins or ports

• Pin:

– A single line with two binary states: low or high

– In output mode often used to turn on and off other peripherals (LEDs, motors, etc)

– In input mode listens for binary events from buttons, switches etc.

• Port:

– A group of pins treated as a logical information unit

– Allows reading and setting several pins at the same time

Page 24: Partner Webcast – Oracle Internet of Things Platform: Java 8 connecting the world

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Java ME Embedded 8 APIs overview General Purpose Input/Output (GPIO) API - example Opens a pin number 1

Sets the input mode

Reads the value

Opens a pin number 2

Sets the OUTPUT mode

Sets the value to HIGH

Page 25: Partner Webcast – Oracle Internet of Things Platform: Java 8 connecting the world

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Java ME Embedded 8 APIs overview General Purpose Input/Output (GPIO) API - example

Opens a port number 1

Sets the direction to output

Sets the value for all pins in port 1

Page 26: Partner Webcast – Oracle Internet of Things Platform: Java 8 connecting the world

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Java ME Embedded 8 APIs overview Inter-Integrated Circuit (I2C) • Two-wire, bidirectional, serial bus designed by Philips for attaching low-

speed peripherals to a motherboard/main device

• Uses master-slave architecture to connect more than two devices

Source: Wikipedia

Page 27: Partner Webcast – Oracle Internet of Things Platform: Java 8 connecting the world

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Java ME Embedded 8 APIs overview Inter-Integrated Circuit (I2C) • Uses two bidirectional open-drain lines

– Serial Data Line (SDA)

– Serial Clock (SCL)

– Pulled up with resistors

• Uses dedicated protocol

– Driven by clock line

– No fixed trasfer speed

– 8-bit data bytes followed by ACK

Source: Wikipedia

Page 28: Partner Webcast – Oracle Internet of Things Platform: Java 8 connecting the world

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Java ME Embedded 8 APIs overview Inter-Integrated Circuit (I2C) API - example

Creates a device configuration

Opens the I2C device

Reads a single byte

Page 29: Partner Webcast – Oracle Internet of Things Platform: Java 8 connecting the world

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Java ME Embedded 8 APIs overview Universal Asynchronous Receiver and Trasmitter (UART) • Serial communication protocol

• Communicating devices must agree on the common transmition speed

– Bits per second (e.g. 9600, 19200, 115200)

• Transmition does not have to be via wires

– Bluetooth

– Infra red

– Acoustic modem

Page 30: Partner Webcast – Oracle Internet of Things Platform: Java 8 connecting the world

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Java ME Embedded 8 APIs overview Universal Asynchronous Receiver and Trasmitter (UART) • Used four lines to transfer data

– Rx (receive data)

– Tx (trasmit data)

– Voltage (e.g. 3,5V)

– Ground

• Notice no clock line

– That’s why we need to agree on speed before transmition

Source: Java ME MOOC

Page 31: Partner Webcast – Oracle Internet of Things Platform: Java 8 connecting the world

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Java ME Embedded 8 APIs overview Universal Asynchronous Receiver and Trasmitter (UART) API - example Opens the UART device

Sets the transmition speed

Gets the input stream

Page 32: Partner Webcast – Oracle Internet of Things Platform: Java 8 connecting the world

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Java ME Embedded 8 APIs overview Record Management System (RMS) API

• There is a need to abstract the storage of data in embedded devices

– Some of the smallest devices does not have a file system!

• RMS allows storing information in an abstract, non-volatile container

• RMS is basically a very simple database

– Records are stored and retrieved by ID

– Record data is a simple array of bytes

– Thus only two columns (id, data)

• A lifecycle of the RMS is tied to the IMLet Suite

– Store is deleted when suite is removed from device!

Page 33: Partner Webcast – Oracle Internet of Things Platform: Java 8 connecting the world

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Java ME Embedded 8 APIs overview Record Management System (RMS) API - example

Opens the record store „myStore” (creates if

not exist)

Stores an array of bytes

Reads the record by its number (ID)

Page 34: Partner Webcast – Oracle Internet of Things Platform: Java 8 connecting the world

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Java ME Embedded 8 APIs overview Generic Connection Framework (GCF) API

• Designed to handle communication with the outside world

• Supports most of the common protocols and transports

– HTTP/S

– Modem

– Server Socket / Client Socket

– Stream

– UDP Datagram

– UDP Multicast

Page 35: Partner Webcast – Oracle Internet of Things Platform: Java 8 connecting the world

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Java ME Embedded 8 APIs overview Generic Connection Framework (GCF) API - example

Opens the server socket using port 1234

and any IP

Listens for incomming connection and returns

a socket

Opens the output stream Opens the input

stream

Page 36: Partner Webcast – Oracle Internet of Things Platform: Java 8 connecting the world

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Java ME Embedded 8 APIs overview Push Registry API

• In the embedded world memory and threads are highly valuable resources

– 512MB of the Raspberry Pi is huge compared to typical use cases in Java ME

• Traditional approach for server communication is not efficient

– ServerSocketConnection.acceptAndOpen blocks the thread and keeps the IMlet in the memory

• There is a better approach – Wake up the IMlet when the request comes in

– Run only for as long as necessary to handle the request

Page 37: Partner Webcast – Oracle Internet of Things Platform: Java 8 connecting the world

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Java ME Embedded 8 APIs overview Push Registry API

• First you need to register you IMLet to handle the push mechanism Opens project

properties

Choose Application Descriptor

Choose Push Registry tab

Click Add... Pick the IMLet class

Specify the sender IP (* means all senders)

Define the connection string

Page 38: Partner Webcast – Oracle Internet of Things Platform: Java 8 connecting the world

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Java ME Embedded 8 APIs overview Push Registry API

• Next add the necessary permission Open the API

Permission tab

Click Add...

Pick the PushRegistryPermission

Specify the connection type (here socket)

Define the push mode (static,

dynamic or alarm)

Page 39: Partner Webcast – Oracle Internet of Things Platform: Java 8 connecting the world

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Java ME Embedded 8 APIs overview Push Registry API - example

Checks if launched by push mechanism

If the connection type matches...

...then handle the request

IMPORTANT! Notify the AMS to put

the IMLet back to sleep

Page 40: Partner Webcast – Oracle Internet of Things Platform: Java 8 connecting the world

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Java ME Embedded 8 APIs overview Push Registry API - example

Registers connection dynamically

Registers alarm dynamically

Page 41: Partner Webcast – Oracle Internet of Things Platform: Java 8 connecting the world

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Java ME Embedded 8 APIs overview Software Management System - introduction

• Remote management and provisioning of the embedded apps are the key features to address IoT challanges

• Java ME Embedded provides complete API to handle installation, lifecycle and provisioning of the embedded applications (IMLets)

• This allows embedded systems designers to provide such features as:

– Automatic launching of specific IMLets based on given conditions

– Remote and automatic upgrades of the already installed applications

– Remote or local monitoring of the state of all running apps (tasks)

– Restarting an IMLet if it goes out the control

Page 42: Partner Webcast – Oracle Internet of Things Platform: Java 8 connecting the world

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Java ME Embedded 8 APIs overview Software Management System - introduction Key concepts in the Software Management API

• Suite

– A group of individual IMLets

– Can share some common resources like record stores

– Supported only on Multi-VM implementations

• Task

– Defines a generic executable item

– Provides an execution context of a running IMLet

Page 43: Partner Webcast – Oracle Internet of Things Platform: Java 8 connecting the world

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Java ME Embedded 8 APIs overview Software Management System - introduction Most common classes/interfaces in the Software Management API

• TaskManager (interface)

– Allows to start, stop and monitor tasks

• Task (class)

– Encapsulates the execution context

– Similar to the Thread or Process classes in JSE

• TaskListener (interface)

– Handles the notification of the status of a task

Page 44: Partner Webcast – Oracle Internet of Things Platform: Java 8 connecting the world

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Java ME Embedded 8 APIs overview Software Management System - introduction Most common classes/interfaces in the Software Management API (cont.)

• Suite (class)

– Representation of a single suite of IMLets

– Provides access to individual IMLets and its dependencies

• SuiteInstaller(class) – Allows installation of the whole suite

– Provides a status notification to all subscribed listeners

• SuiteManager (interface)

– Manages all suites available in the system

Page 45: Partner Webcast – Oracle Internet of Things Platform: Java 8 connecting the world

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Webcast Agenda

1

2

3

4

5

Why Java matters in the IoT world

Programming for edge devices using IMLets

Overview on the new features of JMEE 8

Live demonstration

Wrap up and Q&A

Page 46: Partner Webcast – Oracle Internet of Things Platform: Java 8 connecting the world

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Live Demonstration How to build and run an IMLet on the Raspberry Pi

Page 47: Partner Webcast – Oracle Internet of Things Platform: Java 8 connecting the world

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Webcast Agenda

1

2

3

4

5

Why Java matters in the IoT world

Programming for edge devices using IMLets

Overview on the new features of JMEE 8

Live demonstration

Wrap up and Q&A

Page 48: Partner Webcast – Oracle Internet of Things Platform: Java 8 connecting the world

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Some useful links

• Java ME Embedded 8 main site

– http://bit.ly/1txOLeW

• Java ME Embedded 8 API documentation

– http://bit.ly/1um7UmO

• Oracle Massive Open Online Course: Develop Java Embedded Applications Using a Raspberry Pi (MOOC)

– http://bit.ly/1qiYokj

Page 49: Partner Webcast – Oracle Internet of Things Platform: Java 8 connecting the world

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

Q&A

Lukasz Romaszewski Oracle ISV Migration Center Consultant ISV Migration Center blog: http://blogs.oracle.com/imc ISV Migration Center email: [email protected]

Page 50: Partner Webcast – Oracle Internet of Things Platform: Java 8 connecting the world

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

• Oracle.com Partner Hub oracle.com/partners/goto/hub-ecemea

• Migration Center Team Blog blogs.oracle.com/imc

feeds.feedburner.com/oracleIMC

• Partner Webcast Recordings youtube.com/OracleIMCteam

• Partner Webcast Presentations slideshare.net:/Oracle_IMC_team

[email protected]

Oracle Partner Hub ISV Migration Center • twitter.com/OracleIMC

• plus.google.com/+OracleIMC

• facebook.com/OracleIMC

• linkedin.com/groups/Oracle-Partner-Hub-Migration-Center-4535240

Page 51: Partner Webcast – Oracle Internet of Things Platform: Java 8 connecting the world

Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |