Project

General

Profile

Actions

Action Item #508

closed

Add IoT messaging to PiBox protocol

Added by Hammel about 8 years ago. Updated about 8 years ago.

Status:
Closed
Priority:
Immediate
Assignee:
Category:
Sensors
Start date:
09 Mar 2016
Due date:
% Done:

100%

Estimated time:
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.

Actions #1

Updated by Hammel about 8 years 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.

Actions #2

Updated by Hammel about 8 years 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.

Actions #3

Updated by Hammel about 8 years 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.

Actions

Also available in: Atom PDF