Skip to content

Code IoTraffic

elRaulito edited this page Nov 18, 2020 · 3 revisions

Flowchart

At the startup the ESP32 will start its own wifi, anyone with the password can connects to it and set the parameters using a webapp as dashboard. When the Traffic light is activated from the dashboard the esp32 will connect to the wifi and start communicating with Keepy, reading the data that are on the tangle. ESP32 is a 2 core micro-controller, therefore it is possible to execute two tasks in parallel like controlling a traffic light and reading data from the tangle.

Flowchart

Libraries

Libraries used in this project are:

  • connect.h With the functions to connect as AP or STA
  • fetch.h With the functions to send REST requests
  • server.h With the endpoints of the offline server of the dashboard
  • tasks.h With the functions of the tasks, the traffic light control and the function that fetches information from the tangle

Clone this wiki locally