-
Notifications
You must be signed in to change notification settings - Fork 30
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
GoSungrow mqtt run generates "panic: runtime error: invalid memory address or nil pointer dereference" #32
Comments
I just noticed issue #11 , which seems very closely related to this one.
which is similar to what he got but the DeviceType reported in his case by the error was 43 (he had a DeviceType 22 though listed by Here is what I get listing my devices:
I can see from the example output in your README.md that Device Type 22 represents the WiNet-S WiFi stick. My system is probably older as it has a WiFi stick that is simply referred as "WiFi" in the iSolarCloud interface, when you try a local connection and click the "manual connection" button - there are many other sticks there e.g. WiNet-S, EyeS4-EU, WiFi-P2, EyeM4, Logger1000 and similar Bluetooth devices. |
I have figured that my first error stack was generated by GoSungrow release 3.0.3, therefore the culprit is this call: tmp2 := totalDailyEnergy.GetValueFloat() - gridToLoadEnergy.GetValueFloat() These two calls of totalDailyEnergy := entries.CopyPointFromName(epp.AddString("p13199"), epp, "total_daily_energy", "Total Daily Energy (p13199)") gridToLoadEnergy := entries.GetReflect(epp.AddString("p13147")) So I checked whether those points (whatever that means) have values in my case. I first checked whether I have those points - I do!
Then I tried to pull data for 4 different days this year:
So while in May and April I have data for both points, in February I have no data for "Daily Load Consumption" (p13199) - which is what I noticed in iSolarCloud as well, and in January I have no data for either of them (I remember neglecting the inverter over the holiday and realizing that it wasn't connected to the WiFi around mid-January). I think that this explains the error, but I'm not sure what to do about it. BTW, the "Daily purchased energy" is always 0 in my case, even when there is data reported, which is obviously wrong and tells me that the system has deep installation flaws (the system came with the house when I bought it and the company that installed it is out of business - less than 6 years later). |
I have this issue too or a very similar error |
I hade the same problem.[08:53:47] INFO: Login to iSolarCloud using gateway gateway.isolarcloud.eu ... I just changed hostname from gateway.isolarcloud.eu to https://gateway.isolarcloud.eu and now it works |
I have the same error. Are there any workarounds? |
I have a potentially related issue: [19:33:34] INFO: Syncing data from gateway https://gateway.isolarcloud.eu ... goroutine 1 [running]: |
Hi HA community I got the same issue and I hope someone can help. I went through different issues before which I was able to fix, based on valuable input from some of you, but this, I can not solve unfortunately. I also tried to use the patched image as illustrated in this instruction but it did create another error, so I'm back to this situation. Thanks a lot for an suggestions what can be done to get this working. ' goroutine 1 [running]: |
Hi, got the same error here: |
Hi Mick,
GoSungrow looks awesome.
I have the same problem that you had - I am trying to get my Sungrow SH5K-20 inverter integrated in Home Assistant.
I managed to get GoSungrow to connect to the iSolarCloud API and report data back using standalone GoSungrow.
When I tried though to get it working in HomeAssistant, it fails at the
GoSungrow mqtt run
stage with the error stack below, which I got by running manually the docker entrypoint script inside the docker container.The MQTT integration works fine with the same parameters (host, user, pass) that are used by the GoSungrow add-on.
I have no experience with golang, so it's a bit tricky to even attempt to debug the panic error below - it sounds like it's a variable that's supposed to have a non-nil value and it's nil, but I'm not quite sure which one is that.
The panic seems to be triggered by a call to the GetValue function defined here: (https://github.com/MickMake/GoSungrow/blob/master/iSolarCloud/api/GoStruct/struct_reflect.go#L984)
called from somewhere around here: (https://github.com/MickMake/GoSungrow/blob/master/iSolarCloud/AppService/queryDeviceList/data.go#L427)
but the line in data.go is not the one that's in the error stack, since there is no GetValue call on line 434 in the current commit of the repo. This raises the question of which exactly is the commit of GoSungrow that is used to generate the docker image that is deployed by the add-on and I don't know the answer to that question either. This also means that even if I can add some code to avoid processing nil pointers, I don't know how to generate a new docker image with that code.
Since you mention in the README that the API changes occasionally, it could be a result of such a change.
It could also be a result of a badly configured or defective inverter, which doesn't report properly certain values.
I noticed that even in iSolarCloud, the "load" values are sometimes absent, sometimes they show up for a while, so the report is very confusing, which is one of the reasons I want to get away from it. Unfortunately, GoSungrow still relies on the data that is reported by the iSolarCloud API, so the GIGO principle will make this data useless.
Can you have a look and see if there's any obvious culprit, so I can at least get some data in HomeAssistant, even if it's missing some values (e.g. the load)?
Thanks,
Razvan
The text was updated successfully, but these errors were encountered: