goofy2k / ESPhome-starter

0 stars 0 forks source link

Device does not connect with IP received from DHCP #1

Closed goofy2k closed 3 years ago

goofy2k commented 3 years ago

In the simplest configuration, with a DHCP generated IP address the device does not connect to the WiFi network. Connection is OK when configuring for a static IP.

goofy2k commented 3 years ago

This poses a problem for end-users that don't have the means to flash firmware over USB. Just forcing a static IP is not an acceptable solution as it is not known a priori in which IP range the fixed address must lie. Fixed IP adresses should be freely configurable by an end user, e.g. via a hotspot/AP , as fallback or enforced.

goofy2k commented 3 years ago

Fraddles on discord.com suggests to have a look into host networking / mdns: https://docs.docker.com/network/host/

goofy2k commented 3 years ago

C7N (discord.com) says: Docker creates an overlay network, which all containers are connected to. This is a private network like the one you have behind your router. mDNS does not work between separate private networks, so you will therefore have to put the container on the same network as your PC and ESPhome devices

goofy2k commented 3 years ago

Hinted by a discussion on discord, I tried to use network = host instead of bridge. Now I can access the fallback hotspot. It even prompts for a login. After entering the home network credentials the board ultimately connects to it ! This seems to be a solution for issues #1 #2 . However: still many tries (4 way handshake timeout)