I have been using two ESPHome devices for several months without any problems. However, for a few days now, both have had a very poor WiFi connection. One loses the connection permanently and can only be reconnected after a reboot. Even then, it only stays connected for a few minutes before dropping out again. The other keeps switching between connected and disconnected.
I have moved some of my routers to different locations, but they are now in the same configuration as before. However, I don’t know when the last ESPHome update was.
Now, before I check if there are hardware problems with both devices at the same time (very unlikely) or if my WiFi is the problem (somewhat unlikely), I would like to ask if there is any indication that this could be a problem with ESPHome. So if anyone else is having problems, please let me know!
Can you tell more about Wifi AP you use ? Your explanations are confusing as you are speaking about multiple routers ?? or you meant AP ?
Have you done any fw updates on your AP/router or whatever device you use for Wifi ?
I had a problem with wifi connection on one of my esphome board. It was disconnecting all the time. I solved that problem by adding in my sensor.yaml file
It could have moved to one with a less favourable SWR that makes it just more difficult for the ESP to talk to the router. It could be lots of different reasons. We are just speculating without more info.
Give an idea of your network topology.
I just came across this the other day, didn’t even realize that changing channels would cause this. Retracing my steps I happened to change the channel back and got, pi zero in my case, back online.
Now that you wrote it, it clicked, just because the channel is clear by the AP doesn’t mean it’s clear next to the node.
The inverted F antennas used on many ESPs are narrowband. They may not transmit the same on each channel. The whole impedance matching seems more art than science. I’ve watched a few youtube videos on it and it’s a great way to fall asleep in the afternoon.
Thanks for your replies so far. Here is some more additional info. First, an example YAML code as requested. There are some more sensors defined, however, I think this is not important in this case.
esphome:
name: "p1-smartmeter"
esp8266:
board: esp01_1m
# Enable Home Assistant API
api:
ota:
platform: esphome
wifi:
networks:
- ssid: !secret wifi_ssid_devolo
password: !secret wifi_password_devolo
- ssid: !secret wifi_ssid_fritz
password: !secret wifi_password_fritz
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Esphome-Web-28023C"
password: "0pEZX3fDF4qy"
logger:
# Serial logging is disabled by setting the logger baud rate to 0.
# Otherwise the logger will occupy the hardware UART, making it unavailable
# for receiving smart meter data on pin D7 (GPIO13).
baud_rate: 0
level: VERBOSE
uart:
rx_pin:
number: GPIO3
inverted: true
rx_buffer_size: 1700
baud_rate: 115200
dsmr:
decryption_key: "xxxxxxxxxxxxxxxxxxxxxxxx"
max_telegram_length: 1700
gas_mbus_id: 2
# Can be 1, 2, 3, 4
sensor:
- platform: dsmr
energy_delivered_tariff1:
name: "dsmr_energy_delivered_tariff1"
My network topology is not ideal, unfortunately there’s not much I can do. I currently have a Fritzbox 7490 with several repeaters running. The ESPs in question usually connect to a repeater, which itself is also connected to another repeater, which is connected to the FritzBox. Like this:
Fritzbox 7490 → Repeater A → Repeater B → ESP
All the repeaters are in mesh mode. The Fritzbox is set to autochannel (currently it’s channel 6). Despite this being no optimal setup, it has worked quite reliably in the past, but now, it isn’t.
If it had been a standard network I would then have suggested to connect to the strongest signal by bssid rather than ssid. Some people also find problems if ssid name is the same for 2.4 and 5Ghz where 2.4Ghz wont connect. If possible on your router you could ban the mac of the esp on the 5Ghz band.