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

Ecowitt WH32 / WN32B not decoded #2303

Closed
sombrero2003 opened this issue Jan 9, 2023 · 7 comments
Closed

Ecowitt WH32 / WN32B not decoded #2303

sombrero2003 opened this issue Jan 9, 2023 · 7 comments
Assignees
Labels
device support Request for a new/improved device decoder todo Maintainers should do something, but there is no defect

Comments

@sombrero2003
Copy link

sombrero2003 commented Jan 9, 2023

Hello,
I am running rtl_433 via the HA add-on and my ecowitt WH32 sensor is not recognized.
I noticed that the sensor id listed on the box reads WN32B and not WH32. It seems that's the new name of the WH32. Could the change of name explain the issue with the decoding?
Thanks a lot for this great piece of software

@zuckschwerdt
Copy link
Collaborator

Could be the same problem as #2274
Can you grab a sample and upload as zip here? https://triq.org/rtl_433/ANALYZE.html

@zuckschwerdt zuckschwerdt changed the title Ecowitt WH32/WN32B not decoded by rtl_433 Ecowitt WH32 / WH32B not decoded Jan 9, 2023
@sombrero2003 sombrero2003 changed the title Ecowitt WH32 / WH32B not decoded Ecowitt WN32 / WH32B not decoded Jan 10, 2023
@sombrero2003 sombrero2003 changed the title Ecowitt WN32 / WH32B not decoded Ecowitt WH32 / WN32B not decoded Jan 10, 2023
@sombrero2003
Copy link
Author

sombrero2003 commented Jan 10, 2023

Thanks. I installed rtl_433 on my mac and ran the following command
rtl_433 -f 915.05M -S unknown

I have attached the first file that is generated.
g001_915.05M_1000k.cu8.zip

The following decoder is suggested:
Use a flex decoder with -X 'n=name,m=FSK_PCM,s=57,l=57,r=58368'

However, when I run rtl_433 -R 0 -X 'n=name,m=FSK_PCM,s=57,l=57,r=58368', this does not show anything so I am probably doing something wrong.

@zuckschwerdt
Copy link
Collaborator

I assumed a typo there, but you can confirm the name of "WN32B" right? This looks much like the WH32B but the two repeats are not mashed together. Difficult to detect now wether it's
Fine Offset Electronics WH25, WH32, WH32B, WN32B / WH0290 / WH24, WH65B, HP1000 -- they are all mostly the same each with different quirks.

I need to carefully figure this out, if you just want it to work right now apply these changes and recompile.

--- a/src/devices/fineoffset.c
+++ b/src/devices/fineoffset.c
@@ -474,7 +479,10 @@ static int fineoffset_WH25_callback(r_device *decoder, bitbuffer_t *bitbuffer)
     unsigned bit_offset;

     // Validate package
-    if (bitbuffer->bits_per_row[0] < 190) {
+    if (bitbuffer->bits_per_row[0] > 160 && bitbuffer->bits_per_row[0] < 190) {
+        type = 32; // new WN32B
+    }
+    else if (bitbuffer->bits_per_row[0] < 190) {
         return fineoffset_WH0290_callback(decoder, bitbuffer); // abort and try WH0290
     } else if (bitbuffer->bits_per_row[0] < 440) {  // Nominal size is 488 bit periods
         return fineoffset_WH24_callback(decoder, bitbuffer); // abort and try WH24, WH65B, HP1000
@@ -487,7 +495,7 @@ static int fineoffset_WH25_callback(r_device *decoder, bitbuffer_t *bitbuffer)
     // Find a data package and extract data payload
     // Normal index of WH25 is 367, and 123, 570 for WH32B
     // skip some bytes to find faster
-    bit_offset = bitbuffer_search(bitbuffer, 0, 100, preamble, sizeof(preamble) * 8) + sizeof(preamble) * 8;
+    bit_offset = bitbuffer_search(bitbuffer, 0, 0, preamble, sizeof(preamble) * 8) + sizeof(preamble) * 8;
     if (bit_offset + sizeof(b) * 8 > bitbuffer->bits_per_row[0]) {  // Did not find a big enough package
         decoder_logf_bitbuffer(decoder, 1, __func__, bitbuffer, "short package. Header index: %u", bit_offset);
         return DECODE_ABORT_LENGTH;

@zuckschwerdt zuckschwerdt added the todo Maintainers should do something, but there is no defect label Jan 10, 2023
@sombrero2003
Copy link
Author

Thanks a lot. This works great.
As far as the sensor is concerned, I purchased a WH32 Outdoor coded (https://shop.ecowitt.com/products/wh32-outdoor) but on the back it does read WN32B.
As per this thread https://www.wxforum.net/index.php?topic=44754.0, the N seems to mean "no solar panel"

@gdt gdt added enhancement Request to add a feature (other than a decoder) feedback request for more information; may be closed id 30d if not received and removed todo Maintainers should do something, but there is no defect labels Sep 26, 2023
@gdt
Copy link
Collaborator

gdt commented Sep 26, 2023

A lot has been improved. Please retest with current git master.

@sombrero2003
Copy link
Author

I don't think these sensors have been included in the master. I have kept using the code changes suggested by zuckschwerdt with no issue (https://github.com/sombrero2003/rtl_433/tree/fix_wh32).

@zuckschwerdt zuckschwerdt self-assigned this Oct 28, 2023
@zuckschwerdt zuckschwerdt added todo Maintainers should do something, but there is no defect device support Request for a new/improved device decoder and removed enhancement Request to add a feature (other than a decoder) feedback request for more information; may be closed id 30d if not received labels Oct 28, 2023
@Quick67
Copy link

Quick67 commented Dec 24, 2023

Hello, no news on when this fix will be present in the release? thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
device support Request for a new/improved device decoder todo Maintainers should do something, but there is no defect
Projects
None yet
Development

No branches or pull requests

4 participants