Upload
oracle-isv-migration-center
View
221
Download
0
Embed Size (px)
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]
Citation preview
Stay Connected
BLOGS.ORACLE.COM/IMC
TWITTER.COM/ORACLEIMC
YOUTUBE.COM/ORACLEIMCTEAM
FACEBOOK.COM/ORACLEIMC
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
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
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
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Why Java matters in the IoT world Introduction to Java ME 8 Embedded
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
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
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
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.
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
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
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.
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
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
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
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Programming for edge devices Introduction to IMlets
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!
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
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() {...}
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
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
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
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
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
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
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
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
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
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
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
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!
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)
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
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
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
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
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)
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
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
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
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
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
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
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
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Live Demonstration How to build and run an IMLet on the Raspberry Pi
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
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
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]
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
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
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |