victronenergy / venus

Victron Energy Unix/Linux OS
https://github.com/victronenergy/venus/wiki
552 stars 69 forks source link

dbus-acsystem: MultiRS devices not combined into acsystem. #1303

Closed ReinvdZee closed 2 weeks ago

ReinvdZee commented 3 weeks ago

Found on this site: the multi RS 3 phase system does not show up in the gui because there is no com.victronenergy.acsystem... service.

dbus-acsystem is throwing the following exception (note that this log is from a few days ago, probably an older version, so this may not be the problem here):

2024-06-27 10:42:28.348085500 Traceback (most recent call last):
2024-06-27 10:42:28.348087500   File "/opt/victronenergy/dbus-acsystem/ext/aiovelib/aiovelib/client.py", line 350, in set_value
2024-06-27 10:42:28.348091500     reply = await self.dbus_call(name, path, "SetValue", "v",
2024-06-27 10:42:28.348211500   File "/opt/victronenergy/dbus-acsystem/ext/aiovelib/aiovelib/client.py", line 294, in dbus_call
2024-06-27 10:42:28.348216500     reply = await self.bus.call(Message(
2024-06-27 10:42:28.348218500   File "/usr/lib/python3.8/site-packages/dbus_next/aio/message_bus.py", line 303, in call
2024-06-27 10:42:28.348221500     self._call(msg, reply_handler)
2024-06-27 10:42:28.348223500   File "/usr/lib/python3.8/site-packages/dbus_next/message_bus.py", line 588, in _call
2024-06-27 10:42:28.348253500     self.send(msg)
2024-06-27 10:42:28.348255500   File "/usr/lib/python3.8/site-packages/dbus_next/aio/message_bus.py", line 326, in send
2024-06-27 10:42:28.348259500     self._writer.schedule_write(msg, future)
2024-06-27 10:42:28.348261500   File "/usr/lib/python3.8/site-packages/dbus_next/aio/message_bus.py", line 82, in schedule_write
2024-06-27 10:42:28.348308500     self.buffer_message(msg, future)
2024-06-27 10:42:28.348310500   File "/usr/lib/python3.8/site-packages/dbus_next/aio/message_bus.py", line 78, in buffer_message
2024-06-27 10:42:28.348314500     (msg._marshall(negotiate_unix_fd=self.negotiate_unix_fd), copy(msg.unix_fds), future))
2024-06-27 10:42:28.348317500   File "/usr/lib/python3.8/site-packages/dbus_next/message.py", line 215, in _marshall
2024-06-27 10:42:28.348347500     body_block = Marshaller(self.signature, self.body)
2024-06-27 10:42:28.348351500   File "/usr/lib/python3.8/site-packages/dbus_next/_private/marshaller.py", line 8, in __init__
2024-06-27 10:42:28.348355500     self.signature_tree.verify(body)
2024-06-27 10:42:28.348357500   File "/usr/lib/python3.8/site-packages/dbus_next/signature.py", line 359, in verify
2024-06-27 10:42:28.348361500     type_.verify(body[i])
2024-06-27 10:42:28.348383500   File "/usr/lib/python3.8/site-packages/dbus_next/signature.py", line 259, in verify
2024-06-27 10:42:28.348386500     raise SignatureBodyMismatchError('Cannot serialize Python type "None"')
2024-06-27 10:42:28.348389500 dbus_next.errors.SignatureBodyMismatchError: Cannot serialize Python type "None"
2024-06-27 10:42:28.354491500 ERROR    Task exception was never retrieved
2024-06-27 10:42:28.354502500 future: <Task finished name='Task-290' coro=<Monitor.set_value() done, defined at /opt/victronenergy/dbus-acsystem/ext/aiovelib/aiovelib/client.py:348> exception=SignatureBodyMismatchError('Cannot serialize Python type "None"')>
2024-06-27 10:42:28.354509500 Traceback (most recent call last):
2024-06-27 10:42:28.354511500   File "/opt/victronenergy/dbus-acsystem/ext/aiovelib/aiovelib/client.py", line 350, in set_value
2024-06-27 10:42:28.354515500     reply = await self.dbus_call(name, path, "SetValue", "v",
2024-06-27 10:42:28.354809500   File "/opt/victronenergy/dbus-acsystem/ext/aiovelib/aiovelib/client.py", line 294, in dbus_call
2024-06-27 10:42:28.354816500     reply = await self.bus.call(Message(
2024-06-27 10:42:28.354818500   File "/usr/lib/python3.8/site-packages/dbus_next/aio/message_bus.py", line 303, in call
2024-06-27 10:42:28.354822500     self._call(msg, reply_handler)
2024-06-27 10:42:28.354824500   File "/usr/lib/python3.8/site-packages/dbus_next/message_bus.py", line 588, in _call
2024-06-27 10:42:28.354863500     self.send(msg)
2024-06-27 10:42:28.354864500   File "/usr/lib/python3.8/site-packages/dbus_next/aio/message_bus.py", line 326, in send
2024-06-27 10:42:28.354868500     self._writer.schedule_write(msg, future)
2024-06-27 10:42:28.354871500   File "/usr/lib/python3.8/site-packages/dbus_next/aio/message_bus.py", line 82, in schedule_write
2024-06-27 10:42:28.354932500     self.buffer_message(msg, future)
2024-06-27 10:42:28.354935500   File "/usr/lib/python3.8/site-packages/dbus_next/aio/message_bus.py", line 78, in buffer_message
2024-06-27 10:42:28.354938500     (msg._marshall(negotiate_unix_fd=self.negotiate_unix_fd), copy(msg.unix_fds), future))
2024-06-27 10:42:28.354942500   File "/usr/lib/python3.8/site-packages/dbus_next/message.py", line 215, in _marshall
2024-06-27 10:42:28.354971500     body_block = Marshaller(self.signature, self.body)
2024-06-27 10:42:28.354974500   File "/usr/lib/python3.8/site-packages/dbus_next/_private/marshaller.py", line 8, in __init__
2024-06-27 10:42:28.354978500     self.signature_tree.verify(body)
2024-06-27 10:42:28.354980500   File "/usr/lib/python3.8/site-packages/dbus_next/signature.py", line 359, in verify
2024-06-27 10:42:28.354983500     type_.verify(body[i])
2024-06-27 10:42:28.355002500   File "/usr/lib/python3.8/site-packages/dbus_next/signature.py", line 259, in verify
2024-06-27 10:42:28.355007500     raise SignatureBodyMismatchError('Cannot serialize Python type "None"')
2024-06-27 10:42:28.355010500 dbus_next.errors.SignatureBodyMismatchError: Cannot serialize Python type "None"

I suppose there is some invalid dbus path that is not expected to be invalid?

ReinvdZee commented 3 weeks ago

It turned out the paths /Settings/Ess/Mode and /Settings/Ess/MinimumSocLimit were invalid on all three multi RS devices. After setting them on one of the Multi RS'es, the AC system service showed up in dbus and on the gui. I don't know why the ESS settings were invalid, though. That may be an issue on the RS side.

martinbosma commented 2 weeks ago

Looks like it came from v3.40~20: image

And it was updated to v3.40~34 on 4/7/2024: image

Knowing that vecan-dbus does not have timeout on /Settings/Ess/Mode and /Settings/Ess/MinimumSocLimit and does not invalidate those items by itself, it seems to me that dbus-acsystem had copied data around, while vecan-dbus did not fetch all items yet and hence the above mentions items were still invalid. Venus v3.40\~20 included dbus-acsystem v0.6 and does not have the "do not copy invalid data" fix. This was introduced in dbus-acsystem v0.7 in Venus v3.40\~21. So, I believe this issue is an old bug and already solved.

mpvader commented 2 weeks ago

Case closed