-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Failed with error: unpack requires a buffer of 2 bytes on v3.5.0 #165
Comments
Thanks for opening the issue. It led me to rework the Model 160 logic and simplify it, so now we can read M160 registers also for Trio inverters. :) Check code changes here: ee5ba3e I released a Please let me know if it works and if you also see Model 160 specific values, with previous versions you wouldn't. |
Hi @alexdelprete , Thanks for an update but still getting the same error. Here's the log from v3.5.1-beta.1.
|
Strange. I used this register map (for the TRIO-50.0-TL-OUTD): You can see that at address 40208 there's the model# register (int16), and it should be 160. Can you check with qmodmaster reading from address 40200 if at 40208 you read the 160 value? If it's not there, then the register map is not correct. |
@nonth can you please test beta.2? I noticed I was decoding int16 type but it should be an uint16. I hope that was the issue. I also added some debug log to see where it's stopping, please post the debug log like you did before. Thanks for the help. |
@alexdelprete here's a log from beta 2, It looks like it stops around line 549. Anything I can do to help from my end? Thanks!
|
Yes, it's the decode that fails and throws the error. In beta.1 it was
I modified it in
Because that register is effectively an unsigned int. So I don't know exactly why it gives you that error. In order to find out, you should use a tool like qmodmaster to navigate the registers and check at address 40208 what value you find. I expect 160, but we should verify it in order to understand. |
@alexdelprete I'll try to use qmodmaster to check the value at address 40208 and get back to you with the results. Also please bear with me as I'm still new to working with Modbus. |
@alexdelprete I'm currently trying to use qmodmaster. I can connect to my inverter, but I'm not sure how to configure the software to read the value. Here are the settings I'm using:
From settings above qmodmaster shown "Read data failed. Error Illegal data address. I'm unsure if the start address and the number of registers are set correctly. Can you assist me? |
Great, it's working. :) Can you please start at address 122 reading 80 registers, and post the screenshot? Also post result starting from address 208. We need to find the value 160. Thanks. |
address 122 read 80 registers but for address 208 got an illegal data address error And I'm wondering why the integration can still read values from the inverter even after I modified the code to skip this if block. |
Can you try from address 200 for 20 registers. |
Your system does not respect the documented register map, apparently. How many strings do you have? |
I have single 3 phase string inverter connected with 14 solar panels. |
Me too, but I have 27 panels divided on two strings. You have all 14 in 1 string? |
Yes, Right now, I’m trying to understand how to map the registers from your XLS document with the latest code. I see that offset 1104 is for UNO-DM and REACT2, and offset 208 is for TRIO. What about offset 122? From my understanding, my TRIO-5.8-TL-OUTD-S inverter with a VSN300 card has been works with offset 122. So I’ve tried using 122 as the start address in QModMaster, and I can retrieve data from the inverter (as shown in the screenshot in my previous comment). The first address block has a value of 120, which corresponds to sheet name 120 in SunSpec_PICS-ABB-TRIO-50.0-TL-OUTD. I’m not sure if I’m on the right track. Any suggestions on what I should do next, or should I try to find the Modbus register mapping for my inverter? |
We don't need Model 120, we need Model 160, which starts at offset 208 (check SunSpec_PICS-ABB-TRIO-50.0-TL-OUTD excel file, the tab 160). That model contains the values for the strings we need. |
System Health details
System Information
Home Assistant Community Store
Home Assistant Cloud
Dashboards
Recorder
Checklist
Describe the issue
Hi @alexdelprete,
I'm using an ABB TRIO-5.8-TL-OUTD-S Inverter with a VSN300 Wifi Logger Card. Everything was working fine on version 3.1.5. However, after updating the integration to version 3.5.0, I encountered the following error:
While investigating the differences between the two versions, I found that starting from version 3.3.0, the
read_sunspec_modbus_model_160
method inapi.py
included a check for multiple MPPT IDs if it's not 160. If the ID is not 160, it tries to use register address 41104 for UNO-DM-PLUS and REACT2 inverters (if I understood correctly). In my case, themulti_mppt_id
value is 120.The error
Failed with error: unpack requires a buffer of 2 bytes
occurs at line 562 inapi.py
when trying to decode from register address 41104.I temporarily fixed it by adding a check to ensure the base address is greater than 0 because your readme mentioned that the register map base address for ABB VSN300/VSN700 dataloggers is 0:
After making this change, the integration started working again. I'm not sure if this is the best solution, so I'd appreciate your advice. If it's okay, I'll open a PR.
Inverter Information:
Integration Configuration:
Reproduction steps
...
Debug logs
Diagnostics dump
No response
The text was updated successfully, but these errors were encountered: