Skip to content
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

Add support for Vauno EN8822C - working #2231

Merged
merged 14 commits into from
Jan 22, 2023

Conversation

loopy321
Copy link
Contributor

@loopy321 loopy321 commented Nov 7, 2022

Fixed up temperature, humidity, and checksum. Tested and working on my system.

@loopy321 loopy321 changed the title Test vauno Add support for Vauno EN8822C - working Nov 7, 2022
@loopy321
Copy link
Contributor Author

loopy321 commented Nov 9, 2022

Trying to add the battery bits for the device. I have found the battery bit in two places as follows (I think byte 1, bit 1 and byte 4, bit 4):

Frame structure (42 bits):

    Byte:      0        1        2        3        4
    Nibble:    1   2    3   4    5   6    7   8    9   10   11
    Type:      IIIIIIII B?CCTTTT TTTTTTTT HHHHHHHF FFFBXXXX XX

- I: Random device ID
- C: Channel (1-3)
- T: Temperature (Little-endian)
- H: Humidity (Little-endian)
- F: Flags (unknown)
- B: Battery (1=low voltage ~2.5V)
- X: Checksum (6 bit nibble sum)

As shown in the bitbench here.

Any suggestions for how to properly calculate the checksum with the bad battery bit?
In bitbench, length of 36, width 4 appears to give good results (vs. prior 32/4), so I guess I need to add the next 4 bits.
Obviously the current add_nibbles(b, 4) does not work when bad_bat=1.

@zuckschwerdt
Copy link
Collaborator

Add a single nibble like this: add_nibbles(b, 4) + (b[4] >> 4)

@loopy321
Copy link
Contributor Author

loopy321 commented Nov 9, 2022

Thanks! Fixed and working.

@gumbald
Copy link
Contributor

gumbald commented Nov 9, 2022

Am I OK to close my PR, that doesn't break this one?

@zuckschwerdt
Copy link
Collaborator

@gumbald yes, I guess @loopy321's changes are preferred now.

@clinta
Copy link

clinta commented Nov 14, 2022

I've been testing this for a couple of days, it seemed to work until it got cold last night, and it stopped getting updates once the temperature dropped below 0C.

The receiver that came with it continued to get updates, and the receiver is near my RTL antenna, so I don't think it's a hardware issue. And once the temp got up to 0.1C this morning, it started getting updates again.

image

@loopy321
Copy link
Contributor Author

@clinta Thanks for testing! I too see some missed readings due to a bad checksum. Doing a sampling with -S unknown I see the following with correct temperatures (including negative C), but the checksum differs. However, I also see correctly decoded readings around the same time (although much less frequent).

Upon more analysis it looks like the error is in the checksum calculation:
See Bitbench corresponding to:

{42} e6 0f 26 8c 0f c0 [good : 11100110 00001111 00100110 10001100 00001111 11]
{42} e6 0f 24 8c 0f 40 [good : 11100110 00001111 00100100 10001100 00001111 01]
{42} e6 0f 29 8c 00 80 [bad  : 11100110 00001111 00101001 10001100 00000000 10]
{42} e6 0f 27 8c 00 00 [bad  : 11100110 00001111 00100111 10001100 00000000 00]
{42} e6 0f 28 8c 00 40 [bad  : 11100110 00001111 00101000 10001100 00000000 01]
ID:230 CH:0 TEMP_C: -218 HUM:070 ?00000 CRC:111111 = 111111 [good : 11100110 00001111 00100110 10001100 00001111 11]
ID:230 CH:0 TEMP_C: -220 HUM:070 ?00000 CRC:111101 = 111101 [good : 11100110 00001111 00100100 10001100 00001111 01]
ID:230 CH:0 TEMP_C: -215 HUM:070 ?00000 CRC:000010 = 1000010 [bad : 11100110 00001111 00101001 10001100 00000000 10]
ID:230 CH:0 TEMP_C: -217 HUM:070 ?00000 CRC:000000 = 1000000 [bad : 11100110 00001111 00100111 10001100 00000000 00]
ID:230 CH:0 TEMP_C: -216 HUM:070 ?00000 CRC:000001 = 1000001 [bad : 11100110 00001111 00101000 10001100 00000000 01]

So, I added & 0x3f in the checksum calculation to clear the extra bit.

See updated code with the fix that is tested and working on my setup with all checksums passing now.

@clinta
Copy link

clinta commented Nov 14, 2022

Awesome. I'll build this and see if I keep getting readings tonight.

@loopy321
Copy link
Contributor Author

Getting every 50 second reading while sampling now. Much better. @clinta Thanks for helping identify the problem! Please let me know if this improves your readings too.

@clinta
Copy link

clinta commented Nov 15, 2022

Working great now. Temperature is continuing to drop and I'm getting updates at -1.8C now.

@gumbald
Copy link
Contributor

gumbald commented Dec 6, 2022

Git continues to confuse me - has this been merged into rtl433 yet?

@zuckschwerdt
Copy link
Collaborator

Still open, sorry. I need to find time to merge a few new device PRs.

@gumbald
Copy link
Contributor

gumbald commented Dec 6, 2022

Oh, no rush - thanks for all the work you do on this!

@blezalex
Copy link

Tested on my system, works nice, thank you for a valuable contribution!

@zuckschwerdt zuckschwerdt merged commit 822ed0c into merbanan:master Jan 22, 2023
obones pushed a commit to obones/rtl_433 that referenced this pull request Jan 30, 2023
andrewjw pushed a commit to andrewjw/rtl_433 that referenced this pull request Sep 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants