johanmeijer / grott

Growatt inverter monitor
https://github.com/johanmeijer/grott/wiki
395 stars 109 forks source link

Grott - grottproxy forward error: [Errno 110] operation timed out #347

Open Yogi4301 opened 1 year ago

Yogi4301 commented 1 year ago

Actually I get often the above shown error during the communication with Growatt. Due to the fact that buffered events are send to Growatt again there is no loss of data. I have set servertime due to a bug in the Shinewifi-x - therefore no data is send to MQTT and PVoutput.org in these cases. Actually I have copied the sources and I am building the docker-container myself, so that I could reduce the logging and send more data to PVoutput.org (V7, V8..).

Can you give me hint on how to change the behaviour, so that events are sent to MQTT an PVoutput in the case Growatt is not responding? I'm far away of being a python expert...

gajotnt commented 1 year ago

Also getting that error.

s6-rc: info: service s6rc-oneshot-runner: starting s6-rc: info: service s6rc-oneshot-runner successfully started s6-rc: info: service fix-attrs: starting s6-rc: info: service fix-attrs successfully started s6-rc: info: service legacy-cont-init: starting s6-rc: info: service legacy-cont-init successfully started s6-rc: info: service legacy-services: starting s6-rc: info: service legacy-services successfully started [17:30:07] INFO: Preparing to start...


  • Grott - libscrc not installed, no CRC checking only record validation on length!

    Grott Growatt logging monitor : 2.7.8 Grott process configuration file Grott process environmental variables Pulled 'ginvtype=sph' from the environment Pulled 'ginvtypemap={"NLCUCD700T":"sph"}' from the environment Pulled 'gnomqtt=true' from the environment Pulled 'gextension=True' from the environment Pulled 'gextname=grott_ha' from the environment Pulled 'gextvar={"ha_mqtt_host": "core-mosquitto", "ha_mqtt_port": "1883", "ha_mqtt_user": "addons", "ha_mqtt_password": "Zeireivoopee3sie1ahruphaesooChah7iyahDooxei9eekeNg4Iizegi9saexoh", "ha_mqtt_retain": False}' from the environment Grott override settings if set in commandline Grott process json layout files Grott proxy mode started


  • Grott - libscrc not installed, no CRC checking only record validation on length!

    Hostname : 8ce4abae-grott-current IP : 172.30.33.4 , port : 5279

  • Growatt packet received: <socket.socket fd=4, family=2, type=1, proto=0, laddr=('172.30.33.4', 33670), raddr=('47.91.67.66', 5279)>
  • Growatt packet received: <socket.socket fd=4, family=2, type=1, proto=0, laddr=('172.30.33.4', 33670), raddr=('47.91.67.66', 5279)>
  • Growatt packet received: <socket.socket fd=4, family=2, type=1, proto=0, laddr=('172.30.33.4', 33670), raddr=('47.91.67.66', 5279)>
  • Growatt packet received: <socket.socket fd=4, family=2, type=1, proto=0, laddr=('172.30.33.4', 40232), raddr=('47.91.67.66', 5279)>
  • Growatt packet received: <socket.socket fd=4, family=2, type=1, proto=0, laddr=('172.30.33.4', 40232), raddr=('47.91.67.66', 5279)>
  • Growatt packet received: <socket.socket fd=6, family=2, type=1, proto=0, laddr=('172.30.33.4', 54032), raddr=('47.91.67.66', 5279)>
  • Growatt packet received: <socket.socket fd=6, family=2, type=1, proto=0, laddr=('172.30.33.4', 54032), raddr=('47.91.67.66', 5279)>
  • Growatt packet received: <socket.socket fd=6, family=2, type=1, proto=0, laddr=('172.30.33.4', 54032), raddr=('47.91.67.66', 5279)>
  • Growatt packet received: <socket.socket fd=5, family=2, type=1, proto=0, laddr=('172.30.33.4', 5279), raddr=('192.168.1.241', 31683)>
  • Grott - grottproxy - Invalid data record received, processing stopped for this record
  • Growatt packet received: <socket.socket fd=6, family=2, type=1, proto=0, laddr=('172.30.33.4', 48262), raddr=('47.91.67.66', 5279)>
  • Grott - grottproxy - Invalid data record received, processing stopped for this record
  • Growatt packet received: <socket.socket fd=6, family=2, type=1, proto=0, laddr=('172.30.33.4', 48262), raddr=('47.91.67.66', 5279)>
  • Grott - grottproxy forward error : [Errno 110] Operation timed out
  • Grott - grottproxy forward error : [Errno 110] Operation timed out

