An esp-idf component for the Homie convention.
This is alpha-level software. Pull requests are welcome! Here is where we're at:
- Conforms to 2.0.1 of the Homie specification
- Publishes stats for wifi signal, freeheap, and uptime
- OTA firmware updates
- Support for extendible nodes/stats
I believe a minimalist library is a better fit for the ESP-IDF ecosystem rather than a framework. I don't plan to include a captive portal, nor an inversion of program control. The scope of this library will be to manage the MQTT connection using the Homie convention, handle OTA, and little else.
- ESP IDF 3.2.0
- https://github.com/tuanpmt/espmqtt or ESP IDF mqtt component
Clone this component to ESP-IDF project (as submodule):
git submodule add https://github.com/craftmetrics/esp32-homie.git components/esp32-homie
https://github.com/craftmetrics/esp32-homie-example
OTA works according to the following scheme:
- OTA must be enabled in the config passed to
homie_init
(it's off by default) - The initiating entity publishes a message to
./$implementation/ota/url
containing a URL to the new firmware - If an error is encountered, the device publishes a message to
./$implementation/ota/status
- If it is successful, the device reboots into the new firmware
When remote logging is enabled, all calls to ESP_LOG*() are published to ./log
.
To enable remote logging, send true
to ./$implementation/logging
. To disable, send false
.
Note that the default logger uses ANSI terminal colors in its log output, you may want to set CONFIG_LOG_COLORS=n
in sdkconfig
to disable this.