This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "Arduino.h" | |
#include <WiFi.h> | |
#include <HTTPClient.h> | |
#include <ArduinoJson.h> | |
////// Network //////// | |
const String wifiSsid = "YourWifi"; | |
const String wifiSecret = "YourWifiPassword"; | |
TimerHandle_t wifiReconnectTimer; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Example code: Detects a touch input which wakes up the esp32 from deepsleep. | |
Then connects to a WiFi and post the touch event via MQTT. | |
After finishing this the esp32 will go back to deppsleep. | |
This whole process takes around 800ms to finish. | |
author: @robertschnuell | |
https://interaktives.design |