Contenu connexe Similaire à Internet of Things (20) Internet of Things2. © Cumulocity GmbH 2013
We would like you to …
• Understand Machine-to-Machine (M2M) and Internet of Things (IoT)
in business environments.
• Learn about
– Java on M2M devices.
– Mobile M2M connectivity.
– Cloud services for M2M.
• Be inspired to invent!
3. © Cumulocity GmbH 2013
Agenda
Application
Mobile
network
What?
Why?
Why now?
2 4
5
Embedded Device
3
Demo
1
5. © Cumulocity GmbH 2013
Why do you connect coffee machines?
• Operational improvements.
– Optimized workforce (pre-kitting, spare parts, route optimization).
• Additional revenue.
– Machines filled according to customer demand.
– Timely repair of broken or unavailable machines.
– Reduced fraud.
• Additional services.
– Cashless payment and vouchers.
– Advertising on the machine.
– Re-sell data to food vendors.
6. © Cumulocity GmbH 2013
Agenda
Application
Mobile
network
What?
Why?
Why now?
2 4
5
Embedded Device
3
Demo
1
7. © Cumulocity GmbH 2013
Time
Bespoke HW solutions
+ HW device centric (customized)
+ large Enterprises centric
+ per device type offerings
Generic Software solutions
+ Software Products, incl. SaaS become mainstream
+ Enterprises but increasingly SME driven market
+ seldom used standards
+ first eco-systems evolving
The ‘Internet of Things’
+ Data monetization, incl. ‘Big Data’
+ More consumer driven market
+ Devices and Server decoupled
+ Easy Mashups
What is M2M and Internet of Things (IoT)?
TODAY ~2015
Millions of
M2M Devices
Billions of Sensors
100s of Million
of M2M Devices
M2M Internet of Things
8. © Cumulocity GmbH 2013
Why is M2M and IoT happening now?
Device Costs
Software
as a Service
Application
Communication Unit (Modem)
Communication
network
Processing Unit (MCU)
Communication
Costs
M2M
>50k€ once
>10€/month
300-500€
20€
Closed IT
Today
5-20€/month
>1€/month
50-100€
>8€
à Cloud
IoT
1-15€/month
??
20€
>2€TCO/month
for 2 years
Enterprise
Mindset
9. © Cumulocity GmbH 2013
Why to use M2M in a business?
#1 Business Process optimization
#2 Introducing new Business Model
#3 New Service Offering /
New Revenue Streams
Why
M2M?
10. © Cumulocity GmbH 2013
Why? #1 Business Process optimization
Examples: remote maintenance, logistical process improvements,
smart city use cases
Bring Assets online, connect IT with the real world
Enterprise IT
e.g. ERP
DevicesAssets
Middlewarelayer
e.g.CloudPlatform
Wide
Area
Network
Operations
11. © Cumulocity GmbH 2013
Why? #2 Introducing new Business Model
Examples:
cars, insurance (UBI), printing,
coffee machine, machines, …
DevicesAssets
Middlewarelayer
e.g.CloudPlatform
Wide
Area
Network
Operations
Billing,
CRM
Invoice
usage &
event based
pricing
12. © Cumulocity GmbH 2013
Why? #3 New Service Offering/Revenue Streams
DevicesSensors
Middlewarelayer
e.g.CloudPlatform
Wide
Area
Network
Data Monetization
Example:
• Telematics Traffic Data
• Voucher Redemption Data
New Services
Example:
• eCall
• Advertising billboard
13. © Cumulocity GmbH 2013
How are the billion devices connected?
Focus
120 Millions Connections
(Wide area fixed, MAN)
2,400 Millions Connections
(Bluetooth, ZigBee, RFID, etc)
820 Millions Connections
(2G, 3G, 4G, Satellite)
Short range Mobile Fixed
2G
3G
4G
M2M opportunity 2015: around 3.3 billion connections
Source: Machina, M2M Global Forecast & Analysis 2010-20, October 2011
14. © Cumulocity GmbH 2013
Agenda
Application
Mobile
network
What?
Why?
Why now?
2 4
5
Embedded Device
3
Demo
1
15. © Cumulocity GmbH 2013
How do you build connected assets?
What do you need?
• Asset to equip (room, car, machine, …).
• Sensors and controls (temperature, accelerometer, switch, …).
• Sensor network (cable, serial, ZigBee, WiFi, …).
• Embedded/local processing (microcontroller, embedded PC).
• (Mobile) internet connectivity (GPRS modem & SIM, DSL, …).
16. © Cumulocity GmbH 2013
Sensor network architecture
Example:
• Home automation sensors (temperature,
power, switches, …).
• Short range radio: Z-Wave/ITU, ZigBee/
IEEE, Enocean, …
• M2M gateway.
17. © Cumulocity GmbH 2013
Sensor network architecture
Example:
• ECG, blood sugar.
• Bluetooth.
• Mobile phone as gateway.
18. © Cumulocity GmbH 2013
Sensor network architecture
Examples:
• Pressure sensor.
• RS232 connection.
• M2M modem.
19. © Cumulocity GmbH 2013
Sensor network architecture
Example: Hobbyist kits
• Light sensor.
• GPIO.
• GBoard (Arduino with on-board modem) & shields,
Raspberry Pi & PiFace.
20. © Cumulocity GmbH 2013
Programming at sensor network level
• “Barebone” (e.g., Arduino, C/C++, assembly).
• Embedded OS (QNX, RTX).
• Java ME, Android.
• Standard OS plus Java SE Embedded (OSGi, Python, Lua, …).
• Convenient, portable and widely known environments like Jave ME or
SE run today on devices < €30.
• Microcontrollers become niche for hard real-time or extremely cost-
sensitive areas.
21. © Cumulocity GmbH 2013
Java Embedded variants
Java versions for embedded/headless devices:
• Java ME Embedded: CLDC, > 120 KB.
• Java ME Embedded Client: CDC, > 1 MB.
• Java SE Embedded: Java SE, > 32 MB.
22. © Cumulocity GmbH 2013
Java ME Embedded stack
• CLDC (“Connected Limited Device Configuration”).
– Barebone Java, selected java.lang, java.util and limited IO.
• IMP-NG (“Information Module Profile – Next Generation”).
– “MIDP – UI”.
– “IMlets” == Midlet.
• Optional APIs depending on device implementation.
23. © Cumulocity GmbH 2013
Useful optional Java ME APIs
• JSR120 (Wireless Messaging): SMS/MMS.
• JSR179 (Location): Coordinates and locations.
• JSR256 (Mobile Sensor): Generic sensor access.
• Oracle Device Access: GPIO, I2C, UART, AD/DA, AT commands, …
• Oracle Application Management Software: Install/remove IMlets.
24. © Cumulocity GmbH 2013
Java ME Embedded for the Raspberry Pi
Device:
• Raspberry Pi + SD card + USB power.
• Check jumpers (JP1 & JP2 = 0).
• Install Raspbian image (hard float), Java ME Embedded 3.3 EA.
• Edit permissions for development and run.
PC:
• IDE + ME Plugins + (Windows-only) SDK, discover SDK in IDE.
• Eclipse Manifest bug: IMP-NG-2.0 => IMP-NG, restart.
Develop …
25. © Cumulocity GmbH 2013
Java SE Embedded for the Raspberry Pi
Device:
• Add PiFace, activate SPI kernel module.
• Install Java SE Embedded 8 EA.
• Install pi4j (Java & WiringPi native libraries).
PC:
• Your standard installation on all OS.
Develop …
26. © Cumulocity GmbH 2013
ME vs SE
Benefits of Java ME Embedded:
• Small footprint.
• Design for embedded/remote development, decouple hardware and
software development (simulator).
• Device-neutral APIs (JCP or Oracle).
Benefits of Java SE Embedded:
• State-of-the-art language features.
• Huge user base of Java SE (tooling, libs).
27. © Cumulocity GmbH 2013
Outlook
• Closer convergence of Java ME Embedded and Java SE Embedded
with Java 8.
28. © Cumulocity GmbH 2013
Sending data to the cloud
• Modem controlled usually through AT commands over serial line.
• ~200 commands standardized in ETSI & 3GPP (ref. here).
• Usual dialog (e.g., Kontron M2MSSDK, followed by PPP):
ATZ
OK
AT+CPIN?
+CPIN:
SIM
PIN
AT+CPIN="<pin>"
OK
AT+CGDCONT=1,"IP","<apn>"
ATDT*99#
Reset modem to default parameters
Check if SIM is locked
(READY, SIM PUK, SIM PIN2, …)
Unlock SIM
(Cannot be unlocked multiple times)
Set APN to be used
Dialup to the network
29. © Cumulocity GmbH 2013
AT+CMGS="+4915155153908",145
Hi
JUG!
[Ctrl=z]
OK
Sending SMS
Or JSR205 (Wireless Messaging API):
MessageConnection
conn
=
(MessageConnection)
Connector.open("sms://+4915155153908");
TextMessage
msg
=
(TextMessage)conn.newMessage(MessageConnection.TEXT_MESSAGE);
msg.setPayloadText("Hi
JUG!");
conn.send(msg);
Send SMS (145 = MSISDN)
Text on the next line
End of text (Java = (char)26
30. © Cumulocity GmbH 2013
Shortcuts
Or proprietary extensions and convenience libraries, e.g., dialup from
J2ME on a Cinterion EGS5/5x:
new
com.cinterion.io.ATCommand(false).
send("AT^SJNET="gprs","<apn>","",""rn");
31. © Cumulocity GmbH 2013
Practicalities
• Most M2M SIMs have no PIN, most M2M APNs have no username or
password (because there’s no one to type it in).
• Use an M2M APN with your M2M SIM card.
32. © Cumulocity GmbH 2013
Practicalities with SMS
SMS could be used for sending data to devices. However,
• May be optional or restricted in M2M SIMs.
• Too expensive for regular communication.
• Security: Don’t send data to devices, just send them a wakeup.
Vodafone GDSP example:
• M2M SIMs have no MSISDN.
• WebServices API for sending SMS to device.
33. © Cumulocity GmbH 2013
From development to production
• Development and small numbers: Development boards.
– Multiple sensor network connectivity options.
– Good processing power, memory, …
– Larger, more expensive (~ 100-700 Euro).
• Production use: Custom production hardware.
– Only required sensor network option, processing, memory, …
– Housing, adaptation to environmental conditions (temperature,
outdoors/indoors).
– Size and cost optimization.
34. © Cumulocity GmbH 2013
Agenda
Application
Mobile
network
What?
Why?
Why now?
2 4
5
Embedded Device
3
Demo
1
35. © Cumulocity GmbH 2013
Connectivity
Device
Server Application
Embedded Software
Communication
network
How to do it over a mobile network?
Common Myths
Standards
36. © Cumulocity GmbH 2013
Why is M2M different from your personal phone?
Mobile Phone M2M
User Person Machine
Sale B2C, B2B B2B
Payment Pre-pay, Post-pay Diverse
Activation At point of sale Varied
Support User calls helpdesk Transparent self-help
ARPU 10-20 EUR >1 EUR
Operators provide a M2M specific
Service Portal!
!
37. © Cumulocity GmbH 2013
Device
Middleware Layer
Cloud Platform
Your Device Software
M2M Service Portal
Smart Agent
Communication
network
Your Device Software
How do typical mobile M2M Solutions look like?
38. © Cumulocity GmbH 2013
M2M Service Portal
Reduce your provisioning and support effort.
Based on our experience,
you might want to check for:
§ Are APIs is available?
§ Is mass subscription
provisioning efficient?
§ Are lifecycle events available?
§ How easily can problems be
identified to be on operator side?
40. © Cumulocity GmbH 2013
What else needs to be considered?
Other selections to make:
• SIM card
• IP Connectivity/VPN/IPSec
• Roaming / Countries
41. © Cumulocity GmbH 2013
Myths #1: The “thing” must be a server
IPSO Power Control
c’t 09/13, p.98
42. © Cumulocity GmbH 2013
Myths #1: The “thing” must be a server
Device is Server Device is Client
Security Very High Risk No open port => lower
Optimal for Actuators Sensors
Data sharing By device
(not in mobile!)
By server
Data Access
& Scaling
Difficult to
impossible
Easy and cheap
Addressing Static IP Dynamic & Private IP
Consequence Requires VPN Requires Device Push
43. © Cumulocity GmbH 2013
Myths #2: IoT requires IPv6
RFID und IPv6 als Wegbereiter
Die Grundlage dafür [vernetzte Geräte] hat unter anderem IPv6 geschaffen.
c’t 09/13
Our view
IPv6 neither needed nor really speeding up
projects. Assuming that devices are clients
(and not server)
44. © Cumulocity GmbH 2013
Myths #3: Long polling will not work
Long polling
(LP) counter
arguments
Reality Why?
LP drains
battery
Limited Check 2G/3G Idle
State
LP is expensive
to keep alive
Very Limited
And provides availability
2880 pings / month
(every 15 min)
LP is slow No, its faster No TCP connection
setup
Problem: How to control actuators if devices have private/dynamic IP addresses?
Answer: Long Polling, open TCP connection and keep it open using keep-alive ping.
Server sends control commands when these are available.
45. © Cumulocity GmbH 2013
Standards, here: device to server
The nice thing about standards is that you have so many to choose from.
Andrew Tanenbaum, Computer Networks, 2nd ed., p. 254
Layer ETSI IPSO/CoAP
(n/a ?)
M3DA MQTT
Payload Defined, XML Defined, Text Partially,
Binary
n/a
Style RESTful RESTful ? Messaging
Application
Layer
HTTP/SSL,
CoAP
HTTP/SSL,
CoAP
M3DA MQTT, SSL
optional
Transport
Layer
TCP UDP TCP, UDP,
HTTP
TCP
Internet
Layer
IP IP IP IP
46. © Cumulocity GmbH 2013
Agenda
Application
Mobile
network
What?
Why?
Why now?
2 4
5
Embedded Device
3
Demo
1
47. © Cumulocity GmbH 2013
Developing M2M applications today
Bespoke development from device to application.
• Custom hardware.
• Proprietary protocol.
• Own server-side and web application.
Main issues
• Cost, competence, complexity, risk: Building an M2M solution touches
about all aspects of IT.
• No scale, no ecosystem: Application only for device, device only for
the application.
48. © Cumulocity GmbH 2013
The case for a generic M2M cloud platform
• Most companies want to focus:
– Business processes and services (enterprises).
– Hardware and embedded software (device manufacturers).
– Web apps and server-side (application developers).
• A cloud platform helps companies
– to make M2M affordable
– to excel in their domain.
49. © Cumulocity GmbH 2013
Examples of generic M2M platforms
Device vendors
• Eurotech Everyware Device Cloud.
• Sierra Wireless AirVantage M2M Cloud.
• Etherios Device Cloud (was Digi iDigi).
Pure software vendors
• LogMeIn Xively (was Cosm, was Pachube).
• Axeda M2M Platform.
• ThingWorx.
• Cumulocity Conduct.
50. © Cumulocity GmbH 2013
Examples of generic M2M platforms
Full bundles: Deutsche Telekom M2M Developer Platform.
51. © Cumulocity GmbH 2013
What do you get?
Mileage varies, but typical functionality is:
• Agent concept for connecting device to server.
• Device management (SW/FW, configuration, faults, availability).
• Storage for sensor data.
• Rules resp. complex event processing.
• APIs for development.
• Hosting (some).
• Device independence (few!!).
Check what you need.
52. © Cumulocity GmbH 2013
Example: Cumulocity
• Cloud scaling.
• Full multi-tenancy.
• Mobile enabled.
• REST & HTTPS everywhere, open APIs.
• Assets vs devices.
• Decoupling of devices and applications, sensor library.
53. © Cumulocity GmbH 2013
Summary
• Java Embedded (ME/SE) is great for device development.
• Building M2M solutions will get simpler and simpler.
– Pluggable device platforms like Raspberry Pi and Arduino.
– Cheap connectivity.
– Transparent cloud software platforms.
– Bundles of all.
• Thousands of use cases haven’t been thought of yet: Get a kit and
invent!