gluap / pyess

Python library for communication with LG ESS power converters
MIT License
31 stars 10 forks source link

Connection to the ESS seems to be blocked #13

Closed PanicMan closed 1 year ago

PanicMan commented 2 years ago

Hello,

thanks a lot for this great project, I use it for about an Year and had absolutely no problems with it. Until yesterday... I had to restart my Fritz!Box and since then pyess has absolutely no communication with the ESS anymore. I got an update some Days ago: PCS Ver.: S/W: LG 04.00.01.00 R130 1.126.3 PMS Ver.: S/W: 10.05.7250 The Cloud is showing Data, so the connection is there. I can ping the ip from any computer, but not from my two Raspberry-Pi Boards, the one is Pi4 with 8GB and has pyess on it, the other ist Pi3b+ with Display. Both get lost all of the Ping Packets. Does someone of you encounter such problems? Any idea how I can solve this?

Greetings Jack

gluap commented 2 years ago

Unfortunately my ess home 5 seems to be out of service and I don't get any updates for it, if anyone with an ess 5 is getting anything recent i'd be happy to hear about it.

But despite being unable to test that version I have a few Ideas to narrow down your problem.

1.) are you using the auto detection feature or do you have the ess IP manually configured? In case you use the mdns autodetection: try configuring the ess ip manually.

2.) do your pis successfully ping each other, do they successfully ping other machines on your network? (no pings at all may be an indicator for network trouble of some kind on the pies)

Likely only helpful if you use dhcp but worth a try : 3.) have you tried restarting the ess after the fritz box was restarted? If not it may be worth trying to let Essa reconnect to fritz.

4.) have you restarted the pis since the fritz box restarted happened? (same reason). Do they have proper ipv4 addresses, are they all in the "personal" network? Does the netmask on the pies and the ess allow for traffic in between? Does the output of route -n [ess-ip] from the pi show the corect network interface?

5.) if you disable pyess, give a new ip to a pi and then try to ping the ess, does it reply (the unlikely assumption being that the ess may have started to firewall against pyess, maybe for rate limiting.)?

PanicMan commented 2 years ago

Hi, thanks for your answers suggestions, I tried them:

  1. Autodetection, but as long I can't ping the IP I don't think it will change anything. Also my LG ESS Android App stopped connecting to it over WLAN.
  2. Yes, ping everything else in my home network works w/o problems.
  3. I had also tried 4. w/o success (5. is not possible, as everything else rely on that IP), but this finally solved my problem. I restarted the fritz!box before and had never such issues. And I also tried to restart the ESS before, but as the Battery was still ON, it did not restart correctly.

But after i did the correct turn OFF procedure, wait 10 min, correct turn ON procedure, after that the pyess again connected to the ESS and everything was working fine. It was late in the evening, so the Battery was not recognized as half full, was showing as 0% SOC and today morning it hop from 0% to 40% with the first sun ray and now everything works fine. I also tried to press the "black start" button yesterday, but nothing happens, any Idea how that button works? Manual says nothing about it... Thanks a lot for your help!

LosPrivatos commented 2 years ago

Hey guys. Thanks gluap for this very nice project!!!

Sadly i had the same problems as PanicMan since 10 March´22. I don´t know which version i had before and if they were updated, but now i´m at the same PCS and PMS Versions.

I have modified your code a little bit, so that i write the Data to an MSQL Database with your graphite feature and it worked mostly great, sometimes i have to reconnect ... which is most times a story of 1 Minute. But since 3 days it wont connect (via mdns?), so i start the WLan initiate Process (Button on the downside of the ESS) And tadaa it connects again. But after ca. 40 Minutes (With 1 connection every ~10 seconds) it crashes with:

request.exceptions.ConnectionError: HTTPSConnectionPool(host='192.168.0.194', port=443): Max retries exceeded with url: /v1/user/setting/login (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f02**30>: Failed to establish a new connection: [Errno 101] Network is unreachable'))

(*=privacy)

Also i had Problems with the App. The Webpage works bad and slow as everytime ;)

So i think that you are right gluap, with your rate limitation assumption.

Regards LosPrivatos

fu-zhou commented 2 years ago

I had similar challenges and figured out that once my mobile phone recommended to hibernate or shut down the ESS app, I got rid of all the connection problems. To me it seems that ending the app (when you get the Korean message) doesn't really stop the communication between the app and the ESS resulting in concurrent connection attempts leading to a non wokring app and driver. the "deep standby" of the App solved that for me since then. On my Androit phone the status in German is "tiefes Standby"

gluap commented 1 year ago

I Believe this was fixed (the issue of interference between app and pyess) some time ago when I switched pyess to communicate the current date and time in the right format to the ess.