2025-05-0400

This commit is contained in:
2025-06-04 19:51:46 +02:00
parent 3e5bfc98ad
commit e7c8f48118
2 changed files with 30 additions and 9 deletions

View File

@ -105,12 +105,19 @@ u_int16_t StartderAbdunklung = 20;
u_int16_t EndederAbdunklung = 7; u_int16_t EndederAbdunklung = 7;
// Wifi // Wifi
char ssid[] = "MagentaWLAN-RGDO"; // your network SSID (name) /* char ssid[] = "MagentaWLAN-RGDO"; // your network SSID (name)
char pass[] = "93329248424922704583"; // your network password char pass[] = "93329248424922704583"; // your network password
IPAddress ip( 192, 168, 127, 52); IPAddress ip( 192, 168, 127, 52);
IPAddress gateway( 192, 168, 127, 1 ); IPAddress gateway( 192, 168, 127, 1 );
IPAddress subnet( 255, 255, 255, 0 ); IPAddress subnet( 255, 255, 255, 0 );
IPAddress dns(192, 168, 127, 1); // DNS-Server IPAddress dns(192, 168, 127, 1); // DNS-Server */
char ssid[] = "Vodafone-3EAC"; // your network SSID (name)
char pass[] = "K7arbc4gGFC6tbY3"; // your network password
IPAddress ip( 192, 168, 0, 52);
IPAddress gateway( 192, 0, 127, 1 );
IPAddress subnet( 255, 255, 255, 0 );
IPAddress dns(192, 168, 0, 1); // DNS-Server
String hostname = "DISPLAY"; String hostname = "DISPLAY";
int status = WL_IDLE_STATUS; int status = WL_IDLE_STATUS;
const char* NTP_SERVER = "de.pool.ntp.org"; const char* NTP_SERVER = "de.pool.ntp.org";
@ -757,7 +764,7 @@ void setup() {
// See https://github.com/nayarsystems/posix_tz_db/blob/master/zones.csv for Timezone codes for your region // See https://github.com/nayarsystems/posix_tz_db/blob/master/zones.csv for Timezone codes for your region
setenv("TZ", TZ_INFO, 1); setenv("TZ", TZ_INFO, 1);
if (getNTPtime(10)) { // wait up to 10sec to sync if (getNTPtime(100)) { // wait up to 10sec to sync
} else { } else {
Serial.println("Time not set"); Serial.println("Time not set");
delay(5000); delay(5000);
@ -900,10 +907,10 @@ static void setup_wifi() {
//WiFi.forceSleepWake(); //WiFi.forceSleepWake();
delay( 1 ); delay( 1 );
WiFi.persistent( false ); /* WiFi.persistent( false );
WiFi.setHostname(hostname.c_str()); //define hostname WiFi.setHostname(hostname.c_str()); //define hostname
WiFi.mode( WIFI_STA ); WiFi.mode( WIFI_STA ); */
WiFi.config( ip, gateway, subnet, dns, dns ); //WiFi.config( ip, gateway, subnet, dns);
WiFi.begin(ssid, pass); WiFi.begin(ssid, pass);
@ -912,7 +919,7 @@ static void setup_wifi() {
Serial.print("."); Serial.print(".");
ErrCount ++; ErrCount ++;
if (ErrCount >= MaxErrCount){ if (ErrCount >= MaxErrCount){
delay(100); delay(500);
ESP.restart(); ESP.restart();
} }
} }
@ -921,6 +928,20 @@ static void setup_wifi() {
client.setCallback(callback); client.setCallback(callback);
Serial.print("IP address: \t"); Serial.print("IP address: \t");
Serial.println(WiFi.localIP()); Serial.println(WiFi.localIP());
/* Serial.begin(115200);
Serial.print("Connecting to: ");
Serial.println(ssid);
WiFi.begin(ssid, pass);
while(WiFi.status() != WL_CONNECTED){
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.println("WiFi connected");
Serial.print("IP-Address of ESP8266 module: ");
Serial.println(WiFi.localIP()); */
} }