MickMake / HomeAssistantAddons

MIT License
43 stars 26 forks source link

New panic: runtime error: invalid memory address or nil pointer dereference with version 3.0.2 #11

Open Ralphy140 opened 1 year ago

Ralphy140 commented 1 year ago

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 [10:55:15] INFO: Setting up GoSungrow config ... [10:55:16] INFO: Writing GoSungrow config ... Using config file '/data/.GoSungrow/config.json' New config: +-----------------+------------+-------------------------+--------------------------------+-----------------------------------+ | FLAG | SHORT FLAG | ENVIRONMENT | DESCRIPTION | VALUE ( = DEFAULT) | +-----------------+------------+-------------------------+--------------------------------+-----------------------------------+ | --config | | GOSUNGROW_CONFIG | GoSungrow: config file. | /data/.GoSungrow/config.json | | --debug | | GOSUNGROW_DEBUG | GoSungrow: Debug mode. | false | | --quiet | | GOSUNGROW_QUIET | GoSungrow: Silence all | false | | | | | messages. | | | --timeout | | GOSUNGROW_TIMEOUT | Web timeout. | 1m0s | | --user | -u | GOSUNGROW_USER | SunGrow: api username. | | --password | -p | GOSUNGROW_PASSWORD | SunGrow: api password. | | --appkey | | GOSUNGROW_APPKEY | SunGrow: api application key. | 93D72E60331ABDCDC7B39ADC2D1F32B3 | | | | | | | | --host | | GOSUNGROW_HOST | SunGrow: Provider API URL. | https://augateway.isolarcloud.com | | | | | | | | --token-expiry | | GOSUNGROW_TOKEN_EXPIRY | SunGrow: last login. | | | --save | -s | GOSUNGROW_SAVE | Save output as a file. | false | | --mqtt-user | | GOSUNGROW_MQTT_USER | HASSIO: mqtt username. | mqtt | | --mqtt-password | | GOSUNGROW_MQTT_PASSWORD | HASSIO: mqtt password. | | --mqtt-host | | GOSUNGROW_MQTT_HOST | HASSIO: mqtt host. | core-mosquitto | | --mqtt-port | | GOSUNGROW_MQTT_PORT | HASSIO: mqtt port. | 1883 | +-----------------+------------+-------------------------+--------------------------------+-----------------------------------+ [10:55:17] INFO: Login to iSolarCloud using gateway https://augateway.isolarcloud.com ... Email:
Create Date: Mon Sep 26 08:13:45 CST 2022 Login Last Date: 2022-12-21 18:55:17 Login Last IP:
Login State: 1 User Account:
User Id:
User Name:
Is Online: false Token: 341285_e7061706126f49adae93beb33fa29695 Token File: /data/.GoSungrow/AppService_login.json [10:55:17] INFO: Syncing data from gateway https://augateway.isolarcloud.com ... 2022/12/21 10:55:17 INFO: Connecting to MQTT HASSIO Service... 2022/12/21 10:55:17 INFO: Connecting to SunGrow... 2022/12/21 10:55:17 INFO: Found SunGrow 2 devices 2022/12/21 10:55:18 Publish - topic: 'homeassistant/sensor/GoSungrow/config' payload: '{"~":"homeassistant/sensor/GoSungrow","name":"GoSungrow","unique_id":"GoSungrow","state_topic":"~/state","device":{"identifiers":["GoSungrow"],"sw_version":"GoSungrow https://github.com/MickMake/GoSungrow","name":"GoSungrow Service","manufacturer":"MickMake","model":"SunGrow"}}' 2022/12/21 10:55:18 Publish - topic: 'homeassistant/sensor/GoSungrow/state' payload: 'ON' 2022/12/21 10:55:18 INFO: Caching Sungrow metadata... 2022/12/21 10:55:18 INFO: Cached 232 Sungrow data points... panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x2a5970] goroutine 1 [running]: GoSungrow/iSolarCloud/api/GoStruct.(
Reflect).GetValueFloat(0x0) /Users/mick/Documents/GoLang/Solar/GoSungrow/iSolarCloud/api/GoStruct/structreflect.go:977 +0x80 GoSungrow/iSolarCloud/AppService/queryDeviceList.(*EndPoint).SetPvPoints(, {{, , }}, {0x40000b6ff0, {0x40005fd0f7, 0x7}, {0xc0e0d7659dd2a919, 0x3247e95e, 0x411ec80}, ...}) /Users/mick/Documents/GoLang/Solar/GoSungrow/iSolarCloud/AppService/queryDeviceList/data.go:542 +0x910 GoSungrow/iSolarCloud/AppService/queryDeviceList.(*EndPoint).GetEnergyStorageSystem(, {0x40000b6ff0, {0x40005fd0f7, 0x7}, {0xc0e0d7659dd2a919, 0x3247e95e, 0x411ec80}, {{0x400022e640, 0x2, 0x2}}, ...}) /Users/mick/Documents/GoLang/Solar/GoSungrow/iSolarCloud/AppService/queryDeviceList/data.go:299 +0x2e0 GoSungrow/iSolarCloud/AppService/queryDeviceList.(EndPoint).GetData(_) /Users/mick/Documents/GoLang/Solar/GoSungrow/iSolarCloud/AppService/queryDeviceList/data.go:259 +0x94 GoSungrow/iSolarCloud/AppService/queryDeviceList.EndPoint.GetEndPointData(...) /Users/mick/Documents/GoLang/Solar/GoSungrow/iSolarCloud/AppService/queryDeviceList/struct.go:367 GoSungrow/iSolarCloud.(SunGrowData).CallEndpoint(, {, _}, {{0x400066af30, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...}, ...}) /Users/mick/Documents/GoLang/Solar/GoSungrow/iSolarCloud/data.go:203 +0x330 GoSungrow/iSolarCloud.(SunGrowData).getDataSinglePsIdRequired(0x40009af470, {0x2765378, 0x40001b6e00}) /Users/mick/Documents/GoLang/Solar/GoSungrow/iSolarCloud/data.go:373 +0x254 GoSungrow/iSolarCloud.(SunGrowData).GetDataSingle(0x40009af470, {0x4000360b90, 0xf}) /Users/mick/Documents/GoLang/Solar/GoSungrow/iSolarCloud/data.go:328 +0x124 GoSungrow/iSolarCloud.(SunGrowData).GetData(0x40009af470) /Users/mick/Documents/GoLang/Solar/GoSungrow/iSolarCloud/data.go:249 +0x134 GoSungrow/cmd.(CmdMqtt).Cron(0x400025e090) /Users/mick/Documents/GoLang/Solar/GoSungrow/cmd/cmd_mqtt.go:365 +0x1f4 GoSungrow/cmd.(CmdMqtt).CmdMqttRun(0x400025e090, 0x0?, {0x0?, 0x0?, 0x0?}) /Users/mick/Documents/GoLang/Solar/GoSungrow/cmd/cmd_mqtt.go:265 +0x70 github.com/spf13/cobra.(Command).execute(0x4000130600, {0x4000188170, 0x0, 0x0}) /Users/mick/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:916 +0x5e0 github.com/spf13/cobra.(Command).ExecuteC(0x4000074000) /Users/mick/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:1044 +0x368 github.com/spf13/cobra.(Command).Execute(...) /Users/mick/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:968 github.com/MickMake/GoUnify/Unify.(Commands).Execute(...) /Users/mick/go/pkg/mod/github.com/!mick!make/!go!unify/!unify@v0.0.0-20221125023651-ff4a37b1928a/struct.go:258 github.com/MickMake/GoUnify/Unify.(Unify).Execute(0x4000000a20) /Users/mick/go/pkg/mod/github.com/!mick!make/!go!unify/!unify@v0.0.0-20221125023651-ff4a37b1928a/struct.go:201 +0x304 GoSungrow/cmd.Execute(...) /Users/mick/Documents/GoLang/Solar/GoSungrow/cmd/commands.go:90 main.main() /Users/mick/Documents/GoLang/Solar/GoSungrow/main.go:11 +0x6c 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 fix-attrs successfully stopped s6-rc: info: service s6rc-oneshot-runner: stopping s6-rc: info: service s6rc-oneshot-runner successfully stopped

