martin-ger / esp32_nat_router

A simple NAT Router for the ESP32
1.27k stars 268 forks source link

Configuration with ESPHOME #133

Open Akstef opened 11 months ago

Akstef commented 11 months ago

Hi

I want to use the wifi repeater to extand my wifi network so I can connect an ESP32 to Home Assistant via ESPHOME. My local network has IP address 192.168.0.XX The repeater has IP address 192.168.4.XX

How can I use the port mapping to make the system work? If I connect my ESP32 directely on my wifi network through ESPHOME it is working fine. I changed the wifi network to the repeater one and I see in the log that my ESP32 is connected on the repeater but I get no data in home assistant.

Other question. If I leave the STA static IP settings blank, I can connect my phone to the repeater and I can go on internet. The repeater is connected on 192.168.0.8 If I specify a static address 192.168.0.15 with the correct submask and gateway, I have access to my local network but no more to internet. Why is the system reacting like this? What did I miss in the configuration?

chrisc99 commented 5 months ago

I have the same problem and cannot connect the 192.168.4.x vlan to ESPHome. I have tried using the ping function in ESPHome (https://esphome.io/guides/faq.html?highlight=ping#notes-on-disabling-mdns) but this hasn't helped. I have also tried this solution (https://community.home-assistant.io/t/esp8266-on-different-vlan/137796/15) but that also didn't solve the problem. My ASUS TUF GAMING AX6000 router does not have the option to manage vlans either.

twh-tech commented 3 months ago

@Akstef @chrisc99 I have the same challenge. Wanting to connect ESPHome devices to my Home Assistant instance through the ESP32 NAT router. They connect fine to the ESP32 NAT router and get internet access, but it seems that they either do not have LAN access or at least that they cannot succesfully connect to the Home Assistant API. The log shows that it tries to connect to the Home Assistant API:

[C][api:025]: Setting up Home Assistant API server...
[C][api:139]: API Server:
[C][api:140]:   Address: 192.168.4.6:6053
[C][api:142]:   Using noise encryption: YES

It just never happens and therefore no sensor data is communicated to Home Assistant.

Maybe port mapping is the solution? But being a network newbie, I would appreciate any hints in case you guys got it working?

Kind regards, Thomas.