-
Notifications
You must be signed in to change notification settings - Fork 58
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
Model 11 MAC address broken? #41
Comments
If we look at the official Python implementation of a SunSpec client it looks like an def data_to_eui48(data):
if sys.version_info < (3,):
data = [ord(x) for x in data]
value = False
for i in data:
if i != 0:
value = True
break
if value and len(data) == 8:
return '%02X:%02X:%02X:%02X:%02X:%02X' % (
data[2], data[3], data[4], data[5], data[6], data[7]) def eui48_to_data(eui48):
return (b'\x00\x00' + base64.b16decode(eui48.replace(':', ''))) But yeah, Additionally, this model doesn't seem to follow alignment suggestions.
So either another 16-bit value should be moved before And finally, I wouldn't generally expect a Modbus exception when reading a group of registers which are a subset of another group you can read. Modbus shouldn't care if you are reading only the first three out of four registers that make up |
Great, in-depth answer, thank you very much! As for
I wouldn't know but can tell you that I've seen this behaviour in 5 different SMA devices, for whatever its worth... |
Open items:
|
It seems like the "Not Implemented"-value for eui48 is also not defined. My first guess would have been 0x000.., since that's what string uses. However, pysunspec lists |
I think it should only check starting at the second word as the first is ignored. Couln't immediately find it in the source though. Also see sunspec/pysunspec#74 |
FYI: I have an SMA SunnyBoy 3.6 device that fills all 8 bytes with 0xFF if the MAC address is unspecified. Can someone please post a 'real' value (i.e. all 8 bytes) when it is filled? |
|
I'm trying to use gosunspec to work with an SMA grid inverter. Reading model 11 fails with a modbus exception when I try to read the first 6 words according to the model 11 definition:
It does seem to work if I read 7 words. Is it possible that the MAC should actually start at offset 4 and a padding or else be applied before it?
The text was updated successfully, but these errors were encountered: