Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ShineWIFI-F Pro support on an SPF 6000 ES Plus #604

Open
hristouzunovaz opened this issue Oct 22, 2024 · 16 comments
Open

ShineWIFI-F Pro support on an SPF 6000 ES Plus #604

hristouzunovaz opened this issue Oct 22, 2024 · 16 comments

Comments

@hristouzunovaz
Copy link

Hey guys, I'm wondering if Grott supports this datalogger ShineWIFI-F Pro on this inverter SPF 6000 ES Plus.
I can see the documentation says spf support but this exact inverter is not mentioned.
I'm only asking because I have installed and configured Grott (HA add-on) and it seems to be communicating with the datalogger:

Hostname : 1ef934e0-grott
IP : 172.30.33.4 , port : 5279

  • ('192.168.2.248', 63588) has connected

  • Growatt packet received:
    <socket.socket fd=4, family=2, type=1, proto=0, laddr=('172.30.33.4', 51494), raddr=('8.209.71.240', 7006)>

  • Grott - grottproxy - Invalid data record received, processing stopped for this record

The logs suggest to me that the logger and my Grott instance talk to each other, however, the messages are unexpected.
If this hardware setup is not supported, what can I do to help make it supported?

@johanmeijer
Copy link
Owner

As far I can see from the issue/discussion Grott works with a SPF 5000 ES and SPF 3000TL.

