Author Topic: Trying to read WH57 using rtl_433  (Read 722 times)

0 Members and 1 Guest are viewing this topic.

Offline watsonm

  • Member
  • *
  • Posts: 38
Trying to read WH57 using rtl_433
« on: July 02, 2022, 09:03:41 AM »
I am using rtl_433 to read various sensors including the WH57C  Thunder and Lightning sensor.
RTL_433 publishs the data on my HiveMQ broker but I am puzzled by the data (or lack thereof) and wonder if someone can tell me what data
turns up (preferably before the next lightning strike!!   :D   )

My unit sends the following amongst other data:
state= reset
flags = 83
strike_count = 0

So strike _count is obvious but:

1:  what do "flags" mean?
2: what does "state" mean?
3;  Where is the distance to strike?

Also a bit puzzled as to why it tx's on two frequencies... 

Grateful for any help/pointers...  Mike
Regards Mike

Raspberry Pi 4
Directly connected : BMP388 pressure sensor.  DHT22 For internal Humidity Sensor temp
Wireless connected: 3 Temperature Transmitters(WS2083), WH57  Lightning Sensor, Fine Offset Solar sensor  (stand alone)

Online Rover1822

  • Forecaster
  • *****
  • Posts: 2017
    • Mini Wind and Solar Data project
Re: Trying to read WH57 using rtl_433
« Reply #1 on: July 02, 2022, 09:15:54 AM »
What 2 frequencies?
My libraries are a bit old, so I'm not sure I can capture it, might be able to, have to switch antenna and my SDR, might do that later

Also need to understand someone in the SDR community wrote the decipher for the unit, everything is not always as it should be. Not saying that is the case here, but it does happen
Ambient:
  WS-2000
  PM 2.5(2)
  WH31B(2)
  WH40E
  WH31P
EcoWitt:
  GW1100
  GW1000(4)
  WH31(2)
  WH57
  WH51(12),
  WH40
  WH5360B
  WN34S
  WittBoy WS90 + GW2000
  WS90 (other one) + GW1100
Personal Sites: Weather Cam

Offline watsonm

  • Member
  • *
  • Posts: 38
Re: Trying to read WH57 using rtl_433
« Reply #2 on: July 02, 2022, 09:51:27 AM »
My unit displays

freq1= 433.9351
freq2= 433.8793

Even though my unit is a WH57C the decoder is based on the WH31L which I think someone on this forum posted.

Regards Mike
Regards Mike

Raspberry Pi 4
Directly connected : BMP388 pressure sensor.  DHT22 For internal Humidity Sensor temp
Wireless connected: 3 Temperature Transmitters(WS2083), WH57  Lightning Sensor, Fine Offset Solar sensor  (stand alone)

Offline davidefa

  • Forecaster
  • *****
  • Posts: 436
