gluap / pyess

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

Cannot connect to ESS #15

Closed alaska3586 closed 1 year ago

alaska3586 commented 2 years ago

My ESS is connected to a Fritzbox 7490 with ip address 192.168.178.45. The pyess package is installed on Ubuntu 18.4 with python 3.8. The default ip address 192.168.23.1 does not exist and cannot be ping'ed on my system.

esscli --action list_ess is able to find my device: Searching for LG ESS devices on the network found 1 devices: 1 DE2201BKRE017808

esscli --action get_password failed: unable to connect to local ESS

Detailed messages: Fetching ess password. For this you must be connected to the ESS wifi (or recently have been connected to it) Traceback (most recent call last): File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 159, in _new_conn conn = connection.create_connection( File "/usr/lib/python3/dist-packages/urllib3/util/connection.py", line 84, in create_connection raise err File "/usr/lib/python3/dist-packages/urllib3/util/connection.py", line 74, in create_connection sock.connect(sa) OSError: [Errno 101] Network is unreachable

During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 665, in urlopen httplib_response = self._make_request( File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 376, in _make_request self._validate_conn(conn) File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 996, in _validate_conn conn.connect() File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 314, in connect conn = self._new_conn() File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 171, in _new_conn raise NewConnectionError( urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x7fb26efd98e0>: Failed to establish a new connection: [Errno 101] Network is unreachable During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3/dist-packages/requests/adapters.py", line 439, in send resp = conn.urlopen( File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 719, in urlopen retries = retries.increment( File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 436, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='192.168.23.1', port=443): Max retries exceeded with url: /v1/user/setting/read/password (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7fb26efd98e0>: Failed to establish a new connection: [Errno 101] Network is unreachable'))

This looks to me to be a wrong ip address of 192.168.23.1. I changed the ip address from 192.168.23.1 to 192.168.178.45 to be able to connect to my local ESS, then again compiled with pip install pyess.

However, still the old ip address appears, so what is the right way to recompile everything?

Thanks in advance.

gluap commented 2 years ago

As the message says: get_password is only known to work on the ess wifi (the one opened by the ess), not your home network. In that network, the ess ip should be valid.

alaska3586 commented 2 years ago

Thanks for your response - understood. However, how do I create a direct connection to ESS. I have only been able to connect from a smartphone via EnerVU app. How to do this under raspian OS or ubuntu OS 18.4, where an EnerVU app is not available? My ESS is configured via WLAN , no LAN cable.

s-hager commented 2 years ago

You need to enable the ess wifi like shown on the 2 screenshots of the lg enervu app below and then connect to the wifi from a computer that you can run the "esscli --action get_password" command on (Of course you need to change the IP address back from 192.168.178.45 to the default 192.168.23.1). Once you have the password you can then connect to your own wifi again and use pyess from there. PS: Thank you gluap for making this! Screenshot_20220912-125334.jpg Screenshot_20220912-125337.jpg

alaska3586 commented 2 years ago

Thanks - will try in the evening.

alaska3586 commented 2 years ago

Thanks for the procecure, with which I could connect and get the ESS password.

Next, I connected via WLAN to my 7490 router and tried to receive data with esscli: esscli --action get_data --password The command failed.

The Wifi is the local WLAN , not the ESS WLAN which is disabled now, the 192.168.23.1 is no longer available. The ESS Ip-address 192.168.178.45 in my own wifi can be ping'ed.

Traceback (most recent call last): File "/home/stephan/.local/bin/esscli", line 8, in sys.exit(main()) File "/home/stephan/.local/lib/python3.9/site-packages/pyess/cli.py", line 99, in main actionsargs.action File "/home/stephan/.local/lib/python3.9/site-packages/pyess/cli.py", line 74, in get_data ip, name = autodetect_ess() File "/home/stephan/.local/lib/python3.9/site-packages/pyess/ess.py", line 218, in autodetect_ess name = find_all_esses()[0] File "/home/stephan/.local/lib/python3.9/site-packages/pyess/ess.py", line 266, in find_all_esses raise ESSException("could not find any ESS devices via mdns") pyess.ess.ESSException: could not find any ESS devices via mdns

Also the list_ess (which initially worked) now brings this message: File "/home/stephan/.local/lib/python3.9/site-packages/pyess/ess.py", line 266, in find_all_esses raise ESSException("could not find any ESS devices via mdns") pyess.ess.ESSException: could not find any ESS devices via mdns

Can you please give advice how to proceeed from here?

alaska3586 commented 1 year ago

I finallly found a problem within ESS communication setup which is now solved. The get_data command now smootly delivers data.

Thank you very much for assistance. The pyess interface is a great solution!

Tzhe issue can be closed.

s-hager commented 1 year ago

👍 Well done. Happy that it works for you now.