Auto discovery esp32 IP connected to WiFi
Posted: Thu Dec 30, 2021 7:08 pm
I have issue with auto ip discovery for esp32 device connected to wifi.
i am not using mDNS as i am not able to use the service reliably on discovering the device in network. I guess there is some limitation on devices that could discover the esp mDNS and require some configuration on the client devices to able to discover the device.
i am also not using fix ip for esp32 as i did not have control on wifi network dns and gateway that the esp will be connecting.
the option i have is to store custom ip for user to insert in the esp before the wifi initialize and the device that want to discover will require the same ip to be able to connect. this approach require user to be familiar with network configuration which will require overhead on usability and complexity.
is there any way i could set the last device 3 STA digit ip without using a static ip. something like STAIP(AUTO,AUTO,AUTO,128)
or is the static configuration will only static the last 3 digit ip number and the rest to follow network router configuration? since network router will have specific gateway.
with the above capabilities at least i could fixed the last 3 digits ip with the other ip is from the router depending on gateway configuration. so client will also have the fix last 3 digit ip precoded and the rest is follow gateway ip so no configuration required from the user. the approach is to chop last 3 digits device ip with the fix ip set in esp. so that was the prconfigured esp sta ip.
of cause it will not work if the last 3 digit ip has conflict or the router has auto dhcp range. but that rare cases for dynamic ip allocated by the router and if this case happens mean the admin of the network can configure the router.
for now on dynamic ip configuration for wifi sta config. the esp will have random ip assigned by the router.
i hope there will be a solution or existing approach for this scenario and someone help to answer those 2 question. thank you for your time to read this queries and answer in advance.
thanks!
i am not using mDNS as i am not able to use the service reliably on discovering the device in network. I guess there is some limitation on devices that could discover the esp mDNS and require some configuration on the client devices to able to discover the device.
i am also not using fix ip for esp32 as i did not have control on wifi network dns and gateway that the esp will be connecting.
the option i have is to store custom ip for user to insert in the esp before the wifi initialize and the device that want to discover will require the same ip to be able to connect. this approach require user to be familiar with network configuration which will require overhead on usability and complexity.
is there any way i could set the last device 3 STA digit ip without using a static ip. something like STAIP(AUTO,AUTO,AUTO,128)
or is the static configuration will only static the last 3 digit ip number and the rest to follow network router configuration? since network router will have specific gateway.
with the above capabilities at least i could fixed the last 3 digits ip with the other ip is from the router depending on gateway configuration. so client will also have the fix last 3 digit ip precoded and the rest is follow gateway ip so no configuration required from the user. the approach is to chop last 3 digits device ip with the fix ip set in esp. so that was the prconfigured esp sta ip.
of cause it will not work if the last 3 digit ip has conflict or the router has auto dhcp range. but that rare cases for dynamic ip allocated by the router and if this case happens mean the admin of the network can configure the router.
for now on dynamic ip configuration for wifi sta config. the esp will have random ip assigned by the router.
i hope there will be a solution or existing approach for this scenario and someone help to answer those 2 question. thank you for your time to read this queries and answer in advance.
thanks!