nathanmarlor / foxess_modbus

FoxESS inverter integration. Connect directly to your FoxESS inverter (no cloud!) for real-time status and control.
MIT License
105 stars 14 forks source link

Exception Response(131, 3, IllegalAddress) with v.1.10.0b4 : Ethernet connected Inverter #529

Open Carl-mgb66 opened 5 months ago

Carl-mgb66 commented 5 months ago

Version of the Custom Component

v.1.10.0b4

Configuration

Standard install - H1-5.0-E Inverter connected via Ethernet
Master Version: 1.48
Slave Version: 1.02
Manager Version: 1.45

Describe the bug

A clear and concise description of what the bug is.

On installing the latest versions, on restart, initially all appears to be OK, but after a short while I get the following on the Connection Status:

Error reading registers. Type: RegisterType.HOLDING; start: 44008; count: 5; slave: 247 from tcp://192.168.50.228:502: Exception Response(131, 3, IllegalAddress)

Reverting back to v.1.9.0 fixes the problem

Debug log


2024-01-28 20:03:15.101 DEBUG (MainThread) [custom_components.foxess_modbus.modbus_controller] Reading addresses on tcp://192.168.50.228:502 247: (31000, 39)
2024-01-28 20:03:15.241 DEBUG (MainThread) [custom_components.foxess_modbus.modbus_controller] Reading addresses on tcp://192.168.50.228:502 247: (44008, 5)
2024-01-28 20:03:15.348 DEBUG (MainThread) [custom_components.foxess_modbus.modbus_controller] Modbus error when polling tcp://192.168.50.228:502 247: Exception Response(131, 3, IllegalAddress)
2024-01-28 20:03:15.491 DEBUG (MainThread) [custom_components.foxess_modbus.client.modbus_client] Closing connection to modbus on tcp://192.168.50.228:502
2024-01-28 20:03:25.529 DEBUG (MainThread) [custom_components.foxess_modbus.modbus_controller] Reading addresses on tcp://192.168.50.228:502 247: (31000, 39)
2024-01-28 20:03:25.531 DEBUG (SyncWorker_4) [custom_components.foxess_modbus.client.custom_modbus_tcp_client] Connecting to ModbusBaseClient._params(retries=3, retry_on_empty=False, close_comm_on_error=False, strict=True, broadcast_enable=False, reconnect_delay=None, source_address=None, server_hostname=None)
2024-01-28 20:03:26.653 DEBUG (MainThread) [custom_components.foxess_modbus.modbus_controller] Reading addresses on tcp://192.168.50.228:502 247: (44008, 5)
2024-01-28 20:03:26.755 DEBUG (MainThread) [custom_components.foxess_modbus.modbus_controller] Modbus error when polling tcp://192.168.50.228:502 247: Exception Response(131, 3, IllegalAddress)
2024-01-28 20:03:26.755 DEBUG (MainThread) [custom_components.foxess_modbus.modbus_controller] Writing registers for tcp://192.168.50.228:502 247: (44000, [0])

2024-01-28 20:03:35.529 DEBUG (MainThread) [custom_components.foxess_modbus.modbus_controller] Reading addresses on tcp://192.168.50.228:502 247: (31000, 39)
2024-01-28 20:03:35.644 DEBUG (MainThread) [custom_components.foxess_modbus.modbus_controller] Reading addresses on tcp://192.168.50.228:502 247: (44008, 5)
2024-01-28 20:03:35.750 DEBUG (MainThread) [custom_components.foxess_modbus.modbus_controller] Modbus error when polling tcp://192.168.50.228:502 247: Exception Response(131, 3, IllegalAddress)
2024-01-28 20:03:45.530 DEBUG (MainThread) [custom_components.foxess_modbus.modbus_controller] Reading addresses on tcp://192.168.50.228:502 247: (31000, 39)
2024-01-28 20:03:45.642 DEBUG (MainThread) [custom_components.foxess_modbus.modbus_controller] Reading addresses on tcp://192.168.50.228:502 247: (44008, 5)
2024-01-28 20:03:45.791 DEBUG (MainThread) [custom_components.foxess_modbus.modbus_controller] Modbus error when polling tcp://192.168.50.228:502 247: Exception Response(131, 3, IllegalAddress)
2024-01-28 20:03:55.531 DEBUG (MainThread) [custom_components.foxess_modbus.modbus_controller] Reading addresses on tcp://192.168.50.228:502 247: (31000, 39)
2024-01-28 20:03:55.635 DEBUG (MainThread) [custom_components.foxess_modbus.modbus_controller] Reading addresses on tcp://192.168.50.228:502 247: (44008, 5)
2024-01-28 20:03:55.747 DEBUG (MainThread) [custom_components.foxess_modbus.modbus_controller] Modbus error when polling tcp://192.168.50.228:502 247: Exception Response(131, 3, IllegalAddress)
2024-01-28 20:04:05.531 DEBUG (MainThread) [custom_components.foxess_modbus.modbus_controller] Reading addresses on tcp://192.168.50.228:502 247: (31000, 39)
2024-01-28 20:04:05.640 DEBUG (MainThread) [custom_components.foxess_modbus.modbus_controller] Reading addresses on tcp://192.168.50.228:502 247: (44008, 5)
2024-01-28 20:04:05.786 DEBUG (MainThread) [custom_components.foxess_modbus.modbus_controller] Modbus error when polling tcp://192.168.50.228:502 247: Exception Response(131, 3, IllegalAddress)
2024-01-28 20:04:05.786 WARNING (MainThread) [custom_components.foxess_modbus.modbus_controller] tcp://192.168.50.228:502 247 - 5 failed poll attempts: now not connected. Last error: Error reading registers. Type: RegisterType.HOLDING; start: 44008; count: 5; slave: 247 from tcp://192.168.50.228:502: Exception Response(131, 3, IllegalAddress)
canton7 commented 5 months ago

