EspHome Native API question

Disclaimer:: I am not a network expert hence my statements could be wrong

Hi,

logging my network activity with Wireshark I see Esphome flashed ESP8266/ESP32 send a decent amount of broadcasting messages querying for home assistant IP address.

This leads to a load of the network and IoT devices has usually a limited wifi bandwidth: a huge number of devices could reduce it.

I was wondering if it could be possible (and meaningful) to add to native API component an parameter to make explicit which is HA instance IP address in order to avoid broadcasting.

The api protocol is pretty light and your method could lead to issues for people who don’t know better and use a dynamic address for HA. I suppose ESPHome could fall back to scanning if the fixed address isn’t found.

You can suggest the idea here: https://github.com/esphome/feature-requests/issues

Paste the link here if you do raise a feature request. I’d like to read the dev’s response.

thank you very much!
done!

1 Like

for who is interested I added more info analyzing network traffic with wireshark

I did more search and, although unsure, I am wondering whether the mDNS packets shoot but ESPHome devices are due to local mDNS transponder (introduced in v1.11.0) and not by Native API.

I searched the web to see if I could find some reference about how to disable it but couldn’t find anything.
Maybe someone can advice?

I think you are worrying unduly. If your network can’t stanf a burst of 80 packets, you need to fix your network (I think, like you I am not a networking expert!)

Hi Nick,

Had this issue in the past and synology support (I have a synology rt2600ac + 2xmr2200ac in mesh config) told me burst above 40 packets / s are not suggested for network stability.

I think powerful devices like tablet, pc, smartphones can handle easily: issue is when these hit IoT low power devices like esp8266 or similar.

To give you an example esp8266 have a WiFi transfer rate of live 1.5MB/s (http://iot-bits.com/esp8266-tcp-server-speed-test/) so their bandwidth is quite limited.
Apparently I understood they get in trouble with high number of packet burst

1.5MB/s is 1,500,000 Bytes. The size of an ethernet packet is usually 1500 bytes. That is 1,000 packets/sec.

Hi Nick,

As said I am not a network expert, this is what I have been reported.
My understanding is that 1.5MB/s is max measured bandwidth on single file transfer: you can clearly check on your network how performance drops dramatically once transferring a lot of small files instead of a big one.
This is I guess the point although I am not 100% sure.

On the other hand I made some test: I am running hass.IO and have ESPHOME as an add-on which is normally not turned on.
Turning it on first thing it does is bursting mDNS query you check device status: this makes lot of device to drop connection.
Switching to ICMP Pings method for polling status this doesn’t happen anymore.

Neither am I!

esphome devices or other devices? And what proof do you have of this “disconnection” - what are the symptoms?

Hi Nick,

Talking about ESPHOME devices (which are low bandwidth one)
I see it in HA “connection status” for those devices

Hi,

I read some stuff on github and looks like, although planned, reverting from server to client for EspHome is not a simple thing.

I was wondering if it could make sense in the meanwhile to define some firewall rules to prevent EspHome devices to broadcast leaving them only ability to communicate with HomeAssistant IP address.

Not sure though how to implement it: can anyone provide a hint?