Hallo liebe Fachleute,
ich bin 71 jaehriger Anfänger und dies ist mein erster post (ich bitte um Nachsicht). Ich versuche mit einem ESP 8266MOD (D1 mini) eine Verbindung zu meinem WIFI-Netz aufzubauen.
Ich verwende dafuer folgenden Code, erhalte aber statt der erwarteten Angabe der IP-Adresse im seriellen Monitor die Rueckmeldung, die ich unterhalb des Cods dokumentiert habe. (Mein WLan-Signal ist stark genug).
Hat jemd einen Tipp, wo der Fehler liegt?
Gruß
Werner
Mein Code (Quelle: Ein Anfängerleitfaden zum ESP8266)
#include <ESP8266WiFi.h> // Include the Wi-Fi library
const char* ssid = "Werner_Box"; // The SSID (name) of the Wi-Fi network you want to connect to
const char* password = "13041954"; // The password of the Wi-Fi network
void setup() {
Serial.begin(115200); // Start the Serial communication to send messages to the computer
delay(10);
Serial.println('\n');
WiFi.begin(ssid, password); // Connect to the network
Serial.print("Connecting to ");
Serial.print(ssid);
Serial.println(" ...");
int i = 0;
while (WiFi.status() != WL_CONNECTED) { // Wait for the Wi-Fi to connect
delay(1000);
Serial.print(++i);
Serial.print(' ');
}
Serial.println('\n');
Serial.println("Connection established!");
Serial.print("IP address:\t");
Serial.println(WiFi.localIP()); // Send the IP address of the ESP8266 to the computer
}
void loop() {}
Ausgabe im seriellen Monitor:
Executable segment sizes:
IROM : 236960 - code in flash (default or ICACHE_FLASH_ATTR)
IRAM : 26892 / 32768 - code in IRAM (ICACHE_RAM_ATTR, ISRs...)
DATA : 1260 ) - initialized variables (global, static) in RAM/HEAP
RODATA : 804 ) / 81920 - constants (global, static) in RAM/HEAP
BSS : 24968 ) - zeroed variables (global, static) in RAM/HEAP
Der Sketch verwendet 265916 Bytes (25%) des Programmspeicherplatzes. Das Maximum sind 1044464 Bytes.
Globale Variablen verwenden 27032 Bytes (32%) des dynamischen Speichers, 54888 Bytes für lokale Variablen verbleiben. Das Maximum sind 81920 Bytes.
esptool.py v2.8
Serial port COM3
Connecting....
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: d8:bf:c0:11:5b:36
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 270064 bytes to 199163...
Writing at 0x00000000... (7 %)
Writing at 0x00004000... (15 %)
Writing at 0x00008000... (23 %)
Writing at 0x0000c000... (30 %)
Writing at 0x00010000... (38 %)
Writing at 0x00014000... (46 %)
Writing at 0x00018000... (53 %)
Writing at 0x0001c000... (61 %)
Writing at 0x00020000... (69 %)
Writing at 0x00024000... (76 %)
Writing at 0x00028000... (84 %)
Writing at 0x0002c000... (92 %)
Writing at 0x00030000... (100 %)
Wrote 270064 bytes (199163 compressed) at 0x00000000 in 4.6 seconds (effective 473.6 kbit/s)...
Hash of data verified.
Leaving...
Hard resetting via RTS pin...