Interesting! Mind jumping over to https://github.com/nathanmarlor/foxess_modbus/discussions/513#discussioncomment-8274389 (so we can see all of the discussion in one place)? Thanks!

FozzieUK commented 5 months ago

Wondering if that might be because of early firmware versions, it’a working ok on my H1 with Manager 1.70

canton7 commented 5 months ago

@FozzieUK Are you using LAN, or RS485?

What's interesting is that it can write those registers, so I'm wondering whether we need to read ones in 44xxx individually.

But, please keep discussion over in #513, so we can keep everything together.

canton7 commented 5 months ago

This should be fixed in v1.10.0b6: mind giving that a try?

Gics78 commented 5 months ago

Same problem here! v1.10.0b6. HA Core (Docker) via Waveshare RS485 ethernet. Master 1.83, Slave 1.03, Comm 1.75 I use Modbus to read to Symcon and EVCC. Those work without a problem. I even closed those to rule out interference - no luck!

Is there anything I might try or doing wrong?

home-assistant_foxess_modbus_2024-02-06T20-47-02.478Z.log

canton7 commented 5 months ago

What model of inverter do you have?

Gics78 commented 5 months ago

What model of inverter do you have?

Ups, sorry: H3-10

canton7 commented 4 months ago

Try v1.10.0b7, see if that improves things.

Carl-mgb66 commented 4 months ago

Try v1.10.0b7, see if that improves things.

Installed - I'll update if I see anything.

Gics78 commented 4 months ago

Installed too, H3-10. No errors at first, then when I tried to force charge some errors showed up. But maybe I wasn't patient enough. But sure enough Foxcloud confirmed that I had changed mode from self use to backup and min Soc on Grid to 100% while trying.

Hope the debug log helps. And last but not least: Thank you very much!

home-assistant_foxess_modbus_2024-02-15T20-49-06.768Z.log

canton7 commented 4 months ago

Interesting, thanks! I'll go though that tomorrow, and how it differs from other H3s I've seen which supported that register.

What manager version do you have?

Gics78 commented 4 months ago

Master 1.83, Slave 1.03, Comm 1.75

canton7 commented 4 months ago

It's really odd. Most of the time you're failing to write register 44000, which we know should be writable on the H3. Then just sometimes it succeeds.

But, then your attempts to change Min Soc on Grid were also failing sometimes. Is that something which normally succeeds?

Carl-mgb66 commented 4 months ago

Try v1.10.0b7, see if that improves things.

Installed - I'll update if I see anything.

Seems OK - but I might move to the OpenAPI version when I have time.

Gics78 commented 4 months ago

It's really odd. Most of the time you're failing to write register 44000, which we know should be writable on the H3. Then just sometimes it succeeds.

But, then your attempts to change Min Soc on Grid were also failing sometimes. Is that something which normally succeeds?

It might be related to a kind of timeout issue: for instance when I try to set Min Soc on Grid by clicking on the up/down arrows multiple times in a row (ie 10 times from 20% to 30%) the errors pop up, but in the end Min Soc on Grid is set correctly as verified in the Cloud App. When I type in the requested % directly it works flawlessly.

MartB commented 4 months ago

I had the same issue on my H3 inverters but the latest beta is working fine. Im on a H3-12.0 and H3-6.0 with Master Firmware 1.94

MartB commented 4 months ago

Im not sure if thats fox playing around with my units or a bug in the latest beta but my Remote Control setting changed itself to disabled. Just leaving this here in case it happens to anyone else.

canton7 commented 4 months ago

What exactly do you mean by "my remote control setting"?

MartB commented 4 months ago

The one in the inverter settings called "Remote Control" Enabled | Disabled

icornish72 commented 1 month ago

I am new to FoxEss / PV etc, having had an install of H1-6.0-E-G2 and ECS batteries and Panels earlier this week. Just connected an Elfin dongle which is communicating well with the box, but I get the same error with the integration. My Versions are:- Master: 1.14 Slave: 1.02 Comm: 1.17

FozzieUK commented 1 month ago

@icornish72 your firmware versions need to be updated.

Can you ask your installer or drop an email to Fox uk service to upgrade your inverter firmware to the latest versions (for the H1 G2 they are - Master 1.22, Manager 1.37, Slave 1.02)

If you could then post back if it’s working 😉, if you are still having problems could you open a new issue and the integration version you are using so we can track it separately please.

JHolah commented 1 month ago

I had set up all my hardware (Waveshare Modbus POE connected to H1 Inverter) and set everything correctly. Had exactly the same issue as described here. After confirming everything was connected and configured correctly, only a Firmware upgrade fixed it.