Skip to content

Latest commit

 

History

History
31 lines (19 loc) · 2.45 KB

File metadata and controls

31 lines (19 loc) · 2.45 KB

ESP32 WebSocket temperature monitor

This project implements a WebSocket server inside a WiFi network provided via ESP32 access point. With the appropriate (and very polite) messages, it will respond with the current temperature readings and turn on/off a green and a red LEDs every 2s (somewhat arbitrary time, but long enough for the DHT readings to work). It was done as a project for the Distributed & Real Time Systems class from Unisinos' Computer Engineering course, as an exercise of defining and implementing a tiny protocol. As per initial definition, the current protocol doesn't have an acknowledgement (ACK) and retry mechanism, making it very fragile. A good exercise would be implementing it accordingly.

Technologies used

Dependencies

There are a few external dependencies to be installed:

  • DHT-22: Open the Arduino IDE's Library Manager (Tools > Manage Libraries...) and install Adafruit Unified Sensor and DHT sensor library libraries
  • AsyncTCP and ESPAsyncWebServer: Download the libraries' ZIP files from Github (AsyncTCP, ESPAsyncWebServer), then add them through Arduino IDE (Sketch > Include Library > Add .ZIP Library...)

Connections diagram

circuit_diagram

Flowcharts

flowchart Flowchart made on the awesome Whimsical tool.

Credits

This project was a stitch from various tutorials I've found. For the ESP32 as a WebSocket server, I was backed up by this tutorial. For the Access Point, this tutorial made the trick. The temperature measurement I've found on this tutorial, and so I must give huge thanks to the Random Nerd Tutorials team.