A very simple straight forward home gate management:
- Detecting a gate bell button press (hooked to ESP digital pin).
- Play sound on my Home Sonos System (Server runnig on local network - (https://github.com/jishi/node-sonos-http-api).
- Listen on local http server for gate open request (ESP local server).
- Close a relay attached to my gate lock to open a gate (hooked to ESP digital pin).
- Log the bell and gate open events on local network simple logger (Simple http logger local server - https://github.com/divhide/node-log-server).
Trying to keep it simple and event driven coding style.
SDK used: Arduino + ESP32 toolchain
Libraries and functions Used:
- Wifi: Used to connect to local wifi (fixed IP), and use wifi events to detect connection and wifi connection lost events.
- HTTPClient: Used to send HTTP requests to Sonos service and Logger service
- ESPAsyncWebServer: Used to run local asynd server, using evetns to manage http request to open the gate (https://github.com/me-no-dev/ESPAsyncWebServer)
- digitalPinToInterrupt: used to manage a bell press as event (https://techtutorialsx.com/2017/09/30/esp32-arduino-external-interrupts/)
- NTP time sync: Used to log all evetns with time tag (Arduino Examples-ESP32-Time)