Skip to content

Compatibility with US5000 battery #41

Open
@Benoit3

Description

@Benoit3

I belong a bank with a unique U5000C Battery. I use default settings for DIP switch.

get_protocol_version, get_manufacturer_info, get_values are inoperative and return exception.

For example with get_protocol_version:
`

import pylontech
p = pylontech.Pylontech()
print(p.get_protocol_version())
Traceback (most recent call last):
File "", line 1, in
File "/home/domotic/python-pylontech/pylontech/pylontech.py", line 242, in get_protocol_version
return self.read_frame()
File "/home/domotic/python-pylontech/pylontech/pylontech.py", line 215, in read_frame
f = self._decode_hw_frame(raw_frame=raw_frame)
File "/home/domotic/python-pylontech/pylontech/pylontech.py", line 196, in _decode_hw_frame
assert got_frame_checksum == int(frame_chksum, 16)
ValueError: invalid literal for int() with base 16: b''

`

I think issue is coming from the fact that adr=0 is not authorized and should be set to the right value (eg 0x02 in simple/default case case). With this correction, the result is:
'

import pylontech
p = pylontech.Pylontech()
print(p.get_protocol_version())
Container:
ver = b' ' (total 1)
adr = b'\x02' (total 1)
cid1 = b'F' (total 1)
cid2 = b'\x00' (total 1)
infolength = b'\x00\x00' (total 2)
info = b'' (total 0)
'
The protocol value seems to be 'space' in Ascii, so 0x20 or V2.0

I need to do same correction for get_manufacturer_info.

For get_values, it's seems to be an other problem, it's seems battery doesn't manage the "system information case"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions