Generic application for an IOT device based on ESP32 controller
The purpose of this application is to provide a small framework to implement different IOT controller devices.
The application provided here run on Esspressif ESP32 module and the development environment is using ESP-IDF
It is built in Eclipse CDT 2022-09 with ESP-IDF plug-in, based on esp-idf-v4.4.3
The fwk itself is putting together several modules provided in esp-idf (there are plenty of them) and adapted them to my purpose.
All these modules are part of the esp32_common repository.
Beside the fwk you need to implement control logic for specific sensors, or actuators, or... you need to monitor and control.
To control the application you need a MQTT boroker (in my case Mosquitto)
The fwk connects to the broker and subcribes to predefined topics:
- [...]/ctrl -- any message recieved on this topic goes to cmds modules
- [...]/cmd -- any message received on this topic goes to the control logic
- [network name]/query -- used by external clients to identify which IOT devices are alive in the network
In response to a received message send a response by publishing the result on
- [...]/state - for messages received on [...]/cmd
- [network name]/response - for messages received on [network name]/query
- [...]/monitor topic is used by the control logic in case it has to publish unsolicited (URC) device events
[network name] is a generic name for IOT network hosting the devices
[...] is the name of each individual dvice. IT HAS TO BE UNIQUE in the network!