Witam
mam trzy moduly ESP - 2 nowe i 1 stary, na tym starym mam wgrany kod (do laczenia sie po TCP lub UDP i przesylania danych) i dziala jak nalezy - nawiazuje polaczenie i przesyla dane, natomiast na dwoch "nowych" modulach wgrywam ten sam kod i niestety, kompiluje sie i wgrywa natomiast nie nawiazuje polaczenia (dodam ze w kodzie nie zmieniam niczego!)
wgrywalem firmware z wykorzystaniem programu NODEMCU FLASH MASTER, bez skutku...
dodatkowo wrzuce kod:
#include <ESP8266WiFi.h>
#include <WiFiUdp.h>
IPAddress ip(192, 168, 4, 1);
const char* host = "192.168.4.1";
const uint16_t port = 80;
void setup()
{
Serial.begin(115200);
Serial.println();
WiFi.begin("ESP32", "123456789");
Serial.print("Connecting");
while (WiFi.status() != WL_CONNECTED)
{
delay(500);
Serial.print(".");
}
Serial.println();
Serial.print("Connected, IP address: ");
Serial.println(WiFi.localIP());
}
void loop() {
//Wydruk na serial monitor adresu i portu po ktorym sie łaczymy
Serial.print("connecting to ");
Serial.print(host);
Serial.print(':');
Serial.println(port);
// Use WiFiClient class to create TCP connections
WiFiClient client;
//w przypadku niedostepnosci serwera czekaj 3 sekundy
if (!client.connect(host, port)) {
Serial.println("connection failed");
Serial.println("wait 3 sec...");
delay(3000);
return;
}
// This will send the request to the server
client.println("hello from ESP8266");
Serial.println("Wyslalem po TCP: Hello from ESP8266");
//read back one line from server
Serial.print("Odpowiedz: ");
String line = client.readStringUntil('\r');
Serial.println(line);
Serial.println("closing connection");
client.stop();
Serial.println("wait 5 sec...");
delay(5000);
}
Dodam tylko ze te dwa nowe moduly sa identyczne, roznia sie jedynie sposobem grawerowania napisu na procku, parametry maja te same, dziala na oryginalnym Lolin, na klonie nie wysyla danych po UDP/TCP
Michal