Re: Trying to read WH57 using rtl_433
« Reply #3 on: July 02, 2022, 10:01:39 AM »
This is an extract of file devices/fineoffset_wh31l.c ( see https://github.com/merbanan/rtl_433/blob/master/src/devices/fineoffset_wh31l.c )

Code: [Select]
Data layout:
    YY SI II II FF KK CC XX AA ?? ?
- Y: 8 bit fixed Type Code of 0x57
- S: 4 bit state indicator: 0: start-up, 1: interference, 4: noise, 8: strike
- I: 20 bit device ID
- F: 10 bit flags: (battery low seems to be the 1+2-bit on the first byte)
- K: 6 bit estimated distance to front of storm, 1 to 25 miles / 1 to 40 km, 63 is invalid/no strike
- C: 8 bit lightning strike count
- X: 8 bit CRC-8, poly 0x31, init 0x00
- A: 8 bit SUM-8
State field:
- 8: lightning strike detected
- 4: EMP noise
- 1: detection of interference
- 0: battery change / reboot

- state field is explained above
- flags field should contain battery status + other non specified informations
Your recording shows a count of 0 lightning, so no distance and no time is provided

P.S.
If you want a strike recording put your sensor near an rf noise source ( a switching power supply for example )
« Last Edit: July 02, 2022, 10:06:25 AM by davidefa »

Offline watsonm

  • Member
  • *
  • Posts: 38
Re: Trying to read WH57 using rtl_433
« Reply #4 on: July 02, 2022, 04:09:03 PM »
Thanks David...   =D>
Regards Mike

Raspberry Pi 4
Directly connected : BMP388 pressure sensor.  DHT22 For internal Humidity Sensor temp
Wireless connected: 3 Temperature Transmitters(WS2083), WH57  Lightning Sensor, Fine Offset Solar sensor  (stand alone)

Offline watsonm

  • Member
  • *
  • Posts: 38
Re: Trying to read WH57 using rtl_433
« Reply #5 on: July 03, 2022, 07:32:08 AM »
For anyone wanting the same information this is what I have discovered so far:

I have seen several changes to the state:

state = "reset"             (on power up of the WH57)
state = "interference"  (when I was trying to emulate a strike)
state = "strike"            (possibly a false positive in my case but assume this is what it changes to for real lightning strike)

strike_count = an integer that slowly increments as a strike occurs.  This is a best guess as I haven't
                      seen any lightning yet and after my initial count of 1 it stayed at 1 .  So I guess a bit
                      like the rain ticks that never goes down.

storm_dist_km  = an estimate of the distance to the strike.
flags = haven't worked these out but I have seen changes...
Regards Mike

Raspberry Pi 4
Directly connected : BMP388 pressure sensor.  DHT22 For internal Humidity Sensor temp
Wireless connected: 3 Temperature Transmitters(WS2083), WH57  Lightning Sensor, Fine Offset Solar sensor  (stand alone)

Offline Storm017

  • Senior Contributor
  • ****
  • Posts: 172
Re: Trying to read WH57 using rtl_433
« Reply #6 on: July 03, 2022, 09:07:53 AM »
Quote
strike_count = an integer that slowly increments as a strike occurs.  This is a best guess as I haven't
                      seen any lightning yet and after my initial count of 1 it stayed at 1 .  So I guess a bit
                      like the rain ticks that never goes down.


The strike_count rolls over @ 255 and start over @ 0.

For information on the AS3935 sensor is found here: https://www.mouser.com/pdfdocs/AMS_AS3935_Datasheet_v4.pdf

Offline watsonm

  • Member
  • *
  • Posts: 38
Re: Trying to read WH57 using rtl_433
« Reply #7 on: July 03, 2022, 05:18:35 PM »
Thanks for that.... good to know.

The strike_count rolls over @ 255 and start over @ 0.

For information on the AS3935 sensor is found here: https://www.mouser.com/pdfdocs/AMS_AS3935_Datasheet_v4.pdf
Regards Mike

Raspberry Pi 4
Directly connected : BMP388 pressure sensor.  DHT22 For internal Humidity Sensor temp
Wireless connected: 3 Temperature Transmitters(WS2083), WH57  Lightning Sensor, Fine Offset Solar sensor  (stand alone)

Offline Jonesy

  • Member
  • *
  • Posts: 20
Re: Trying to read WH57 using rtl_433
« Reply #8 on: July 04, 2022, 05:19:15 AM »
This is what I got out of "rtl_433 -M Level" with my new WH57 just installed outside in the included enclosure this last week. No events yet all switches are down.

model     : FineOffset-WH31L                       id        : 59975
Battery   : 1.000        State     : reset         Flags     : 0053          Strike Count: 0           Integrity : CRC
Modulation: FSK          Freq1     : 433.9 MHz     Freq2     : 433.9 MHz
RSSI      : -0.1 dB      SNR       : 25.7 dB       Noise     : -25.8 dB

The two frequencies I believe are related to modulation type FSK Frequency Shift Keying, being one frequency for one binary state and other frequency for the other binary state.

Offline watsonm

  • Member
  • *
  • Posts: 38
Re: Trying to read WH57 using rtl_433
« Reply #9 on: July 04, 2022, 10:58:38 AM »
Thanks Jonesy,

I set mine up with max sensitivity initially and got the extra params of  :

strike_count and storm_dist_km     displayed along with a state of 'noise'

Switches all down now and unit installed in top eaves of garage with an earth lead connected to
the -ve battery terminal (as suggested by one of the radio ham folk in this forum I believe)


Regards  Mike
Regards Mike

Raspberry Pi 4
Directly connected : BMP388 pressure sensor.  DHT22 For internal Humidity Sensor temp
Wireless connected: 3 Temperature Transmitters(WS2083), WH57  Lightning Sensor, Fine Offset Solar sensor  (stand alone)

Offline watsonm

  • Member
  • *
  • Posts: 38
Re: Trying to read WH57 using rtl_433
« Reply #10 on: July 18, 2022, 02:04:35 AM »
Success... WH57 picked up its' first real lightning strikes 12Km away which I heard and logged to sql database!   :D   

Code: [Select]
Timestamp                Count     distance     Temperature       Pressure Humidity RainLH State
2022-07-17 21:19:14.000       1         12              21.2          1022.46     38          0 strike
2022-07-17 22:41:04.000       2         24              20.1          1022.5     44          0 strike

Regards Mike

Raspberry Pi 4
Directly connected : BMP388 pressure sensor.  DHT22 For internal Humidity Sensor temp
Wireless connected: 3 Temperature Transmitters(WS2083), WH57  Lightning Sensor, Fine Offset Solar sensor  (stand alone)