Upload
peter-hoddie
View
2.482
Download
0
Embed Size (px)
Citation preview
IoT is Something to Figure OutClient technologies
Peter Hoddie@phoddie
Founder, Kinoma Advisor to IoTracks and Douzen
IoT World 2016
Hallelujah the Hills A Band is Something to Figure Out
@JahHills
• Engineer and entrepreneur
• Focus on the objects we own (aka “the client”)
• Closest to the user, biggest opportunity for impact
• Hand crafted software optimized for size and speed
• Tools for developers and users
• Working for interoperability of data and devices
About me
@phoddie
What do the people want? The people don't know what they want.
@JahHills
@phoddie
Connected devices
• Every trade show presentation begins by defining it
• We don’t know
• The user doesn’t know
• Well, they do…. once you show them your product working
• They like the object
• They just want a different behavior……for their life, their home, their car.For them.
IoT is shrouded in mystery
@phoddie
I've seen this in a movie (but never without a soundtrack of folk music)
@JahHills
• We’ve seen the future
• Seen it in movies
• Binge watched it on TV
• Read about it in books
• We all have a sense of what connected future should be
• Just can’t explain it beyond lights automatically turning on when you arrive home
What IoT should do is obvious
@phoddie
• We expect it
• Our devices should be able to communicate with the cloud and each other
• That’s the premise of the “I” in IoT
• Great products that work well together
• Too many products consider interoperability an“interesting idea for a future update”
Interoperability
@phoddie
I'm a beacon for true conspiracy
@JahHills
@kinoma
IoT Interoperability – 2017
What's the point of all this noise? Who can say where it moves you and I?
@JahHills
Standards
@phoddie
Two kinds of standards• To underpin markets
where massive investment needed • DVD (manufacturing
factories) • 5G (cell towers) • Wi-Fi (chips) • MPEG compression
(silicon, software, toolchain)
• To formalize (and clean-up) existing practice • HTTP • JSON • JavaScript • HTML • MPEG-4 file format
@phoddie
Standards in IoT• Industry impulse is to create
a new standard • Define boundaries of
new product categories • Ensure interoperability
@phoddie
Too much. Too soon.• It isn’t obvious what we want to do in the big picture
• Trying to create “underpinning” standards • Not necessary for this market – investment level is
already unbelievably high • Leading to bad standards
• Too much functionality • Allow for too many possible futures • Too big and complex to be practical
@phoddie
Need time to figure out IoT• Experiments to discover what is possible • Experience to know what works in the real world • Too early for new standards
• Plenty of existing standards to build on
The dangers are double, they told me but I couldn't hear a single world
@JahHills
IoT’s diversity makes traditional software development impractical
• network connectivity • cloud services • sensors • power requirements • business rules • security
Different
@phoddie
Popular Frameworks Aren’t IoT Ready• Browser-based solutions: Too heavy for IoT devices
• Node.js: Server solution being shoehorned into the embedded space
• Qt: Designed for desktop, too much of a catch-all of features
• Lua: Less popular than assembly and COBOL, so difficult to find talent and no significant ecosystem
@phoddie
It is what it isbut it's not what we thought
@JahHills
Learning JavaScript used to mean you weren’t a serious software developer.
Today, not learning JavaScript means the same thing.
“
”James Governor, RedMonk
@phoddie
I was once blessed with a good idea
@JahHills
JavaScript as standard (to figure out IoT)
@phoddie
Nearly universal programming language
Web (Desktop)
Mobile (Apps and Web)
Server
Embedded / IoT
JavaScript for Embedded / IoT
@phoddie
• JSON built in – de facto data format of the web
• Exceptionally portable – OS independent • Helps eliminate memory leaks and
fragmentation so devices can run for a very long time – garbage collector
JavaScript 2015 (aka ES6) is first truly major enhancement to the language.
More than 400 individual changes including:
• Classes – familiar tool for inheritance
• Promises – clean, consistent asynchronous operation
• Modules – reusable code libraries
• ArrayBuffer – work with binary data
JavaScript 6th Edition – features for IoT
@phoddie
@phoddie
High level programming languages on embedded systems
Relatedly, writing software to control drones, vending machines, and dishwashers has become as easy as spinning up a website. Fast, efficient processors … are turning JavaScript into a popular embedded programming language—unthinkable less than a decade ago.
Secure foundation
@phoddie
• Sandbox • Core language provides no access to network, files, hardware, screen,
audio, etc. • Scripts can only see and do what the system designer chooses to
provide • Secure – many classes of security flaws in native code are non-existent
• Uninitialized memory • Stack overflow • Buffer overruns • Mal-formed data injection
There's angels in the source code if you know where to look for them
@JahHills
Adding ES6 to your product• Just a few steps to get the basics working • Get XS6 from GitHub • Build it with your product
• Entirely ANSI C – likely builds as-is • All host OS dependencies in three files xs6Host.c,
xs6Platform.h, and xs6Platform.6 • Update as needed for your host OS / RTOS
@phoddie
@kinoma
How small a system can run JavaScript?• 512 KB RAM • 200 MHz ARM Cortex M4 • Wi-Fi b/g • XS6 VM - most complete ES6 implementation anywhere • Open source – Apache license
I couldn't suspend my disbelief
@JahHills
• Two key constraints to address
• CPU performance
• Single core
• ARM Cortex – thumb instructions only
• 200 MHz or less is common
• Memory
• RAM is limited, Flash storage is much less of an issue
XS6 – JavaScript optimized for embedded
@phoddie
• No JIT
• Requires much more memory
• Significantly increases complexity of JavaScript engine
• Takes time to manage
• Performance critical functions can be coded in C directly
• Even faster
• No security risk as native code is installed “at the factory”
XS6 – JavaScript optimized for embedded
@phoddie
• Memory efficient strings
• JavaScript defines strings as Unicode 16, requires 2 bytes per character
• XS6 uses UTF-8, which uses 1 byte for most common characters
• Tuned garbage collector
• Small memory size allows use of simple garbage collector, fast, single threaded, and compact
XS6 – JavaScript optimized for embedded
@phoddie
• Precompiled byte code
• JavaScript can be compiled on desktop
• Eliminates parse and code generation on device
• Execute-in-place for byte code
• JavaScript byte code stored in flash storage can be executed directly
• Eliminates JavaScript code from RAM
XS6 – JavaScript optimized for embedded
@phoddie
• “Threaded” dispatch
• Byte code instructions are dispatched using a computed goto, fastest way to implement byte code interpreter
• JavaScript module unloading
• Extends ES6 to allow code modules loaded at runtime to be unloaded when no longer in use
XS6 – JavaScript optimized for embedded
@phoddie
Going deeper• JavaScript is also great for building the product
• App logic • Communication
• Network protocols • Hardware
@phoddie
Why use JavaScript to build your product?• Get it working faster • Iterate incredibly fast • Leverage code and techniques
developed by other JS developers • Hardware independent; easy to re-use
in your next generation • Re-use JavaScript code with Node.js cloud
service, mobile apps, and web pages • Much easier to find JavaScript programmers
to work on your project @phoddie
Wide engineering talent poolC/C++
Front end, full stack, and node.js developers
Embedded programmers
@phoddie
Don't believe them when they say it's true It's not remotely a matter of fact
@JahHills
Openness
Open toall apps.
Extensible OS.Open to
some apps
Computers
Not open at all
Phones Things
@phoddie
• People know the behaviors they want from their devices
• Many people can code in one way or another
• Let them
• That’s how the computer and mobile grew
• That’s where the ideas come from
• Traditional embedded development doesn’t scale
• JavaScript is proven for growing developer communities
Make scriptable things
@phoddie
• You can’t implement every feature for every market
• Really.
• Apple, Microsoft, Google, and Cisco can’t.
• You can’t either.
• Individual products seldom win
• Products that connect to a larger ecosystem have more leverage
Good business
@phoddie
• Gives customers a stake in the product
• Gives customers a sense of being in control of their products
• Allows products to address features and connect to cloud services the manufacturer chooses not to support
• Extends product life
• Long after manufacturer stops issuing updates, the market can continue to enhance
Good for customers
@phoddie
• Open source is used to build closed devices
• Doesn’t give the customer the ability to change the behavior of their objects
• Doesn’t give ecosystem the ability to enhance the object
• Doesn’t ensure interoperability in any way
Open source isn’t enough
@phoddie
She speaks her private thoughtsdirectly into microphones
@JahHills
• One word: JavaScript
• The flexibility to change the behavior of the objects in our world
• The foundation to discover the potential of IoT
• The only practical way to achieve the interoperability we dream about
How we figure out IoT
@phoddie
• Kinoma – selected slides and images
• Hallelujah the Hills – intriguing quotes
• Playground Global – room to play
• IoTracks and Param Singh – invitation to speak
Acknowledgements
@phoddie
Fin
@phoddie