Inversor show as "LOST" on the server.growatt.com page. Even if i change the datalogger to the default it's the same, maybe servers arent working yet...

daath commented 1 year ago

I am currently using the "Grott edge - Home Assistant native MQTT integration - current" addon in Home Assistant, and it has worked flawlessly since I installed it. Today at half past two it stopped working - I tried to restart HA and the Grott addon log says:

IP :  172.30.33.3 , port :  5279 
     - Growatt packet received:
          <socket.socket fd=4, family=2, type=1, proto=0, laddr=('172.30.33.3', 34474), raddr=('47.91.67.66', 5279)>
     - Grott - grottproxy forward error :  [Errno 110] Operation timed out
     - Grott - grottproxy forward error :  [Errno 110] Operation timed out
     - Grott - grottproxy forward error :  [Errno 110] Operation timed out
     - Grott - grottproxy forward error :  [Errno 110] Operation timed out

Also datalogger state in server.growatt.com is "Lost" ...

I can't figure out the reason ...

gajotnt commented 1 year ago

I think theres problems with growatt servers, and for some reason GROTT will only decode the info and forward it to MQTT after reply from server. So if growatt goes offline we get nothing... -.-

daath commented 1 year ago

Yes, it definitely seems like a bug - it seems like it got the data, but nothing is put in MQTT :(

Yogi4301 commented 1 year ago

The growatt servers are down - and if growatt is down, no data is send to MQTT and PVoutput.org. Thats the reason why I ask how to change grott accordingly.

gajotnt commented 1 year ago

Just got some data in home assistant.

But yes this needs to be addressed.

rcvaneck commented 1 year ago

The error code is changed from 110 to 111. Looks like a block on Growatt side.

gajotnt commented 1 year ago

Not getting that error. Still getting 110 from time to time

Yogi4301 commented 1 year ago

Getting lots of errors - but still 110

     - Growatt data decrypted V2 ( 2023-06-08T20:37:51 )
     - Grott data ack record or data record not defined no processing done
     - Grott - grottproxy forward error :  [Errno 110] Operation timed out
     - Can't establish connection with remote server.
     - Closing connection with client side ('192.168.178.69', 52734)
     - Grott - grottproxy forward error :  [Errno 110] Operation timed out
     - Can't establish connection with remote server.
     - Closing connection with client side ('192.168.178.88', 18176)
     - Grott - grottproxy forward error :  [Errno 110] Operation timed out
     - Can't establish connection with remote server.
     - Closing connection with client side ('192.168.178.69', 52854)
     - Grott - grottproxy forward error :  [Errno 110] Operation timed out
     - Can't establish connection with remote server.
     - Closing connection with client side ('192.168.178.88', 13027)
     - Grott - grottproxy forward error :  [Errno 110] Operation timed out
     - Can't establish connection with remote server.
     - Closing connection with client side ('192.168.178.69', 52876)
     - Grott - grottproxy - Invalid data record received, processing stopped for this record
     - Grott connection error
     - Grott - grottproxy - Invalid data record received, processing stopped for this record
     - Grott connection error
     - Grott - grottproxy - Invalid data record received, processing stopped for this record
     - Grott connection error
     - Grott - grottproxy - Invalid data record received, processing stopped for this record
     - Grott connection error
     - Grott - grottproxy - Invalid data record received, processing stopped for this record
     - Grott - grottproxy - Invalid data record received, processing stopped for this record
     - Grott - grottproxy - Invalid data record received, processing stopped for this record
     - Grott - grottproxy - Invalid data record received, processing stopped for this record
     - Grott - grottproxy - Invalid data record received, processing stopped for this record
     - Grott - grottproxy forward error :  [Errno 110] Operation timed out
     - Can't establish connection with remote server.
     - Closing connection with client side ('192.168.178.88', 21953)
     - Grott - grottproxy - Invalid data record received, processing stopped for this record
     - Grott - grottproxy - Invalid data record received, processing stopped for this record
muppet3000 commented 1 year ago

Regardless of whether the servers are down or not grott should continue to push data to other endpoints e.g. mqtt, it shouldn't 'bomb out' if Growatt servers are unavailable.

I've tried looking through the codebase base before I find it really difficult to parse, I may try and look through it again over the weekend to see if I can help out with a PR, but I'm short on time at the minute.

It would be really handy if @johanmeijer could explain whether some communication is needed to Growatt in order for grott to work or if this is just a case of an ordering problem?

johanmeijer commented 1 year ago

Grott by it self is a proxy so read the data and forward it. A proxy needs connection with both sides. So the inverter (datalogger) and growatt server. We need a server (growatt server) to keep the communication going. If there is no connection, and no communication the inverter will not sent any data at all (it only tries to set up a connection).

This is how Grott is initial designed (without the need to really understand the protocol is being used).

After some reversed engineering of the used protocol, I also created a Grottserver (see #98) that emulates the growatt server and removes the need for growatt server.

Be aware I also think that it should not be a problem that you lose contact with the growatt server. The inverter (datalogger) is buffering the data and will resent it the moment the connection is established again. This will work oke for MQTT and Influxdb. For PVoutput this can cause problems while the inverter will try to sent all the buffered data in a short time and then you will hit the update limits of PVOutput.

gajotnt commented 1 year ago

@muppet3000 can this be added to your HA addon? :)

daath commented 1 year ago

Looks like my communication has been restored, and my inverters now show up in Home Assistant, though there is a huge gap in the data, although kWh generated today is there ... It was a yet another good day for solar in Denmark: 42.6 kWh generated on a 6.6 kWp westward pointing setup 🤪

muppet3000 commented 1 year ago

@johanmeijer - Thank you for the detailed response I now understand the situation. I'll take a look at the Grottserver option and see if there's something clever I can do (and return a PR for) so that it can intelligently determine if the growatt servers are online and use those if possible (for people that want to maintain connectivity to the growatt servers) and if they are unavailable then divert to using the grottserver. It will take me a bit of time to work out a clean way of doing it, but I think it would be quite an elegant solution.

@gajotnt - I don't maintain that add-on, I maintain the home assistant integration for MQTT here: https://github.com/muppet3000/homeassistant-grott

I also have my communication restored (about 1 hour ago, 21:00 UK time, 20:00 UTC) and everything is working nicely again.

gajotnt commented 1 year ago

@muppet3000 sorry I mixed up your integration with the addon --'

muppet3000 commented 1 year ago

@muppet3000 sorry I mixed up your integration with the addon --'

No problem, you can actually use my integration to have all the data from MQTT presented nicely in HA and egguy's one to run grott. I need to update the documentation to describe that to everyone as it's really useful.

gajotnt commented 1 year ago

@muppet3000 sorry I mixed up your integration with the addon --'

No problem, you can actually use my integration to have all the data from MQTT presented nicely in HA and egguy's one to run grott. I need to update the documentation to describe that to everyone as it's really useful.

At the time I went with the addon because it was way simpler, no need to setup, docker. Will try your integration to check it out :)

muppet3000 commented 1 year ago

@muppet3000 sorry I mixed up your integration with the addon --'

No problem, you can actually use my integration to have all the data from MQTT presented nicely in HA and egguy's one to run grott. I need to update the documentation to describe that to everyone as it's really useful.

At the time I went with the addon because it was way simpler, no need to setup, docker. Will try your integration to check it out :)

Yeah I completely understand that situation, I don't run a version of HA that supports the use of add-ons so I made the integration so it could be used with every version of HA. Ultimately it's just consuming and formatting the data from MQTT but in the future I plan to extend it for configuring the inverter via HA as well (once I've proven we can do config via grott).

Yogi4301 commented 1 year ago

Actually growatt is down again - I get error 110 like last time

gajotnt commented 1 year ago

Moving to solar Assistant.

gajotnt commented 1 year ago

Just finished installing Solar Assistant... never going back to ShinePhone/Growattserver

daath commented 1 year ago

Solar Assistant looks cool, but AFAIK it doesn't work well with multiple inverters, if they are different models ...