In my code, I use my ESP32 as a server to receive HTTP request from a client server.
What I'm trying to do : I want to change the listening port of my ESP32 server. But when I change this port, nothing work anymore...
Of course I have entered the port forwarding in my router.
Would you have an idea ?
This the function member of my class :
Code: Select all
bool EspComPI::checkOrderFromPI(){
WiFiClient client = _wifiServer.available();
if (client) {
Serial.println("Order from RPI");
while (client.connected()) {
//Serial.println("Client connecté");
while (client.available()>0) {
//Serial.println("Client envoie");
this->order_pi = client.read();
client.write(this->order_pi);
//Serial.print("Mess serveur RPI :");Serial.println(this->order_pi);
}
delay(10);
}
client.stop();
//Serial.println("Client disconnected");
return true;
}
return false;
}
Code: Select all
WiFiServer _wifiServer;