ESP32 Web server problem

Dhananjay
Posts: 1
Joined: Wed Jun 24, 2020 6:58 am

ESP32 Web server problem

Postby Dhananjay » Wed Jun 24, 2020 9:01 am

I am new to ESP32 WROOM and trying to play with ESP32 WROOM thus I want to publish a website using ESP32 WROOM. I am using eclipse to develop code (espidf). And i am using examples provided by espidf. I have used MQTT server example, in that code compilation is done successfully and also i have uploaded the code into ESP32 WROOM but the problem is that i am getting the IP address of my own router only instead i want the ip address of ESP32 server where i can access the website. I have also tried an example of the HTTP server but the problem remains same so now i am stuck at this level. so please help me to get out of this, what i want is an example of either HTTP or MQTT server basic example like hello world web page which is hosted by ESP32 WROOM so that i could understand how to publish web page using ESP32 please note that i am using Eclipse IDE to develop codes so the solution should be relevant, Thanks in Advance.

PeterR
Posts: 621
Joined: Mon Jun 04, 2018 2:47 pm

Re: ESP32 Web server problem

Postby PeterR » Wed Jun 24, 2020 9:09 pm

but the problem is that i am getting the IP address of my own router only instead i want the ip address of ESP32 server where i can access the website
How are you getting this address?
This is a common problem - how do you know the address of your server?
The certain answer needs quite a lot of networking skills, I will give you some quick thoughts:
(1) Your router will probably always lease the same address to your board (a different address to each physical board). If you print you IP address then esp monitor will let you know.
(2) mDNS. This is easy in code but does require some network understanding & the Window's tools might be difficult to understand. Create an advert by which others may discover you. You may then resolve.
(3) Multicast. Broadcast your IP address. This is similar to (2) but perhaps easier to understand.
(4) Static IP. Tell your router to only allocate within a small range, say 100..200. Then tell your ESP to use a static IP e.g. 101. This might not work as some routers will not talk to your device if outside the allocated range & mask options may be limited.
(5) Tell your router which IP address to allocate to your device's MAC. Some routers will support this and will allow you to designate your board's MAC to an IP.
(6) Name server. Similar to (2) but probably too complicated ATM
& I also believe that IDF CAN should be fixed.

Who is online

Users browsing this forum: No registered users and 104 guests