01-11-2013 06:11 PM
I have a LED wall paper that i want send values too,i do not have the protocol but monitored the serial communication;
<ID01><L1><PA><FE><MA><WC><FE><AD>Test65<E>
65 is some kind of checksum digits,can anyone tell me how to calculate this?
another example where 36 is the checksum
<ID01><L1><PA><FE><MA><WC><FE>Hello36<E>
Thanks in advance
Philip
Solved! Go to Solution.
01-11-2013 06:26 PM
01-11-2013 07:19 PM
Are you sure about the first one?
01-11-2013 07:44 PM
Is this some specially formatted binary code or are these the actual strings?
Can you show us the same strings in hex format?
If these are really two digits (65 or 36) you have a 16bit checksum. It could also be a decimally formatted 1byte checksum.
01-11-2013 08:33 PM
OK, check the answers here.
01-11-2013 08:54 PM - edited 01-11-2013 08:57 PM
OK, from the link above, we need to strip the <ID01> and keep only the string up to the checksum.
THe checksum is a byte as a hexadecimal formatted string (, two characters: 00 ..FF)
I agree with Darin, the first one seems wrong and should be 0x45.
If the string is actually lowercase "test" instead of "Test", we get a 65, so check your capitalization.
<ID01><L1><PA><FE><MA><WC><FE><AD>test65<E> would be correct
<ID01><L1><PA><FE><MA><WC><FE><AD>Test45<E> would also be correct
<ID01><L1><PA><FE><MA><WC><FE><AD>Test65<E> would be incorrect <---- your example!
Here is some simple code that gives the correct result for your second string as well as for the string on the web site. See if it works for you.
The outer FOR loop iterates over the string choices, so you don't need that.
You still need to add code to strip out the correct substring according to the requirements (not shown).
01-12-2013 07:57 AM
Thanks got it working
01-12-2013 12:16 PM
You know, that <ID01> at the beginning of the string always reminded me of the popular ID10T errors. 😄