For four decades, computing has followed a pattern of smaller, faster, cheaper, and more portable. This talk is an exploration of my belief that we are at an inflection point where computing begins to permeate everything. I talk about the platform I'm building for this, called Nitrogen, that aims to make building applications that securely span multiple things possible.
13. Internet of Things: Hard
Before starting on your actual project, please solve:
1. Authentication
2. Authorization
3. Device control
4. Cross device communication
5. Infrastructure to enable 3 + 4 in real time
6. Monitoring: How do I know if my device is thriving, sick, or dead?
7. …
18. time: Oct 1,19:30
type: switchCommand
command: on: 1.0
time: Oct 1, 7:05:00
type: switchCommand
command: on: 1.0
time: Oct 1, 8:35:00
type: switchCommand
command: on : 0.0
…..…
time: Oct 1, 7:05:01
type: switchState
on: 1.0
time: Oct 1, 8:35:01
type: switchState
on: 0.0
……..
…
19.
20. Light Device Code Walkthrough
Available on GitHub:
https://github.com/nitrogenjs/light
28. Getting Started
https://github.com/nitrogenjs/service The Nitrogen service project
https://github.com/nitrogenjs/light Light device code.
https://github.com/nitrogenjs/camera Camera device code.
http://timpark.io Lamp device walkthrough
https://api.nitrogen.io Hosted version of service
https://admin.nitrogen.io Admin tool for hosted service
I want to start my talk by talking about the direction computing is headedBut to put that in context we need to start with where we have been
In the beginning there was a computer. It filled a room and was something that only a government had access to.
Over a decade or so, computers got smaller and only took up half a room. They became accessible in price to universities and large corporations. 1000x faster than the first computer.Geniuses at the keyboard like Kernagan and Riche
Trajectory acceleratedFaster cheaper smallerThis put computing in the hands of ordinary people. Workers at first, then at home as well.
Computers got more mobile for two decades
Computers morphed into something that was always with usStill basically were devices with screens and some form of text entry.
Its possible that watches and glasses are the next step in this trajectory…Even smaller, even more omnipresent.
But my belief is that the really big thing that will happen in computing over the next 10 years will instead be the things already in our livesLights, furnances, door locks, door bells, and electrical sockets.Adding connectivity to these things is going to open whole new types of applications.
Kickstarter project “Good Night Lamp” is a great exampleThis is a great example of something simple that invisible computing has enabled.It is just a light, but with a twist.It is a light paired with another light over the internet.So instead of the switch turning on your light, it turns on the light at the other end of the internet.So you can give this to a loved one and let them know that you are thinking of them.It is a real world device made smarter with connectivity.
Open and very inexpensive computing is putting projects like this within the reach of all of us.Here is a Raspberry PI, which is a incredibly cheap and incredibly capable device.It can run a full OS, has USB ports, and also has GPIO pins for interfacing with hardware.
TesselRuns applications written in JavaScript directly.And while it can’t run a full OS, Has WiFi connectivityMuch lower power consumptionIts easy to hack something togetherHard to make it real
I previously worked on such a product at a startup called Nest Labs, which built a smart connected thermostat for the home.While its easy to use Johnny 5 and other packages to hack something together, when you go to do this for real, you face some hard problems.
In particular, you need to think about security and authorization.In many ways the real world devices in our lives are more precious to us than the information on our computers.Intruders having access to our heating system is a danger to our lives.These are subtly different problems than the ones we have previously solved.Devices can’t use a username and password to authenticate. They need to use a certificate or stored secret to authenticate.And you have to work through all of these items before you can get to your actual device and application
My day job is that I work with companies in the Microsoft Accelerators around the world.One aims to add smarts to everyday household items.
Efficiency of factory floors.Common infrastructure This lead me to start a project called Nitrogen
The goal is to provide this infrastructure so that you can focus on the application or device you are building.Built on node.js and in general leverages the increasing pervasiveness of JavaScript to execute anywhere.Apache 2 licensed so you can embed both the client and service in your own projects.
The best way to understand Nitrogen is to look at an exampleLet’s build an internet connected light like the Good Night Light.
At its core, Nitrogen is a messaging platforms between devices.A simple way to think it that it is “Twitter for Devices”Devices and applications in Nitrogen communicate with each over using messages.In our lamp scenario, we’ll use SwitchCommand messages to turn on the lamp.And the lamp will respond with SwitchStatus message to indicate that it received the command and give back its current state.
To demo this I connected an outlet to a Raspberry Pi last week.Simple electrical outlet controlled by a relay.The center blue pin above turns on when a digital 1 is applied to it and turns off the power otherwise.Raspberry PI has a set of IO pins called GPIO pins that can do this.Let’s walk through the Nitrogen code that makes that happen.
Let’s have a look at how we’d build this device using Nitrogen. This device is all available on GitHub.
Ok – so let’s demo this. I’m about 10000 kilometers from the real button I use to control the light -- so instead I’m going to show this with another item that comes with Nitrogen -- an admin tool. The admin tool helps you manage your fleet of devices.It’s an ember.js application.In fact, the admin app is just another JavaScript client of the Nitrogen service, just authenticated as a user instead of a device.As you can see the switch and the lamp (and a few other of my devices) have already connected with the service.The admin app is completely realtime.To prove to you that I’m doing this for real, I’ve also connected a camera device to Nitrogen at home as well.This is also a Raspberry Pi with a camera attached to it that faces the lamp that I’m going to control.Just like with the lamp, the camera exposes its capabilities to the service in terms of the commands that it can receive.The admin app parses these and displays the appropriate controls for devices so you can send messages to them directly.I’ll use that to take a snapshot so you all can see just how dark it is in California at this time.As you can see in the camera’s message stream below, it issued a cameraCommand and the camera responded with a snapshot.Next I’ll switch over to the Lamp.And I flip the switch…Likewise, the lamp respondsAnd if we go back to the camera and take another snapshot..It worked. We’ve successfully controlled a lamp and camera in California from Lisbon.
There are a couple of reasons that I chose this messaging approach.The first is that having a message stream with a common schema allows us to use it for other applications.For example, you could enable an application to follow your lamp’s message stream.It could use this to build up a model of how you typically use your lamp at night.And replicate it for security when you were on vacation.This is something I think is really powerful.The ability of applications to essentially remix these message streams of data into valuable context.The second is that many devices in our lives will not have the battery or connectivity to constantly be ready to send or receive.Messaging gives us nice semantics for handling those situations.
Ok, so in 0.1 and nearing 0.2, that is what Nitrogen currently enables. It enables devices to securely connect to the service and for applications to control them.I’d like to finish this talk by talking a bit about where I think the project should go in the future.
The first point is very important.Another reason I’m building Nitrogen is because I also couldn’t find a system that wasn’t centralized.LatencyPrivacy.
Instead, I think that the solution in this space needs to be decentralized.One where we get to decided what is shared with external services.In a lot of ways I want it to be like the way email used to be – decentrailzed.This is a hard problem. If anyone has experience building partial trust distributed systems like this I’d love to talk to you.
The current platform is well suited for wired devices.But there are many more smaller and more constrained devicesRun on batteries that need to last 2 years.Which rules out WiFiAnother reason for a messaging based approachConstrained and occasional network coverage.
Devices often live in remote locations or very inaccessible locations.And there are many of them.Here’s a global climate monitoring device in Antarctica. You can’t roll a truck here easily.Too many of them to have a manual process.I want to build the infrastructure in Nitrogen to manage both the system and application software.
So there is a lot of opportunity to help if you are interested in this problem set.Best way to get started with Nitrogen is to build something fun with it.Blog EntryHosted serviceTweet out my slide deck.And if you are interested in any way in these problems, I’d love to talk with you.
Thanks for listeningAnd I’m looking forward to talking with all of you.