first commit

This commit is contained in:
Jérôme Delacotte
2025-03-06 11:15:32 +01:00
commit 7b30d6e298
5276 changed files with 2108927 additions and 0 deletions

View File

@@ -0,0 +1,48 @@
#include <ESP8266WiFi.h>
IPAddress ip(192, 168, 1, 222);
IPAddress gateway(192, 168, 1, 1);
IPAddress subnet(255, 255, 255, 0);
IPAddress DNS(192, 168, 1, 1);
const char* ssid = "Livebox-37cc";
const char* password = "8A6060920A8A86896F770F2C47";
int sleepTime = 120;
void setup(){
Serial.begin(9600);
WiFi.config(ip, gateway, subnet, DNS);
delay(100);
WiFi.mode(WIFI_STA);
// WiFi.forceSleepWake();
// delay( 1 );
// WiFi.persistent( false );
WiFi.begin(ssid, password);
Serial.print("Connecting");
while (WiFi.status() != WL_CONNECTED) {
Serial.print(".");
delay(200);
}
while (WiFi.waitForConnectResult() != WL_CONNECTED) {
Serial.println();
Serial.println("Fail connecting");
delay(5000);
ESP.restart();
}
Serial.print(" OK ");
Serial.print("Module IP: ");
Serial.println(WiFi.localIP());
ESP.deepSleep(sleepTime * 1000000L);
delay(200);
}
void loop() {
// put your main code here, to run repeatedly:
}