Toward an open Internet of Things
radar.oreilly.com
radar.oreilly.com
name: thermostat
task: control room temperature
icon: [base64]
functions:
- turn on
- turn off
- set temperature (temp:num)
With that information my cell phone can interact with all the things around it. If I click on the thermostat icon I get the info shown and three butons with the actions I can perform on it. If I want to control the temperature I just enter a number and done.If a TV is around, I can easily turn it on/off, switch channels, volume, etc.
No need for specialized apps, they're universal APIs every device can access, provided some level of security or trust.
Is that the IoT we want?
http://noflojs.org/documentation/protocol/#component
For IoT use the default WebSocket transport isn't desirable, of course. But maybe something like MQTT?
A subset of the protocol already works with serial-over-USB when talking to microcontrollers
The real problem with IoT isn't the standardization of the transfer medium, it's the security implications of having your things on an internet.
Yeah, IoT protocols are a warzone, hell, few companies/coders are even able to agree on general web API architectures (REST/RPC/SOAP - and everything in between. puke). Add MQTT, CoAP, XMPP or whatever other pet vendor protocol or semantic layer into the mix... total nightmare. What's left are a bunch of consumers hung out to dry because a these big old guard companies haven't learnt how to collaborate and deliver broad spectrum value to their customers.
A lot of hand-rolled integrations for many years to come! Whoever can alleviate that pain will likely end up dominating
A large part of the problem often overlooked by the tech community is that none of the existing web standards are useful for the Internet of Things. It needs a new set of standards designed for the purpose so that applications can support the operations necessary at the throughput and operation rates required by IoT.
For example, something that comes up a lot at the standards meetings is representation of data. Formats like JSON and XML were fine for the web, but when you have to continuously parse a billion records every second the implied computational cost of just parsing using most existing standard formats is extraordinary. It shifts the economics such that computational efficiency becomes totally worth the implementation cost. Unfortunately, there are not a lot of existing standards that reflect the tradeoffs you see with IoT implementations.
For ingesting such massive amounts of data, it seems a sensible serialization would have minimal divergence between the wire and memory representation, such as Cap'n Proto.
Handling composite types seems tricky too -- eg, for prefixing lengths to strings or lists, it appears the extra CPU time for variable-sized integers would be preferable to the I/O overhead of billions of wasted bytes that come with a fixed-size prefix. Assuming explicit begin/end delimiters aren't even an option here.
Fast wire encodings are almost universally TLV ("tag-length-value") style serializations. Delimiter scanning is inefficient and also means the parser has little ability to predict what will be coming over the wire so that it can optimize processing.
While older serializations tend to be byte oriented, newer formats use word-sized "frames" (even if not aligned) to enable nearly branchless, parallel processing of the bytes in the stream using bit-twiddling techniques or vector instructions.
The problem is inventing or maintaining a standard in this space is going to be a completely thankless task. We've seen things like Android where the theory of Intent interoperability is really good, but in practice it just isn't used that much, or is deliberately broken, such as with Facebook (in order to promote their SDK).
The other problem is that there is a lot of feeling that any standards are being created in the hope that a problem emerges, and it's not like we have any really compelling problems with which to guide the standards. The reality is 90% of the IoT fuss is cloud infrastructure providers trying to come up with a use for their systems, and anything which doesn't rely on them will be told it's not part of the IoT, and is just a traditional hardware effort.
EDIT: started fleshing this out on github a while back ( https://github.com/atomirex/chirp ), but never got round to uploading the actual implementations thanks to their terribly embarrassing state! This might persuade me to get round to resolving that.
There are enough existing formats/protocols/standards, let's work with the existing ones and continue to improve them.
This becomes nasty at the device configuration stage though, since you need to distribute/share keys somewhere. There simply are not protocols around that deal with buying a device from a store, taking it home and magically making it work, but that is the point it needs to get to. The industry seems to be moving towards "solving" that through embedding cellular modems in everything and getting the stuff to phone home.
The actual binary format is beside the point really, but it does need to be as close to self describing as possible.
There are currently a few such protocols in the works(some still in development, some are starting deployment),highly optimized for the IOT: sigfox, semtech's lora, and the weightless standard.
In general they are low bandwidth, long range protocols(from 1.5 kilometer in dense urban environment to tens of kilometers with direct line of site), mostly use unlicensed bands, use very little power(end user devices might last 5 years on a single battery), enable good latency, and are pretty cheap(around 1 euro per year, maybe less.).
> self describing protocols
It's hard to see that happening on the device side, but having the self-description added on the cloud/router would work.
PLUG: This is exactly the sort of thing that we are attempting to build at [AirDispatch](http://airdispatch.org). You should check it out and let me know what you think.
The problem then is the same as the internet of now: There is another layer on top of that which is specific to an application. I hope there is a battle for different standards and the best one wins.
With all this noise about "standards" though, it's important to remember how much we (computer people) take for granted. I, as well as the majority of people here, I'd guess, wouldn't consider building a new device that doesn't use TCP/UDP and IPv4/6. There'll be a battle on the layer-1/2 front (radios, electrical stuff) and messaging formats (OSI layer 5+: application, session, presentation), but let's not forget how far we've come.
participants should send data that obeys the specifications, but
they should be willing to accept data that doesn’t.
This is what I believe to be the next logical step in device interoperability -- the "un-API". Inferring API-call intention from the provided data. It will require more than one datapoint and a feedback loop, but an API only has to be categorized correctly once -- rather than every implementation being created manually or relying on custom independent library. Zapier has touched the tip of the iceberg on this.I am currently building a SaaS product to this end, please get in touch if this interests you.
In practice very few APIs are tolerant of unexpected fields, values, or protocols. Forget the protocol war that other commenters are expecting, our devices should interact regardless of protocol. Only then will producers be forced to compete on useful features.
Correct me if I was wrong.
By 'Inferring', did you mean that a generalized broker/translator/proxy could be built in between of unlimited APIs, like the intermediate representation of a compiler?
I think we have repeatedly seen that HW guys just can not be relied to write good enough software to be exposed on the internet.
Devices that can peer can just exchange OSC messages directly. Otherwise they might use some sort of proxying service (to arrange for OSC over TCP).
FWIW, we're also releasing an open reference design for hardware.
I'm also not so sure wether the robustness principle really helps. With HTML we had lots of problems because everybody parsed non-standard files differently.