Hi Felix,
It’s great to hear someone’s actually got this working. I’ve hit a brick wall and would like to ask you for a huge favour … please.
If you could load the following encrypted data (cipher) into your application, and decrypt it using my initialisation vector and encryption key. The data is from my MPPT 100/30 Solar Charger:
cipher = 0x66,0xC7,0x15,0x10,0x21,0x11,0x4B,0x58,0xB8,0x62,0x42,0xF1 (12 bytes HEX)
iv = 0x43,0x05
my key = 0x33,0x9a,0x28,0x9d,0x08,0x61,0xe8,0x34,0x16,0xe5,0x8d,0xb7,0x58,0x33,0xdc,0x0a (16 bytes)
To progess my issue I need:
- the resulting unencrypted 12 bytes of clear data
- and ideally what values your app reports for the state of the charger.
As a guide, this was the state of my Solar Charger when I recorded the above cipher:
Device State = Float
Charger Error = none
Batt Voltage = 27.00 V (approx)
Batt Current = 2.3 A (approx)
Yield today = 1.06 kWh (approx)
PV Power = 65 W (approx)
Load current = 0 A
I’m expecting your app to report values very close to the above
many thanks in advance
best regards
Chris Jennings
PS: Some additional background info, FYI only …
I had a look at your Rust code (thanks). I’ve never used Rust so I can only get a few clues.
I’m developing in C++ for Arduino compatible hardware and I’ve also built an encyption/decyrption routine based on the “Extra Manufacturer Data” document, “Solar Charger” section on Page 3 and other info I found on the old Victron fourm.
When I generate a (fictitious) data string according to the bit-field spec, then encrypt, then decrypt, I get the original data back, as expected. So it “appears” to be working … however … when I use it to decrypt real data I don’t get the expected results.
Basically I’m not sure if:
- my program isn’t decrypting the data correctly
- my program isn’t disassembling the data correctly
- the Victron “Extra Manufacturer Data” document has an error, or is incomplete.
- something else I haven’t thought of !