This application connects to WiFi, then to the MQTT broker, introduces itself and starts sending sensor data on MQTT publish topic, and listening to commands on MQTT subscribe topic, according to DZ edge device MQTT protocol.
All configuration parameteres are selected using idf.py menuconfiig
.
Early access. "Release early, release often". Right now, this project provides functionality identical to hcc-esp8266, but on ESP-IDF as opposed to Arduino. More moving pieces, but more power early on. Bug reports are welcome.
- Install ESP-IDF Development Framework.
- Ensure that submodules are cloned:
git clone --recursive https://github.com/home-climate-control/hcc-esp32.git
- This application can be executed on any ESP32 board, the only required interfaces are GPIO and WiFi.
- For development, Adafruit HUZZAH32 is used, reason being - it features 1S LiPo battery connector and charger. Given the fact that the devices being developed will be most likey remote and wireless, this is a serious advantage. YMMV.
- 1-Wire sensors. The only one supported right now is DS18B20 (family 0x28), more to come (request support here if you want it earlier). Beware of counterfeits.
- Open the project configuration menu (
idf.py menuconfig
) - Configure Wi-Fi, MQTT and 1-Wire settings under "hss-esp32 Configuration" menu.
- When using Make build system, set
Default serial port
underSerial flasher config
.
Build the project and flash it to the board, then run monitor tool to view serial output:
idf.py -p PORT flash monitor
(To exit the serial monitor, type Ctrl-]
.)
The output is duplicated on the serial console and in MQTT output stream.
/hcc/edge {"entity_type":"sensor","device_id":"ESP32-246F28A7C53C","sources":["D90301A2792B0528","E40300A27970F728"]}
/hcc/sensor/D90301A2792B0528 {"entity_type":"sensor","name":"D90301A2792B0528","signature":"TD90301A2792B0528","signal":24.625,"device_id":"ESP32-246F28A7C53C"}
/hcc/sensor/E40300A27970F728 {"entity_type":"sensor","name":"E40300A27970F728","signature":"TE40300A27970F728","signal":26.1875,"device_id":"ESP32-246F28A7C53C"}
- You might want to explore the Home Climate Control project, for which these edge devices were intended in the first place.
- If all you want is a simple MQTT temperature sensor, then take a look at hcc-esp8266 - it has a lower entry threshold.