I am not sure it works with a ES Pro and/or datalogger ShiniWIFI-Pro (although that seems the datalogger specific for the SPF.

The challenge is that if have "forgotten" to program the additional verbose record logging when a record is invalid, so it is difficult to debug the record.

I can update the 2.8.3. version with the necessary debugging info but that will not work directly for the HA addon I think we need @egguy for that.

Are these the only records you see at this moment? Are there other records that shows Data less then minimum record length, data not processed? If that is true we have more capabilities to debug.

@johanmeijer
Copy link
Owner

I added additional debug info showing full data record for invalid datarecord to grottrproxy.py in the beta 2.8.3 version.

Maybe we can use this one to debug. Start with the -v option to see the additional information. @egguy is it possible to test this one with HA addon?

@hristouzunovaz
Copy link
Author

To answer your initial comment:
Yes, these are the only logs I can see. I am starting the server with verbose : true.
No, there are no other records.

Regarding your latter comment: how do I get to the beta version? I'm afraid I did not see a way to do this in HA.
I did receive an update notification for Grott this morning and did apply it.

Is there anything more I can share from my setup to assist in debugging?

@johanmeijer
Copy link
Owner

Maybe @egguy can help us to test the beta in HA? He is the owner of the HA addon.

@hristouzunovaz
Copy link
Author

Hi @egguy, what would be the best way to try and debug in this case. I have installed the beta branch from the HA add-on, and of course, I get the same result.

@egguy
Copy link
Contributor

egguy commented Oct 27, 2024

Hi @hristouzunovaz , I have recently updated the 2.8 add-on based on the beta branch.

You can test it on the edge addon repository for the moment: https://github.com/egguy/ha-addons-edge/ you can install it alongside the currently install repository. You need to stop the other add-on before running the new one.

It is currently using the commit: 4b526a8

@hristouzunovaz
Copy link
Author

hristouzunovaz commented Oct 28, 2024

Thank you guys for your support!

I did as instructed by @egguy and did install the beta channel on edge. Do let me know if this is the correct thing to do.
Once I brought the server up I got the following log:

Hostname : 3bd86b2d-grott-beta
IP :  172.30.33.4 , port :  5279 

	 - ('192.168.2.248', 59367) has connected
Traceback (most recent call last):
  File "/app/grott.py", line 35, in <module>
    proxy.main(conf)
    ~~~~~~~~~~^^^^^^
  File "/app/grottproxy.py", line 150, in main
    self.on_close()
    ~~~~~~~~~~~~~^^
TypeError: Proxy.on_close() missing 1 required positional argument: 'conf'
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service base-addon-log-level: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service base-addon-log-level successfully stopped
s6-rc: info: service base-addon-banner: stopping
s6-rc: info: service base-addon-banner successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped

I believe the server crashes because it spills the same logs after a while, i.e. it reboots and starts from the begging.
I'm copying the same .ini file over to a new instance

Screenshot 2024-10-28 at 9 30 53 PM

@johanmeijer
Copy link
Owner

Ok strange. I did something wrong while changing the code. I have to repair things. Sorry for that.

@johanmeijer
Copy link
Owner

I have uploaded some bug fixes to the Grott Beta, hopefully @egguy can generate a new HA plugin.

Sorry for the inconvenience.

@egguy
Copy link
Contributor

egguy commented Oct 30, 2024

Hi, thanks for your work @johanmeijer.

The update has been merged as part of egguy/addon-grott-beta#89 . The new add-on should be published soon on the edge repo @hristouzunovaz

@hristouzunovaz
Copy link
Author

hristouzunovaz commented Oct 31, 2024

Hi guys, this is a sit rep:
These are the logs I get when I start the server:

Hostname : 3bd86b2d-grott-beta
IP :  172.30.33.4 , port :  5279 

	 - ('192.168.2.248', 55962) has connected
	 - ('192.168.2.248', 55584) has connected
	 - ('8.209.71.240', 7006) has disconnected
	 - ('8.209.71.240', 7006) has disconnected
	 - ('192.168.2.248', 55585) has connected

I was expecting more logs out of this. This is the config that Grott reports:

Grott settings:

_Generic:
	version:             	 2.8.3
	verbose:             	 True
	trace:               	 False
	config file:         	 /config/grott/grott.ini
	minrecl:             	 100
	decrypt:             	 True
	compat:              	 True
	invtype:             	 default
	invtypemap:          	 {'HAQ0E6808E': 'SPF', 'HAQ0E6U03N': 'SPF'}
	include_all:         	 True
	blockcmd:            	 False
	noipf:               	 False
	time:                	 auto
	sendbuf:             	 True
	timezone:            	 local
	valueoffset:         	 6
	offset:              	 6
	inverterid:          	 automatic
	mode:                	 proxy
	grottip              	 default
	grottport            	 5279
_MQTT:
	nomqtt               	 False
	mqttip:              	 172.30.33.0
	mqttport:            	 1883
	mqtttopic:           	 energy/growatt
	mqttmtopic:          	 False
	mqttmtopicname:      	 energy/meter
	mqttinverterintopic: 	 False
	mqtttretain:         	 False
	mqtttauth:           	 True
	mqttuser:            	 addons
	mqttpsw:             	 **secret**
_Growatt server:
	growattip:           	 8.209.71.240
	growattport:         	 7006
_PVOutput:
	pvoutput:            	 False
	pvdisv1:             	 False
	pvtemp:              	 False
	pvurl:               	 https://pvoutput.org/service/r2/addstatus.jsp
	pvapikey:            	 yourapikey
	pvinverters:         	 1
	pvsystemid:          	 systemid1
_Influxdb:
	influx:             	 False
	influx2:            	 False
	database:           	 grottdb
	ip:                 	 localhost
	port:               	 8086
	user:               	 grott
	password:           	 **secret**
	organization:       	 grottorg
	bucket:             	 grottdb
	token:              	 **secret**
_Extension:
	extension:          	 True
	extname:            	 grottext.ha
	extvar:             	 {'ha_mqtt_host': 'core-mosquitto', 'ha_mqtt_port': '1883', 'ha_mqtt_user': 'addons', 'ha_mqtt_password': 'Oop0phaeg3theo2Jesighohphing8ahdooNahthe0Oodauthah6koo4uwoo7cohh', 'ha_mqtt_retain': False}

Just to confirm, this is what the add-on tells me:

since v0.1.7

⬆️ Update grott digest to 3bfeec8
⬆️ Update Add-on base image to v15.0.1
⬆️ Update grott digest to 4b526a8

The server reports no issues, however, I still don't see any sensors in HA and Growatt console reports the data logger as disconnected.
Please advise further!

@hristouzunovaz
Copy link
Author

Also, I'm seeing this log:

Logger: aiohttp.server
Source: /usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py:448
First occurred: 8:17:19 AM (11 occurrences)
Last logged: 6:34:28 PM

Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/xml/etree/ElementTree.py", line 1706, in feed
    self.parser.Parse(data, False)
xml.parsers.expat.ExpatError: not well-formed (invalid token): line 1, column 888

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 477, in _handle_request
    resp = await request_handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/async_upnp_client/aiohttp.py", line 347, in _handle_request
    status = await self.event_handler.handle_notify(http_request)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/async_upnp_client/event_handler.py", line 167, in handle_notify
    service.notify_changed_state_variables(changes)
  File "/usr/local/lib/python3.12/site-packages/async_upnp_client/client.py", line 542, in notify_changed_state_variables
    self.on_event(self, changed_state_variables)
  File "/usr/local/lib/python3.12/site-packages/async_upnp_client/profiles/dlna.py", line 389, in _on_event
    dlna_handle_notify_last_change(state_variable)
  File "/usr/local/lib/python3.12/site-packages/async_upnp_client/profiles/dlna.py", line 215, in dlna_handle_notify_last_change
    service.notify_changed_state_variables(changes_0)
  File "/usr/local/lib/python3.12/site-packages/async_upnp_client/client.py", line 542, in notify_changed_state_variables
    self.on_event(self, changed_state_variables)
  File "/usr/local/lib/python3.12/site-packages/async_upnp_client/profiles/dlna.py", line 394, in _on_event
    self._update_current_track_meta_data(state_variable)
  File "/usr/local/lib/python3.12/site-packages/async_upnp_client/profiles/dlna.py", line 1086, in _update_current_track_meta_data
    items = _cached_from_xml_string(xml)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/async_upnp_client/profiles/dlna.py", line 239, in _cached_from_xml_string
    return didl_lite.from_xml_string(xml, strict=False)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/didl_lite/didl_lite.py", line 1077, in from_xml_string
    xml_el = defusedxml.ElementTree.fromstring(xml_string)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/defusedxml/common.py", line 126, in fromstring
    parser.feed(text)
  File "/usr/local/lib/python3.12/xml/etree/ElementTree.py", line 1708, in feed
    self._raiseerror(v)
  File "/usr/local/lib/python3.12/xml/etree/ElementTree.py", line 1615, in _raiseerror
    raise err
xml.etree.ElementTree.ParseError: not well-formed (invalid token): line 1, column 888

What I understand is that something is trying to communicate but the wrong message is sent.

@johanmeijer
Copy link
Owner

johanmeijer commented Nov 4, 2024

Hmm this are totally strange messages for me. I do not thing Grott uses web_protocol.py.
Can this be a Home assistent error?

@egguy
Copy link
Contributor

egguy commented Nov 5, 2024

This looks like a homeassistant log. Where did you get this log?

From the look of the provided changelog from the addon, you are on the commit: 3bfeec8 version, with the verbose mode enabled.

@hristouzunovaz
Copy link
Author

yeah, disregard the logs from HA, I was looking too hard into them.
The question remains, though, what is wrong with Grott. Looks like the communication between Grott and Growatt servers is not happening.
I'm not really experienced with backend stuff, but if I fork the repos and add my logs, what would be the easiest way to look into the packets and read the messages?

@PedroKTFC
Copy link

I have uploaded some bug fixes to the Grott Beta, hopefully @egguy can generate a new HA plugin.

Can you point me to where the changes are please? I'm looking at recent changes to the 2.8.3(beta) branch but I'm not sure if that's the right place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants