Error adding ESP8266 in Home Assistant: Socket Operation Failed: Connection_Closed errno=11

I also had this problem. I solved it by hooking up the Bluetooth proxy device to my computer and re-flashing it there. I think the issue originated when trying to remote-update the device. Sometimes upgrades work correctly through ESPHome; sometimes they work correctly through the Home Assistant Updates panel. This time, the upgrades failed through both and I resorted to physical updates.

Yep, I have the same for one device and cannot figure out how to get over it. Any luck?

Socket operation failed: HANDSHAKESTATE_READ_FAILED errno=11

Iā€™m totally blocked with this. I tried to remove the device and install it all over again with different name. Started with the default configuration that ESPHome gives for a new device(with wifi) and I still get the same error:

[09:52:32][C][api:138]: API Server:
[09:52:32][C][api:139]:   Address: kaukolampo-lukija.local:6053
[09:52:32][C][api:141]:   Using noise encryption: YES
[09:53:02][D][api:102]: Accepted 192.168.1.27
[09:53:02][W][api.connection:071]: 192.168.1.27: Socket operation failed: HANDSHAKESTATE_READ_FAILED errno=11

Because the device is not available in HA, I assume the error comes from the connection to API server.

I donā€™t have any more ideas what to try. Any help would be highly appreciated!

Ok, finally got it working. I had to remove the old device (even with different name) from the Home Assistantā€™s integrations view. After that, adding a new device in ESPHome triggered normal configuration request (asking the API key) in HA. So, there seems to be some kind of book keeping for the device itself and adding the same device with different name is not enough. It is not either enough to remove the old device in ESPhome but it needs to be removed from HA, too.

3 Likes

This is driving me NUTS!
My board is wireless-tag and want to run it on ethernet.
Flashed about 20x, deleting addon / removing board / set toWiFi, set to ETH, everytime this message in the log every 60 seconds.

Turned on the extra verbose:
[22:06:15][VV][api.socket:358]: [ip] noise_handshakestate_read_message failed: MAC_FAILURE
[22:06:15][W][api.connection:075]: [ip]: Socket operation failed: HANDSHAKESTATE_READ_FAILED errno=11

So I thought the wifi has diffrent mac than eth. That was when i commented out the network settings in the yaml, but stillā€¦ errrno=11

Isnā€™t it possible with this board? Do I really need olimex???

Any help is appreciated!!!

Ok, that was fun ā€¦

I had the esp32 device configured on 2 diffrent RPI / HA installations.
The socket operation failed message was from the ā€˜wrongā€™ HA still trying to connect.
When I removed the device, the message stopped ā€¦
All working nicely nowā€¦

i fixed this issue because in home assistant devices and services there was ā€˜reconfigureā€™ button on the ESP device, needed to enter the encryption key and the error went away

3 Likes

Fixed it for me.

In my case it was the blackbox exporter with the TCP probes. :person_shrugging: