Controller developers news for 2.0.x
This post describes changes for controller (and plugin) developers for supporting 2.0.x.
The serial protocol is identical to 1.5.x. But a few more sensor and variable types has been added.
New Sensor Types
- S_INFO (36) - LCD text device / Simple information device on controller, uses V_TEXT
- S_GAS (37) - Gas meter, uses V_FLOW, V_VOLUME
- S_GPS (38) - GPS Sensor, uses V_POSITION
- S_WATER_QUALITY (39) - Water quality sensor, uses V_TEMP, V_PH, V_ORP, V_EC, V_STATUS
New Variable Types
- V_TEXT (47) - For S_INFO. Text message to display on LCD or controller device
- V_CUSTOM (48) - Custom messages used for controller/inter node specific commands, preferably using S_CUSTOM device type.
- V_POSITION (49) - GPS position and altitude. Payload: latitude;longitude;altitude(m). E.g. "55.722526;13.017972;18"
- V_IR_RECORD (50) - Record IR codes S_IR for playback
- V_PH (51), - For S_WATER_QUALITY, water PH
- V_ORP (52) - For S_WATER_QUALITY, water ORP : redox potential in mV
- V_EC (53) - For S_WATER_QUALITY, water electric conductivity μS/cm (microSiemens/cm)
- V_VAR (54) - For S_POWER, Reactive power: volt-ampere reactive (var)
- V_VA (55) - For S_POWER, Apparent power: volt-ampere (VA)
- V_POWER_FACTOR (56) - For S_POWER, Ratio of real power to apparent power: floating point value in the range [-1,..,1]
We had to drop the MQTT-gateway-server example as it was utterly un-maintained. Instead we introduce a new MQTT client gateway. It mimics the serial protocol, so it should be much easier to support once you handle the serial/ethernet gateway.
Example outgoing topic (with default prefix) :
Example topic for sending data to your sensor network (with default prefix) :
This also means a controller can (and should) answer the id-requests and time requests via the MQTT broker just like it is handled for the serial protocol today. Ack messages from sensors is also supported.
CrankyCoder last edited by
Will this be able to support OTA updates?
@Jason-Brunk OTA for nodes should work. It's already working since 1.5. Or do you ask for ota by mqtt? or ota in mqtt client gw? I had one esp8266 mqtt gw with arduinoOta working on it.
CrankyCoder last edited by
I guess I will have to try to dig up some documentation on the OTA. I am wanting to use mqtt client gateway, but the idea of being able to update my nodes OTA is very appealing.
yoram last edited by
Where can I report a bug?
(void)WiFi.begin(MY_ESP8266_SSID, MY_ESP8266_PASSWORD); #ifdef MY_IP_ADDRESS WiFi.config(_ethernetGatewayIP, _gatewayIp, _subnetIp); #endif
The order should be different, otherwise the gateway will always be initated with DHCP and not with static IP
The correct code would be
#ifdef MY_IP_ADDRESS WiFi.config(_ethernetGatewayIP, _gatewayIp, _subnetIp); #endif (void)WiFi.begin(MY_ESP8266_SSID, MY_ESP8266_PASSWORD);
Wifi lib config
Honk last edited by Honk
I've found some typos on the serial api page.
S_DIMMER 4 Dimmable device of some kind V_STATUS (on/off), V_DIMMER (dimmer level 0-100), V_WATT
V_DIMMER needs to be V_PERCENTAGE
S_HVAC 29 Thermostat/HVAC device V_HVAC_SETPOINT_HEAT, V_HVAC_SETPOINT_COLD, V_HVAC_FLOW_STATE, V_HVAC_FLOW_MODE, V_HVAC_SPEED
V_HVAC_SETPOINT_COLD needs to be V_HVAC_SETPOINT_COOL