Action Item #508
Add IoT messaging to PiBox protocol
Added by Hammel about 7 years ago.
Updated about 7 years ago.
The protocol spec needs to be extended to support requesting data from piboxd and sending data to piboxd. This includes
- device type
- device features
- 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.
- % 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:
- Device registers with piboxd
- piboxd asks for config data (in JSON) and stores it
- iotapp asks for config data from piboxd
- iotapp returns updated json config data to piboxd
- 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.
- 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.
Also available in: Atom