MickMake commented 1 year ago

Could you run this command and let me know what device types you have, or else let me know what type of solar install you have, (battery?).

GoSungrow ha lovelace

Ralphy140 commented 1 year ago

Hey Mick,

Yes it a Hybrid inverter SH5K with ~6Kw DC of panels and 13kWh of battery, Where should i run the command from as i am using the HA add-on, I can spin it up on a server if needed

Thanks

Ralphy140 commented 1 year ago

Spun the bin file at home

This is the output of the command

3c06304786da:GoSungrow-darwin_amd64$ ./GoSungrow ha lovelace Can't find DeviceType 43 attached to ps_id 1162207.

Ralphy140 commented 1 year ago

┏━━━━━━━━━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┓ ┃ Ps Key ┃ Ps Id ┃ Device Type ┃ Device Code ┃ Channel Id ┃ Serial # ┃ Factory Name ┃ Device Model ┃ ┣━━━━━━━━━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━┫ ┃ 1162207_14_1_1 │ 1162207 │ 14 │ 1 │ 1 │ B2161003623 │ SUNGROW │ SH5K-30 ┃ ┃ 1162207_22_247_1 │ 1162207 │ 22 │ 247 │ 1 │ B2161003623 │ SUNGROW │ WiFi V31 ┃

Ralphy140 commented 1 year ago

Hi Mick,

Just letting you know this is still an issue on version 3.03, not sure when you will get around to bumping the HA addon to 3.04 but would be great to check