-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
WEC-2103 checksum algorithm #2661
Comments
Your findings look plausible enough and entirely what we expect from those implementations :) Do the recordings in #2185 (comment) work with your checksum? |
@tommie there are some signals and decoded messages you can test the crc-4 code with. One thing I'm not sure this is a broken crc-4 checksum. Line 157 in 7a836e3
compared to it looks fairly similar. Maybe it just needs to be reflected? Ie poly 0x9. |
Re. the CRC-4, the problem is the last operation needs to be an XOR, AFAICT. The normal CRC-4 ends with the shift, which doesn't align with my samples. Though I'm by no means a CRC authority. (I go into depth of this RE process in https://tommie.github.io/a/2023/10/reverse-engineering-checksum). Confirmed the #2185 recordings pass CRC check. |
For future reference, the #2185 recordings look like this in hexadecimal:
None of them have batt-low set, but I'll assume it's the same as on my device. |
Reordering the CRC-4 in that way has the effect of "laging" the data behind: I'd say, compared to a normal CRC, this one is a nibble shorter and just xor's the last nibble (instead of CRC'ing it). |
This is my interpretation also. The original implementation should possible to use with some light change of the logic. |
In other words this is equivalent (tested):
It could be that the original CRC used operates byte-wise and the "designers" wanted to patch on a last nibble ;) |
Thanks for thinking and testing! I've updated #2662. |
#2185 added support for WEC-2103, by @tthurnreiter. It never received a resolution about the checksum.
I've spent some time figuring out the protocol of my cheap temp/humidity sensor, and it seems the protocol is identical. Here's a decoder: https://github.com/tommie/tx07k-reverse/
However, I think I also managed to figure out the checksum, though I can't be sure the WEC-2103 and my TX07K-THC (as written on the PCB) are the same. Looking at the WEC-2103 FCC internal photo, it's labeled TX07Y-THC, so very likely the same.
The checksum is a modified/broken CRC-4. I'd love to contribute that, but since I don't, technically, have a WEC-2103 to confirm this with, I'm not sure if it would be accepted. Seeking contribution guidance, or help confirming the checksum.
The text was updated successfully, but these errors were encountered: