Frome the primary side (router, homeassistant,…) to the repeater, seems ok(on picture, upper request).
From the secoundary side (other side of NAT) to the esp device seems also ok (on the picture the secend request - I change with the notebook to the “secoundary side wlan” for the secound request)
It really doesn’t matter because mDNS ≠ DNS. The later could be used to ping a hostname - or you ping the IP directly like @Yves_IF did. In anyway it doesn’t help at all for this particular issue @nickrout
It does prove that the device is reachable over the network. Then the next step is to work out why your particular service/or application is not responding as you would expect.
Just to add a solution that worked for me in order to put a router between HA and my ESP. Here is the config of the ESPHome that is behind the router:
wifi:
ssid: xxxx
password: yyyyy
fast_connect: true
use_address: 192.168.0.144 #this is the WAN IP of the router.
manual_ip:
static_ip: 192.168.4.144
gateway: 192.168.4.1
subnet: 255.255.255.0
On the router, you need to configure port forwarding for 6053 and 8266 ports.
When integrating the ESPHome device in HA, I use the WAN IP of the router.
Normal steps on setting up the AP settings and the STA settings
I set up a static ip for the ESP32 router in my home router - in my case I set it to 192.168.0.202
On the ESP32 router page (192.168.4.1) go to “Portmap configuration” and set up 2 portmaps:
One for port 6053 to (in my case) 192.168.4.202 (the .202 does not have to be the same but it does
help mapping the .0.202 on the main vlan to the .4.292 on the .4 vlan
One for port 8266 to (in my case) 192.168.4.202
In the ESP device (that is sitting behind the ESP32 router) use the settings as above. In my case this would be:
wifi:
ssid: xxxx #SSID of the ESP32 router
password: yyyy #pw of the SSID of the ESP32 router
fast_connect: true
use_address: 192.168.0.202 #this is the WAN IP of the ESP32 router on the main vlan.
manual_ip:
# Set this to the IP of the ESP device that is being connected
static_ip: 192.168.4.202
# Set this to the IP address of the router. Often ends with .1
gateway: 192.168.4.1
# The subnet of the network. 255.255.255.0 works for most home networks.
subnet: 255.255.255.0
If the ESP32 device is present in the ESPHome integration in HA then delete the device and re-add the device (“+Add Device” button in the bottom right hand corner) and use 192.168.0.202 as the IP of the device to be added. This should now show as available in the ESPHome integration with data for the sensors
This set up finally worked for me, the ESP32 device is visible. Thank for the advice in the thread
Glad it worked for you. Was trying to remember all the details as I did this long time ago and since then it was just the update to the ESPHome version that I needed to do.
As I wrote above I use this method to connct to ESP behind router for 3 years now.
However, last week I noticed the HA ESP integration going unavailable and staying like that indefinitely. Deleting the integration and creating it again made the integration working again. Lately I observed that this is happening after power off/on of the ESP.
So today I decided to investigate what is going on. Seems with the latest HA even though the setting of ESP integration is based on the “use_address” field (in my case 192.168.0.144), HA zeroconf requests and ESP answers mDNS with the static_ip (192.168.4.144). Subsequently the HA will use this static_ip which will obviously not connect. See wireshark log below.
A simple solution is to disable the mDNS in ESP, just add the following in the project yaml: