Mais conteúdo relacionado Semelhante a IoT Deep Dive - Be an IoT Developer for an Hour (20) Mais de Taisuke Yamada (20) IoT Deep Dive - Be an IoT Developer for an Hour2. TECH SUMMIT 2016
IoT Deep Dive
〜Be an IoT developer for a hour〜
Taisuke "Tai" Yamada, Advanced Solution Services
Please download the PDF in prior: http://tiny.cc/iot-2016
3. © AKAMAI – TECH WEEK 2016
Call for Volunteers
・ This session contains a LIVE DEMO part which
needs attendee participation.
・ Volunteer will receive a set of ESP8266 IoT
module to work on (and take it home).
・ There are only 15 modules, so please share your
screen with your neighbors during the session!
Also, please download the PDF → http://tiny.cc/iot-2016
4. © AKAMAI – TECH WEEK 2016
So, who am I?
・ Enterprise Architect in APJ A2S Team
・ Provides advanced consulting for both
Akamaized and non-Akamaized part of
customer system.
・ Previously a software developer designing
high performance distributed storage and
bootstrap system for a cloud platform.
5. © AKAMAI – TECH WEEK 2016
So, who am I?
・ Enterprise Architect in APJ A2S Team
・ Provides advanced consulting for both
Akamaized and non-Akamaized part of
customer system.
・ Previously a software developer designing
high performance distributed storage and
bootstrap system for a cloud platform.
DISCLAIMER
I'm not in an IoT devteam of Akamai.
It's rather I'm doing this session so I can get in touch
with the team, and exchange the idea for upcoming
customers.
6. © AKAMAI – TECH WEEK 2016
Today's Agenda
1. Quick Overview of IoT
2. Walkthrough of DIY IoT Setup
3. Live Demonstration
4. Hands-on and discussion (if time permits)
7. © AKAMAI – TECH WEEK 2016
Internet of Things: What is it?
Home
Automation
8. © AKAMAI – TECH WEEK 2016
Home
Automation
Connected Cars
Internet of Things: What is it?
9. © AKAMAI – TECH WEEK 2016
Home
Automation
Connected Cars
Sensor Network
Internet of Things: What is it?
10. © AKAMAI – TECH WEEK 2016
Grow revenue opportunities with fast, personalized
web experiences and manage complexity from peak
demand, mobile devices and data collection.
Major aspects of IoT
・Connected – on-line whenever needed
・Sensors/controllers embedded in real-world,
open environment
・Vast number of nodes, vast amount of data
Imagine what can be done by embedding computer intelligence into
our society, everywhere!
11. © AKAMAI – TECH WEEK 2016
Grow revenue opportunities with fast, personalized
web experiences and manage complexity from peak
demand, mobile devices and data collection.
Why is it important?
12. © AKAMAI – TECH WEEK 2016
Grow revenue opportunities with fast, personalized
web experiences and manage complexity from peak
demand, mobile devices and data collection.
Why is it important?
We are HERE
NOW
13. © AKAMAI – TECH WEEK 2016
Grow revenue opportunities with fast, personalized
web experiences and manage complexity from peak
demand, mobile devices and data collection.
Why is it important?
We WANT to cover
these ALSO!
14. © AKAMAI – TECH WEEK 2016
What we do in this session
15. © AKAMAI – TECH WEEK 2016
Be an IoT developer!
Feel the EXCITEMENT of IoT!
What we do in this session
16. © AKAMAI – TECH WEEK 2016
AND
Feel the PAIN of IoT developer L
What we do in this session
17. © AKAMAI – TECH WEEK 2016
Two aspects of IoT
EXCITEMENT
and
PAIN
18. © AKAMAI – TECH WEEK 2016
Grow revenue opportunities with fast, personalized
web experiences and manage complexity from peak
demand, mobile devices and data collection.
Internet of Things: Why is it painful?
"Connected – on-line whenever needed"
→ Remember the recent DDoS attacks?
KrebsOnSecurity, OVH, Dyn, ...
→ Mirai botnet controlling hundred of thousands of
insecure IoT devices.
→ As a vendor, you MUST secure/update the device
continuously, long after the product release L
19. © AKAMAI – TECH WEEK 2016
Grow revenue opportunities with fast, personalized
web experiences and manage complexity from peak
demand, mobile devices and data collection.
Internet of Things: Why is it painful?
"Sensors/controllers embedded in real-world,
open environment"
→ You can't control where they get deployed
around the world.
→ You can't control how they are operated – never
expect a human operation!
→ But you MUST support them nevertheless L
20. © AKAMAI – TECH WEEK 2016
Grow revenue opportunities with fast, personalized
web experiences and manage complexity from peak
demand, mobile devices and data collection.
Internet of Things: Why is it painful?
"Vast number of nodes, vast amount of data"
→ 25 BILLION nodes in 2020
→ Each node generating 1Kbps dataflow turns into a
25 * 10^9 * 10^3 = 25Tbps traffic!
(Our record up to now is 7.6Tbps @ EURO 2016)
→ If controlling a device takes 100ms, it'll take
25 * 10^9 * 10^-1 = 79years to manage these!
21. © AKAMAI – TECH WEEK 2016
Let's feel the touch of it in the field...
EXCITEMENT
and
PAIN
22. © AKAMAI – TECH WEEK 2016
Grow revenue opportunities with fast, personalized
web experiences and manage complexity from peak
demand, mobile devices and data collection.
The Demo/Workshop
You will be developing^H^H^H^H
participating a LIVE DEMO of an
activity monitor IoT system.
Through the demo, you will
experience following areas of an IoT:
・Data extraction and collection
・Data analysis
・Application development
・Upgradable system design
23. © AKAMAI – TECH WEEK 2016
Grow revenue opportunities with fast, personalized
web experiences and manage complexity from peak
demand, mobile devices and data collection.
The Setup
http://hackaday.com/2015/03/19/measuring-heart-rate-with-a-piezo/
24. © AKAMAI – TECH WEEK 2016
Grow revenue opportunities with fast, personalized
web experiences and manage complexity from peak
demand, mobile devices and data collection.
The Data Flow
+
+
+
+
Cloud Service
Big Data comes in...
...and Social Analysis comes out.
25. © AKAMAI – TECH WEEK 2016
Grow revenue opportunities with fast, personalized
web experiences and manage complexity from peak
demand, mobile devices and data collection.
Actual Components
+
+
+
+
Cloud Service
Big Data comes in...
...and Social Analysis comes out.
IFTTT
GoogleDocs
Custom UI
HTTP
WiFI
26. © AKAMAI – TECH WEEK 2016
Grow revenue opportunities with fast, personalized
web experiences and manage complexity from peak
demand, mobile devices and data collection.
Quick Overview on Technologies
• vs WiFi
Zigbee, BlueTooth/BLE has low power consumption.
LTE(4G/5G) has advantage in coverage.
LPWAs are emerging with lower power and wide coverage.
• vs HTTP
MQTT is emerging with "good enough" messaging.
CoAP is also emerging with HTTP-on-UDP features.
Many other protocols are also proposed.
27. © AKAMAI – TECH WEEK 2016
Grow revenue opportunities with fast, personalized
web experiences and manage complexity from peak
demand, mobile devices and data collection.
Quick Overview on Technologies
• vs IFTTT+GoogleDocs
AWS IoT Platform, Microsoft Azure IoT Suite, Google, ...
Primary battlefield for "Big Data Storage & Analysis"
players.
• Others (just as a note on ongoing effort)
- ARM mbed Cloud, offering both SDK and the
platform for IoT service and development
- Eclipse IoT, offering an open middleware for IoT service.
- AllSeen Alliance (former AllJoyn and Open Connect),
working to standardize a IoT framework.
28. © AKAMAI – TECH WEEK 2016
Grow revenue opportunities with fast, personalized
web experiences and manage complexity from peak
demand, mobile devices and data collection.
The Demo - How you can help
1. Take the serial console of the module.
(Ask Sunil or Dhruv if you need support)
2. Interrupt the app
3. Customize it to turn off the "demo mode" and actually
supply your name and generate some activity.
4. Restart the app (don't power reset, just call a function)
29. © AKAMAI – TECH WEEK 2016
Grow revenue opportunities with fast, personalized
web experiences and manage complexity from peak
demand, mobile devices and data collection.
Commands (1/2)
$ kermit
C-Kermit> set line /dev/ttyUSB0
C-Kermit> set speed 115200
C-Kermit> set flow-control none
C-Kermit> set carrier-watch off
C-Kermit> connect
...
connected with DEMOWIFI, channel 6...Starting the app...
Waiting for WiFi connection...
report: sent
report: sent
report: sent
^C ← interrupt the running app
Type in as shown
in orange.
30. © AKAMAI – TECH WEEK 2016
Grow revenue opportunities with fast, personalized
web experiences and manage complexity from peak
demand, mobile devices and data collection.
Commands (2/2)
^C ← interruption will get you into a micropython shell
Type "help()" for more information.
>>> app.username = 'tai'
>>> app.testmode = False
>>> app.autostart()
report: skipped
report: skipped
...Play with the sensor to generate some activity...
report: sent ← "sent" indicates success!
...
<CTRL- + c> ← key sequence to return to kermit prompt
C-Kermit> exit
$
31. © AKAMAI – TECH WEEK 2016
Grow revenue opportunities with fast, personalized
web experiences and manage complexity from peak
demand, mobile devices and data collection.LIVE DEMO!
32. © AKAMAI – TECH WEEK 2016
Grow revenue opportunities with fast, personalized
web experiences and manage complexity from peak
demand, mobile devices and data collection.
Just in case the demo failed...
What We Should See
33. © AKAMAI – TECH WEEK 2016
Grow revenue opportunities with fast, personalized
web experiences and manage complexity from peak
demand, mobile devices and data collection.
Analyze by Charts and Graphs
34. © AKAMAI – TECH WEEK 2016
Grow revenue opportunities with fast, personalized
web experiences and manage complexity from peak
demand, mobile devices and data collection.
Which session is the most EXCITING?
Visual Even More
35. © AKAMAI – TECH WEEK 2016
Grow revenue opportunities with fast, personalized
web experiences and manage complexity from peak
demand, mobile devices and data collection.
Take-Away
• Monitoring a single person is only a on-line
activity monitor.
• Monitoring tens of thousand of people gives
you insight into the society you live in!
IoT = Social Monitoring
36. © AKAMAI – TECH WEEK 2016
Grow revenue opportunities with fast, personalized
web experiences and manage complexity from peak
demand, mobile devices and data collection.Feeling the PAIN
37. © AKAMAI – TECH WEEK 2016
Grow revenue opportunities with fast, personalized
web experiences and manage complexity from peak
demand, mobile devices and data collection.
Feeling the PAIN
COMPLEXITY
38. © AKAMAI – TECH WEEK 2016
Grow revenue opportunities with fast, personalized
web experiences and manage complexity from peak
demand, mobile devices and data collection.
Complexity in embedded application
• Embedded development is not really good at
"continuous release" model.
(historically/culturally, apps were "set in stone")
• Both social/business aspects and HW/SW limitation
exists.
• Many things we take for granted in PC-level
development often don't exist.
39. © AKAMAI – TECH WEEK 2016
Grow revenue opportunities with fast, personalized
web experiences and manage complexity from peak
demand, mobile devices and data collection.
Example: How to support an "upgrade"?
Boot Loader Base System
Application
User Data
Primary target
of upgrade
Is not usually a target,
but depends on design
Important, but
out of scope
40. © AKAMAI – TECH WEEK 2016
Grow revenue opportunities with fast, personalized
web experiences and manage complexity from peak
demand, mobile devices and data collection.
Difficulty of upgrading the "lower layer"
• Application
Fairly safe to upgrade as long as the base system
itself is connected and stable. Many IoT "solution"
only touches this part.
• Base System
Hardness begins here. Requires careful coodination of ROM
configuration and bootloader design. Also involves development
toolchain setup.
• Boot Loader (on-chip and off-chip)
Usually not a target of upgrade, but could play an important
part in IoT if multi-stage bootstrap design is employed.
41. © AKAMAI – TECH WEEK 2016
Grow revenue opportunities with fast, personalized
web experiences and manage complexity from peak
demand, mobile devices and data collection.
Software Stack for this DEMO
ROM functions (on-chip)
RBoot
(Boot Loader) MicroPython (System)
User Data (Flash, RTC)
MicroPython Apps
42. © AKAMAI – TECH WEEK 2016
Grow revenue opportunities with fast, personalized
web experiences and manage complexity from peak
demand, mobile devices and data collection.
(Relatively) Easy Part: Application
>>> dl('http://my.app.server/myapp.py')
>>> ls()
['boot.py', 'myapp.py']
>>> import myapp
>>> ...run whatever provided by "myapp" module...
As long as MicroPython platform itself is
running stably, you can download and upgrade
apps as many time as you like!
43. © AKAMAI – TECH WEEK 2016
Grow revenue opportunities with fast, personalized
web experiences and manage complexity from peak
demand, mobile devices and data collection.
SOTA (Software Over-the-Air) Design
ROM #3
ROM #2
ROM #1
ROM #0
Basically, the idea is to split
the flash memory region,
and load firmware to upgrade
to each region.
Flash memory
44. © AKAMAI – TECH WEEK 2016
Grow revenue opportunities with fast, personalized
web experiences and manage complexity from peak
demand, mobile devices and data collection.
SOTA (Software Over-the-Air) by Example
ROM #3
ROM #2
ROM #1
ROM #0
Flash memory
RBoot
(Boot Loader)
During bootup, rboot maps
specified ROM region to
processor memory map
45. © AKAMAI – TECH WEEK 2016
Grow revenue opportunities with fast, personalized
web experiences and manage complexity from peak
demand, mobile devices and data collection.
SOTA (Software Over-the-Air) by Example
ROM #3
ROM #2
ROM #1
ROM #0
4MBSPI Flash
ESP8266
processor
memory
map
1MB Flash ROM
mapped region
0x00000000
0x40200000
0x40300000
0xFFFFFFFF
1MB
1MB
1MB
1MB
46. © AKAMAI – TECH WEEK 2016
Grow revenue opportunities with fast, personalized
web experiences and manage complexity from peak
demand, mobile devices and data collection.
SOTA (Software Over-the-Air) by Example
ROM #3
ROM #2
ROM #1
ROM #0
2MBSPI Flash
ESP8266
processor
memory
map
1MB Flash ROM
mapped region
0x00000000
0x40200000
0x40300000
0xFFFFFFFF
512KB
512KB
512KB
512KB
47. © AKAMAI – TECH WEEK 2016
Grow revenue opportunities with fast, personalized
web experiences and manage complexity from peak
demand, mobile devices and data collection.
SOTA (Software Over-the-Air) by Example
ROM #3
ROM #2
ROM #1
ROM #0
2MBSPI Flash
ESP8266
processor
memory
map
ROM#3
0x00000000
0x40200000
0x40300000
0xFFFFFFFF
512KB
512KB
512KB
512KB
ROM#2
0x40280000
Now, ROM#2 and ROM#3 has different
memory layout during execution, so
needs different toolchain setup for
development.
48. © AKAMAI – TECH WEEK 2016
Grow revenue opportunities with fast, personalized
web experiences and manage complexity from peak
demand, mobile devices and data collection.
SOTA (Software Over-the-Air) by Example
ROM #3
ROM #2
ROM #1
ROM #0
2MBSPI Flash
ESP8266
processor
memory
map
ROM#3
0x00000000
0x40200000
0x40300000
0xFFFFFFFF
512KB
512KB
512KB
512KB
ROM#2
0x40280000
...meaning, ROM image for #0/#2
MUST NOT be flashed to ROM #1/#3.
Every little difference builds up into
complexity.
49. © AKAMAI – TECH WEEK 2016
Grow revenue opportunities with fast, personalized
web experiences and manage complexity from peak
demand, mobile devices and data collection.
Other Design Points (feasible, but complex)
• How to recover from "bad" firmware?
With unmanaged IoT, how do you rollback?
• How do you know the firmware is "good"?
With valid checksum? After it got a reachable IP address?
You will actually need app-level information, meaning that
you now have interactions between bootloader, system and
application to consider.
• Should you manage each device separately?
What if you are asked to deploy "branched version" firmware
for some specific customer 3years later?
50. © AKAMAI – TECH WEEK 2016
Grow revenue opportunities with fast, personalized
web experiences and manage complexity from peak
demand, mobile devices and data collection.
IoT Developer Frustrations
• They have to manage all these complexity.
• IoT has posed a new challenge:
1. In order to obtain various information in real world,
large scale deployment is needed.
2. In order to handle continuous improvements, frequent
release (= upgrade) is needed.
3. These must be accomplished under unmanaged and
unmanned operation.
"Rock-solidness" is a key factor
51. © AKAMAI – TECH WEEK 2016
Grow revenue opportunities with fast, personalized
web experiences and manage complexity from peak
demand, mobile devices and data collection.
Takeaway
• IoT developers are facing so many problems.
• In addition to traditional embedded development
complexities, IoT has brought in totally new issues, mainly
in management and scalability area.
• While big data is the "hot" side of the IoT industry, they
can only enjoy it after all these issues are solved.
• People only buy from you when they believe you
understand them. So, let's discuss how we can help them!
52. © AKAMAI – TECH WEEK 2016
Grow revenue opportunities with fast, personalized
web experiences and manage complexity from peak
demand, mobile devices and data collection.
Thank you, and enjoy the
IoT development!
53. © AKAMAI – TECH WEEK 2016
Grow revenue opportunities with fast, personalized
web experiences and manage complexity from peak
demand, mobile devices and data collection.
NOTE
Some features in this slide are not (yet)
publically available as these enchancements
were done just for this TechSummit demo.
MicroPython feature to handle RBoot, SOTA
upgrade, and associated WiFi AP info are
major examples of such features.
Backup Slides
54. © AKAMAI – TECH WEEK 2016
Grow revenue opportunities with fast, personalized
web experiences and manage complexity from peak
demand, mobile devices and data collection.
Backup Slide: DEMO firmware cheat sheet
function functionality
>>> ls() List upgradable micropython app/module files.
>>> dl(<URL>) Download micropython app/module from the URL.
>>> cat(<file>) Show content of a file.
>>> mv(<old>,<new>) Rename a file.
>>> rm(<file>) Remove a file.
>>> get(<URL>) Send a GET to the URL. Response is discarded.
>>> ifup(<SSID>, <KEY>) Associate to a WiFi AP.
>>> ifdown() Shuts down a WiFi connection.
>>> ifconfig() Show current IP configuration (read-only)
>>> whoami() Show MAC address of its own.
>>> whereami() Show BSSID (MAC address) of associated WiFi AP.
For common information, consult https://docs.micropython.org/
55. © AKAMAI – TECH WEEK 2016
Grow revenue opportunities with fast, personalized
web experiences and manage complexity from peak
demand, mobile devices and data collection.
Backup Slide: RBoot setup sample (1/2)
>>> import rboot
>>> # By default, std rom boots from ROM#0 region, located
>>> # at address 8192 (0x2000) on Flash Memory.
>>> rboot.boot_config()
{0: 8192, 'rom-gpio': 0, 1: 1056768, 'rom-std': 0, 2: 2105344, 3:
3153920, 'mode': 0, 'roms': 4}
>>> # Reconfigure it to use ROM#2 region
>>> rboot.boot_config(std=2)
{0: 8192, 'rom-gpio': 0, 1: 1056768, 'rom-std': 2, 2: 2105344, 3:
3153920, 'mode': 0, 'roms': 4}
56. © AKAMAI – TECH WEEK 2016
Grow revenue opportunities with fast, personalized
web experiences and manage complexity from peak
demand, mobile devices and data collection.
Backup Slide: RBoot setup sample (2/2)
>>> import rboot
>>> # Shows that last (current) ROM used to boot was ROM#0
>>> rboot.boot_mode()
{'last_rom': 0, 'temp_rom': 0, 'next_mode': 0, 'last_mode': 0}
>>> # Reconfigure to use ROM#3 temporary just for next boot
>>> rboot.boot_mode(2, 3)
{'last_rom': 0, 'temp_rom': 3, 'next_mode': 2, 'last_mode': 0}
57. © AKAMAI – TECH WEEK 2016
Grow revenue opportunities with fast, personalized
web experiences and manage complexity from peak
demand, mobile devices and data collection.
Backup Slide: SOTA upgrade sample
>>> import sota, rboot
>>> sota.upgrade('http://dl.lab.test/fw.bin', rom=3)
>>> rboot.boot_mode(next_mode=2, temp_rom=3)
>>> import sota, rboot
>>> sota.upgrade('http://dl.lab.test/fw.bin', rom=3)
>>> rboot.boot_config(std=3)
OR