Hi to all
I'm not able to connect to my esp32 through mDNS but it ok using the IP given in the serial monitor.
I like to be able to connect using my phone browser or my computer
Welcome to the forum
Please post a complete sketch that should allow you to use mDNS but fails
Please use code tags when you post it
thanks for answerig. actualy i succeeded to have it working on my android phone by installing "BonjourBrowser" Apk but not yet on my PC win 11
#include<WiFi.h>
#include<WiFiClient.h>
#include<WebServer.h>
#include<ESPmDNS.h>
#include"ESP32WebPage.h"
WebServer server(80);
const char *ssid = "*******";
const char *password = "*******";
void handleRoot(){
String s = MAIN_page;
//Send webpage to browser
server.send(200,"text/html",s);
}
void handleForm(){
String argument = server.arg("button");
Serial.println(argument);
server.sendHeader("Location","/");
server.send(302, "text/plain", "Update-- Press Back Button");
delay(500);
}
void setup() {
Serial.begin(115200);
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);
while(WiFi.status() != WL_CONNECTED){
Serial.print(".");
delay(500);
}
Serial.println("");
Serial.print("Connected to ");
Serial.println(ssid);
Serial.print("IP Address : ");
Serial.println(WiFi.localIP());
saisissez ou collez du code ici
if(MDNS.begin("esp32")){
Serial.println("mDNS responder started");
}
Serial.println("TCP server started");
server.on("/",handleRoot); //Which routine to handle at root location
server.on("/form",handleForm); //These request sent when click on button
server.begin(); //Start sever
// Add service to MDNS-SD
MDNS.addService("http", "tcp", 80);
}
void loop() {
server.handleClient();
}
I finally got it to work thanks. i had to install bonjour on my pc
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.