10

I'm planning to do a lot of home automation. For that I will host a private isolated WiFi network to which all my devices will be connected to. The devices will be simple lights, RGB LED strips (smd5050 and ws2812b), thermostats, fans, window openers, window shade controllers and normal outlets. Also, IR-transmitters to simulate a remote in order to start TVs etc. And a 433MHz transmitter to simulate a remote that can toggle standard remote controlled outlets.

Now I'm wondering if there are any standards on what kind of interface these devices should expose to the WiFi network.

I could of course give every device a simple http route and then write applications that understand my interface, but it would be nice if I could implement a standard that would allow me to use apps and programs that have already been written and do understand the standard.

7

About IoT protocols, most commonly HTTP, CoAP and MQTT are used on communication.

HTTP and CoAP are suitable for REST type of client(s) to server communication and MQTT supports publishing and subscribing based multi user communication, where the origin can easily be from server to client, client to server and even client to client.

Answering the question:

Use REST over HTTP or CoAP for one to one communications or MQTT for multi point traffic use.

More details

After the comment below I admit my answer was quite partial, so I examined and found a little more:

Even the communications have this kind of mess of standards, if all calculated:

http://www.slideshare.net/butler-iot/butler-project-overview-13603599

Source: EU Butler Project - Communication Issues

Also postscapes.com has following list based on different aspects:

1  Infrastructure (ex: 6LowPAN, IPv4/IPv6, RPL)
2  Identification (ex: EPC, uCode, IPv6, URIs)
3  Comms / Transport (ex: Wifi, Bluetooth, LPWAN)
4  Discovery (ex: Physical Web, mDNS, DNS-SD)
5  Data Protocols (ex: MQTT, CoAP, AMQP, Websocket, Node)
6  Device Management (ex: TR-069, OMA-DM)
7  Semantic (ex: JSON-LD, Web Thing Model)
8  Multi-layer Frameworks (ex: Alljoyn, IoTivity, Weave, Homekit)

Like seen in the list of each examples, there are plenty of them and also more custom and proprietary ones surely are there.

You should open that link and read it through, it is mind blowing. I believe you may encounter in your project(s) many of these, at least if the sensors are of heavily packed form, ie. not only components in purest format, but parts of some already existing ecosystem. In those cases you maybe cannot negotiate the way you interface them, you just have to select between ecosystems.

The right issue now seems to be to find correct product set or set of sets (group of product sets) with identical or nearly matching protocol stacks over wifi, as you set the goal (keeping in mind infrared is solution out of this area and there are many other non internet wireless networking solutions, which you may still face).

Criteria would be to identify what all things you may want to do, and how many stacks you may want to learn on that way. By learning I mean you still want to play little with the gadgets and be aware how the certain protocol works under the hood.

  • 1
    "REST over http" is a little vague. Even with that in mind I could think of a hundred different ways to design the interface especially for devices that understand more than 'on' and 'off'. Ideally I would just provide the IP address and the type of device and the rest would be standardized. Does anything like that exist? – Forivin Oct 1 '17 at 14:48
7

My recommendation is MQTT. Versatile, lightweight and modular, it can even run on a ESP8266 (Hub and client). The MQTT protocol is available for many platforms from embedded, mobile devices and up to big fat OS's like MAC, Windows and Linux.

The protocol have a Publisher, Subscriber model for the communication. And a QoS so a Hub can remember if a subscriber have received a message from a publisher. So a sleeping device can get up to speed when it wakes up and looks for it messages.

I run my MQTT server on a small Raspberry Pi Zero W, it's like a credit card on the wall and for the logic I uses "Node Red" and I have started to look at OpenHAB for a more complicated solution.

I have also built my own Arduino/MQTT devices for my 12v DC devices and uses a ESP8266 based product for my 230v AC devices.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.