Most (all) sketches I seen rely on printing the IP Address to the serial monitor (e.g. Serial.println(WiFi.localIP());).
However, I ‘m trying to figure out how a user can know the IP Address to put into the browser without any connection to IDE. In other words, if I hand someone a camera they will be able to connect. My thoughts were to use mDNS and setup a name corresponding to IP Address but haven’t got that working yet (using Android).
Ideally what I would like is for the android user to access the ESP32 Hotspot, type in the browser something like http://myEsp and the webpage launches?
I’m open to any suggestions and any help is appreciated.
Hello Pat, you are exactly on the right path. For example you can use mDNS which would look something like: http://myesp.local There’s an example in the Arduino:
However, if your ESP is set as an Access Point, you can set the default IP address will always be: 192.168.4.1
Thanks. Your suggestions were a big help. Here’s my findings that I’m posting as it may be of value to others.
Using ESP as an Access Point (i.e. where the ESP publishes a hotspot) worked great but of course your device then has no internet access…so a great option for communicating between a device and esp but not so good if you want to access the ‘outside’ world.
mDNS worked perfectly but not on Android…apparently this is a known restriction.
So leaves me with two options….
1. have a small display to show the IP Address assigned to the ESP Server (not ideal)
2. Use a static IP Address.
I went with the static IP Address option for now and this worked fine.
My intention is that each user connects to the esp using their smartphone hotspot. I’m not a network guru but, in theory, if there are multiple devices with the same static IP Address but on their own hotspots then this should be fine(?).
Anyway, Rui, I hope that makes sense and thanks again.