Action Item #508

Add IoT messaging to PiBox protocol

Added by Hammel over 1 year ago. Updated over 1 year ago.

Status:ClosedStart date:09 Mar 2016
Priority:ImmediateDue date:
Assignee:Hammel% Done:

100%

Category:Sensors
Target version:001 - Proof of concept
Severity:01 - Critical

Description

The protocol spec needs to be extended to support requesting data from piboxd and sending data to piboxd. This includes
  1. device type
  2. device features
  3. device states

There are probably others. It's not clear if the protocol should send lightweight messages and let the endpoints decipher or if the message should be self-defining. The latter seems better, using JSON underneath (the parson library recently added to piboxd). The problem is that the device itself may not be able to use the library easily. There may be some json libraries for the ESP8266. I'll have to check on that.

This is required to support the iotapp display and control via piboxd.

Associated revisions

Revision 090a5f3d
Added by Hammel over 1 year ago

RM #508: Completed support for IoT messaging between devices and piboxd and between piboxd and apps. Updated unit tests script and cleaned it up a little.

History

#1 Updated by Hammel over 1 year ago

  • % Done changed from 0 to 10

Looks like there are JSON APIs in the SDK: http://esp8266.ru/download/esp8266-doc/ESP8266_IoT_SDK_Programming%20Guide_v0.9.1.pdf. It's not clear how to call them from the Arduino environment.

There is also this library: https://github.com/bblanchon/ArduinoJson

The way this should work would be:
  1. Device registers with piboxd
  2. piboxd asks for config data (in JSON) and stores it
  3. iotapp asks for config data from piboxd
  4. iotapp returns updated json config data to piboxd
  5. piboxd forwards json data to device

The format of the JSON data will determine what a field is: numeric, text, etc. That will define how iotapp will display it.

Future support for graphing time-based data will required a thread in iotapp to retrieve data in the background. It will not be piboxd's responsibility to handle time based data.

#2 Updated by Hammel over 1 year ago

That library didn't work. But this one compiles fine:
https://github.com/interactive-matter/aJson

So I'm testing that one with IoT code.

#3 Updated by Hammel over 1 year ago

  • Status changed from New to Closed
  • % Done changed from 10 to 100

The protocol design is updated on the wiki.

The protocol is implemented in piboxd and tested with the unit test script (tests/server.sh). It appears to be working fine.

Cod is tested, committed and pushed.

Closing issue.

Also available in: Atom PDF