2025-05-0400
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
; PlatformIO Project Configuration File
|
||||
; PlatformIO Project Configuration File
|
||||
;
|
||||
; Build options: build flags, source filter
|
||||
; Upload options: custom upload port, speed and extra flags
|
||||
|
37
src/main.cpp
37
src/main.cpp
@ -105,12 +105,19 @@ u_int16_t StartderAbdunklung = 20;
|
||||
u_int16_t EndederAbdunklung = 7;
|
||||
|
||||
// Wifi
|
||||
char ssid[] = "MagentaWLAN-RGDO"; // your network SSID (name)
|
||||
/* char ssid[] = "MagentaWLAN-RGDO"; // your network SSID (name)
|
||||
char pass[] = "93329248424922704583"; // your network password
|
||||
IPAddress ip( 192, 168, 127, 52);
|
||||
IPAddress gateway( 192, 168, 127, 1 );
|
||||
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";
|
||||
int status = WL_IDLE_STATUS;
|
||||
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
|
||||
setenv("TZ", TZ_INFO, 1);
|
||||
|
||||
if (getNTPtime(10)) { // wait up to 10sec to sync
|
||||
if (getNTPtime(100)) { // wait up to 10sec to sync
|
||||
} else {
|
||||
Serial.println("Time not set");
|
||||
delay(5000);
|
||||
@ -898,12 +905,12 @@ static void setup_wifi() {
|
||||
Serial.print(ssid);
|
||||
Serial.print(" ");
|
||||
|
||||
// WiFi.forceSleepWake();
|
||||
//WiFi.forceSleepWake();
|
||||
delay( 1 );
|
||||
WiFi.persistent( false );
|
||||
/* WiFi.persistent( false );
|
||||
WiFi.setHostname(hostname.c_str()); //define hostname
|
||||
WiFi.mode( WIFI_STA );
|
||||
WiFi.config( ip, gateway, subnet, dns, dns );
|
||||
WiFi.mode( WIFI_STA ); */
|
||||
//WiFi.config( ip, gateway, subnet, dns);
|
||||
|
||||
WiFi.begin(ssid, pass);
|
||||
|
||||
@ -912,7 +919,7 @@ static void setup_wifi() {
|
||||
Serial.print(".");
|
||||
ErrCount ++;
|
||||
if (ErrCount >= MaxErrCount){
|
||||
delay(100);
|
||||
delay(500);
|
||||
ESP.restart();
|
||||
}
|
||||
}
|
||||
@ -921,6 +928,20 @@ static void setup_wifi() {
|
||||
client.setCallback(callback);
|
||||
Serial.print("IP address: \t");
|
||||
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()); */
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user