rstrouse / ESPSomfy-RTS-HA

Control your somfy shades in Home Assistant
The Unlicense
102 stars 9 forks source link

Unresponsive after couple of days #34

Closed heartkingz closed 2 months ago

heartkingz commented 5 months ago

Hi,

first of all, great project and very well put together! I made the hardware according to the documentation, flashed the software and added the blinds without any issues. Used everything last summer with no errors at all. A week or two ago I noticed that the entity became unavailable in home assistant. so I went to the web interface and saw that the following was happening? IMG_4243 IMG_4242 After rebooting the hardware it immediately works again for a couple of days. Then this behavior starts again. do you have any clue what is going on here?

No chantes to the hardware Latest version of your software Latest version of the home assistant integration Latest version of home assistant

thanks in advance!

rstrouse commented 5 months ago

The message you are receiving is not actually coming from the ESP32. The client is assuming that since it cannot open a socket to the device that it is busy.

First make sure you do not have more than 5 clients connected to our little ESP32. That message is displayed when a socket connection cannot be established from the client. If the device is working properly the most common reason is that it is too busy. In this case I am more inclined to think that there may be something else going on.

If you have a failure, attempt to access the device using its IP address and not the host name. Sadly, mDNS name resolution is dependent on your local router keeping the information in sync. If you have not set up a DHCP reservation in your router for the host then you should do this. This will make sure the device always receives the same IP address.

If you are running the most recent release of ESPSomfy RTS v2.3.0, then in Home Assistant you will see a Wifi strength entity. If the WiFi is degrading in signal strength we should see it there. The closer this value is to 0dBm the better. An acceptable signal is -80dBm but it will become unreliable as it approaches -90dBm. For instance, here is a device that has been running since the release of 2.3.0. It is pretty solid but if it were dipping into the -90 area it would likely go offline.
image

heartkingz commented 5 months ago

The funny thing is that the WiFi connection is solid as a rock. The esp has a -47dBm connection. When this happens, the esp is still connected and I do not see any dropouts. Only home assistant is connected to the esp via your integration.

It's strange it happens after a day or three and it comes back to life a day or so when I don't powercycle the esp.

rstrouse commented 5 months ago

Most often when a device drops off the network the first thing to check is whether you are accessing it over mDNS or using the IP address. mDNS can be fickle. Do you have an IP reservation in your router?

heartkingz commented 5 months ago

There is no dropoff from the network. It's online all the time. I do have a ip reservation set for the device. It looks like the esp freezes and a powercycle is the only option to bring it back. Is there a way to see some (more) logging to understand what's going on?

rstrouse commented 5 months ago

Yes you can connect the device to the usb with a data cable. In web.esphome.io connect the device click on the logs and you will see the information currently being processed from the device.

xbeaudouin commented 5 months ago

Well I have exactly the same problem.... Is there any way to add a possibility to have a reboot command on this integration ? So I can automate a daily reboot?

rstrouse commented 5 months ago

A reboot service, function, and entity exists in the current integration v2.3.1.

image

xbeaudouin commented 5 months ago

You are right... I had version 2.3.0 ! Well also I passed using ethernet, maybe it will have a better responsiveness ?

rstrouse commented 5 months ago

Interesting I have 1 WT32-ETH01 that occasionally drops off but I have another that never does. When I get a chance I am going to swap out the adapters and take a look at what it is doing. I can ping it but I cannot load anything over the webserver, udp, or sockets.

heartkingz commented 5 months ago

Yesterday I tried to do the update to 2.3.1 and it hung on the rotating circle for about 20 minutes. I thought it was ready because the other updates took a minute or so. So I rebooted the esp and now it constantly hangs on the screens as shown earlier also after a fresh reboot. I am not able to update the application. Today or tomorrow I will do the onboarding from scratch to get it back alive. It looks like it created two backup files when updating the first firmware. Which of the two I use to restore all settings?

rstrouse commented 5 months ago

In a browser type http://<ip address>/downloadFirmware?ver=2.3.1 in the address bar and press enter. It will take a couple of minutes but it will pull the firmware from github.

heartkingz commented 5 months ago

The reboot button is nice, but does not work when the device becomes unavailable in HA. The reboot button is also unavailable. Is there a browser request i can send to the device just like the "downloadfirmware" link you have sent earlier?

heartkingz commented 5 months ago

And now a reboot doesn't help either. It hangs on the same screens as in first post... It looks like it's doing it's own thing :(

xbeaudouin commented 5 months ago

Well I though the problem was because of Wifi, but since I move to Ethernet, the problem is still there... :( I will schedule a reboot twice a day on HA... but there is still hidding the issue :( My board in Lyligo Internet POE... Updates: the reboot on HA doesn't fix the issue... Will do a specific POE line for this and schedule a full POE Off/On at 5am and 4pm ...

rstrouse commented 5 months ago

@heartkingz sorry I missed your question.

The reboot button is nice, but does not work when the device becomes unavailable in HA. The reboot button is also unavailable. Is there a browser request i can send to the device just like the "downloadfirmware" link you have sent earlier?

Yes there is but you must send it in the form of a PUT or POST so you cannot simply type it into a browser. The command however can be sent from HA using a PUT or POST request to the following url. http://<ip address>/reboot

heartkingz commented 4 months ago

So I got a bit of time to troubleshoot as it still was unavailable in home assistant, constant spinning icon in the web interface but rock solid on the WiFi. I took the board out, wiped it completely and flashed the onboarding.bin file again. After browsing via web interface and connecting to my wifi, it happens again. This WiFi network is a hidden IoT WiFi network to which all of my esp devices are connected. I reflashed the board again but now I connected the board to my normal WiFi which is not hidden and it starts to work again without issues. This all started to happen without making changes to my WiFi setup. All my other ESP's are rock solid via the same hidden wifi network I use for this esp. I also tried this with a different board but this gave the same behaviour. Is there some sort of issue with the WiFi driver you use?

rstrouse commented 3 months ago

The libraries used are dependent on the SSID to resolve mesh networks.

rstrouse commented 2 months ago

I assume you have figured this out but the issue is that hidden networks do not have an overriding identifier like an SSID and will not work with mesh networks. I am going to close this for now. Also, if you were having stability issues please install the release fw v2.4.2. This has some fixed to improve stability.