Skip to content

Instantly share code, notes, and snippets.

String processor2(const String& var)
{
//index2.h
String url;
if (!LittleFS.begin())
{
Serial.println("LittleFS failed to mount !");
Complete Project Details: https:/RandomNerdTutorials.com/solved-reconnect-esp32-to-wifi/
Errors produced:
C:\Users\1234\Documents\Santos_WiFi_Events\Santos_WiFi_Events.ino\Santos_WiFi_Events.ino.ino: In function 'void WiFiStationDisconnected(arduino_event_id_t, arduino_event_info_t)':
C:\Users\1234\Documents\Santos_WiFi_Events\Santos_WiFi_Events.ino\Santos_WiFi_Events.ino.ino:30:23: error: 'union arduino_event_info_t' has no member named 'disconnected'; did you mean 'eth_connected'?
Serial.println(info.disconnected.reason);
^~~~~~~~~~~~
eth_connected
C:\Users\1234\Documents\Santos_WiFi_Events\Santos_WiFi_Events.ino\Santos_WiFi_Events.ino.ino: In function 'void setup()':
//Modification of ESP32, core 2.0.4 Wifi, WifiClientEvents.ino library example; same result as tutorial:
//https://raw.githubusercontent.com/RuiSantosdotme/Random-Nerd-Tutorials/master/Projects/ESP32/ESP32_Auto_Reconnect.ino
#include <WiFi.h>
const char* ssid = "Your WiFi name";
const char* password = "Your WiFi password";
void WiFiEvent(WiFiEvent_t event)
/*
* This sketch shows the WiFi event usage
* Based on ESP32 Core 2.0.4, WiFi library example for WiFiClientEvents.
* Logs five WIFI events Webserver start, Brownout, Watchdog, WIFI Connect, and WiFi Disconnect.
* Modified by William Lucid 07/27/2022 @ 08:00 EDT
*/
/*
* WiFi Events
@Tech500
Tech500 / WIFI-Log--WifiClientEvent.ino
Last active October 13, 2022 12:21
WifiClientEvent based library example; for logging to LittleFS, four WIFI events.
/*
* This sketch shows the WiFi event usage
* Based on ESP32 Core 2.0.4, WiFi library example for WiFiClientEvents.
* Logs five WIFI events Watchdog events, Webserver starts, Brownout, WIFI Connect, and Disconnect.
* Modified by William Lucid 07/27/2022 @ 08:00 EDT
*/
/*
* WiFi Events
/*
Adafruit Seesaw library: "multiencoder.ino" example; expanded to use Sparkfun Alphanumeric I²C display.
Modified by William Lucid
"TP Sept4a_4results.ino" sketch filename --a work-in-progress
*/
#include <Wire.h>
#include "Adafruit_seesaw.h"
// NTP_System_Time.ino
//schufti --of ESP8266.com Forum provided source for NTP time.
//Developer of code not given
#include <WiFi.h>
#include <WiFiUdp.h>
#include <sys/time.h>
#include <time.h>
Google Sheets Script:
Based on this article:
https://iotdesignpro.com/articles/esp32-data-logging-to-google-sheets-with-google-scripts
var sheet_id = "SHEET_ID_REMOVED";
var sheet_name = "Weather1";
function doGet(e){
var ss = SpreadsheetApp.openById(sheet_id);
//Written entirely on OpenAI using ChatGPT
//See 1st_ChatGPT_Webserver.ino --after debugging and refinement
//by William Lucid 1/21/2023
#include <WiFi.h>
#include <ESPAsyncWebServer.h>
#include "BME280.h"
#include "EnvironmentalCalculations.h"
// Replace with your network credentials
//After debugging; 1st ChatGPT Webserver and refinements:
//by William Lucid
#include <WiFi.h>
#include <ESPAsyncWebServer.h>
#include "EnvironmentCalculations.h"
#include "BME280I2C.h"
#include <NTPClient.h>
#include <Wire.h>