-
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
Added support for LaCrosse LTV-WR1 Multi Sensor #1533
Conversation
Let's see if I got this one correct before I add the LTV-TH3. Note that this decoder outputs good wind speed/direction data but rainfall data is output 'raw_' for now until I discover the magic equation for the raw variables. |
src/devices/lacrosse_wr1.c
Outdated
data = data_make( | ||
"model", "", DATA_STRING, "LaCrosse-WR1", | ||
"id", "Sensor ID", DATA_FORMAT, "%06x", DATA_INT, id, | ||
"seq", "Sequence", DATA_FORMAT, "%01x", DATA_INT, seq, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seq
is 3 bit (0-7) a format isn't needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It has been displaying correctly during testing but if you want to change it, be my guest.
This looks really good. |
Do you want me to commit additions for LTV-TH3 to this branch or should I create a separate one? |
… 416us. Corrected data_make to change DATA_FORMAT to DATA_INT for seq variable.
I have an older Lacrosse sensor, the LTV-TH2, and since my Lacrosse C84343 base station lists both the LTV-TH2 and LTV-TH3 as compatible sensors, I took at look at this recent addition and found that it works with my LTV-TH2 with a couple of changes. First, the message length appears to be 285 bytes; greater than the 256 byte upper limit check. Secondly, the CRC transmitted by the sensor has a remainder of zero only with sequence numbers of 2 and 6. For sequence numbers of 0,1,3,4,5, and 7 the CRC is not 0, but 0xac. Maybe the message format is slightly different in the TH2? For my environment , the decoding of messages with those two changes in lacrosse_th3.c is 100% and the data returned corresponds with the temp/humidity shown on the LCD on the sensor. This works for my purposes, but I'm willing to help with a less dirty hack if needed...Aloha |
Thanks for that input. I can put out a decoder specific for the th2 but it would be helpful to have a few sample files to work with.MikeSent from Samsung Galaxy smartphone.
-------- Original message --------From: some-random-kahuna <[email protected]> Date: 11/2/20 20:33 (GMT-05:00) To: merbanan/rtl_433 <[email protected]> Cc: Mike <[email protected]>, Author <[email protected]> Subject: Re: [merbanan/rtl_433] Added support for LaCrosse LTV-WR1 Multi Sensor (#1533)
I have an older Lacrosse sensor, the LTV-TH2, and since my Lacrosse C84343 base station lists both the LTV-TH2 and LTV-TH3 as compatible sensors, I took at look at this recent addition and found that it works with my LTV-TH2 with a couple of changes. First, the message length appears to be 285 bytes; greater than the 256 byte upper limit check. Secondly, the CRC transmitted by the sensor has a remainder of zero only with sequence numbers of 2 and 6. For sequence numbers of 0,1,3,4,5, and 7 the CRC is not 0, but 0xac. Maybe the message format is slightly different in the TH2? For my environment , the decoding of messages with those two changes in lacrosse_th3.c is 100% and the data returned corresponds with the temp/humidity shown on the LCD on the sensor. This works for my purposes, but I'm willing to help with a less dirty hack if needed...Aloha
—You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub, or unsubscribe.
|
Hi Mike, Here are two. The g001 file is a capture that has a sequence of 5 and a CRC of 0xac. The g002 file is a capture that has a sequence of 6 and a CRC of 0x00: $ rtl_433 -s 1000k -X 'n=th2, m=FSK_PCM, s=104, l=104, r=9600' g001_915M_1000k.cu8 time : @0.073940s time : @0.073940s time : @0.073945s time : @0.073945s |
I just opened the samples. It looks like the bit length is 107us, not 104us like the th3 uses. That might explain the difference with the crc. Let me work on decoder and see if thats all that is different.
|
If there is a sufficient preamble (like the |
That's good to know. Thanks. I cloned the TH3 and made some changes for the CRC check. The resulting th2 source is attached if he wants to build it and try it out before I commit it.
Mike
… On 11/03/2020 4:31 PM Christian W. Zuckschwerdt ***@***.***> wrote:
If there is a sufficient preamble (like the 55555555555555s here) the slicer will automatically pick that up. You could use 80 µs or 150 µs and it will still work.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub #1533 (comment) , or unsubscribe https://github.com/notifications/unsubscribe-auth/AQZP6GJ2UEADIN2ZQ2RGCE3SOBZCHANCNFSM4S5SWPNQ .
|
Happy to check it on my HW, but I'm not seeing the attachment. |
lacrosse_th2.c (5.9KB) is attached.
… On 11/03/2020 7:58 PM some-random-kahuna ***@***.***> wrote:
Happy to check it on my HW, but I'm not seeing the attachment.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub #1533 (comment) , or unsubscribe https://github.com/notifications/unsubscribe-auth/AQZP6GPY3H2ITEFTAUPU2Y3SOCRKXANCNFSM4S5SWPNQ .
|
Please send me a PM at [email protected]. Github is not allowing me to attach a .c file to emails. |
If it's just changes for the CRC you might consider checking both in the TH3 code an then toggle the |
According to Mark, the CRC only differs for packet sequences 2 & 6. I only had a seq 5 & 6 to work with so can only confirm for those two. That said, the change i came up with only has CRC to use as a discriminater because packet length for both devices is the same. So I can only reliably predict model on seq #2 & #6. Now, if the slicer would expose the real bit width, that would give me a better way to determine model (in this case). Unfortunately, I don't see a way to check that.Mike
|
Sorry, I was up late watching election results and suffering brain fog this morning because of it.I can determine model reliably for all sequences EXCEPT #2 & #6. My thinking is that a separate decoder for these two is probably the best option. A couple weeks ago I was thinking its odd that there is no model info embedded in the packet. What would happen if my neighbor bought a different model from LaCrosse that my console heard and thought it recognized? How would you pair the console to sensor? So I was wondering if LaCrosse didn't actually take that into consideration and somehow encode model info into that barcoded device ID? It would take a pool of ID numbers for various models to figure that out... not sure its worth the time but it might need to be done. Since I wrote that decoder for the WSDTH01 a couple months ago, LaCrosse has added three more models to their web page; WSDTH02, WSDTH03 & WSDTH04. The LTV line of products is quickly expanding which might make it increasingly difficult to descriminate some models.Mike
|
Timing likely isn't a factor here. The units (receivers and sender) won't have a stable enough reference and thus just lock onto the preamble. That's suggested best practice (not that any designer there ever seems to care about best practice…) If only the CRC is the difference (and maybe some model bits we don't known about) and even the CRC can overlap (2,6 cases) then it's best to handle it in a single decoder -- having false positives is worse. Maybe even regard the TH2 as a TH3 if there isn't enough evidence to split them: model names refer to a protocol, user will known or not care what specific revision their unit is. |
Maybe that's why there's a TH3: they fixed the firmware that generated a bad CRC 25% of the time in the TH2 |
You could be right. They obviously have different people working on these designs. All use the same transmitter chip that I can tell yet each uses different preamble, packet endings, pulse widths and now CRC.Sent from Samsung Galaxy smartphone.
-------- Original message --------From: some-random-kahuna <[email protected]> Date: 11/4/20 20:10 (GMT-05:00) To: merbanan/rtl_433 <[email protected]> Cc: Mike <[email protected]>, Author <[email protected]> Subject: Re: [merbanan/rtl_433] Added support for LaCrosse LTV-WR1 Multi Sensor (#1533)
Maybe that's why there's a TH3: they fixed the firmware that generated a bad CRC 25% of the time in the TH2
—You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub, or unsubscribe.
|
Hi Mike, If you're still interested in this, I've been running your TH2 decoder for a while and have noticed at least one malformed message that made it though. The file it's going into has been awked and I don't have any other information. Would you like a few more captures to fine tune the decoder timing? 2020-11-20 03:05:16 26.700 75 Aloha, |
Hey Mark,I'm kind of puzzled as to why that happened. Being the values are clearly weird, I wonder if this a special message being sent by the sensor. I don't think it was corrupt or a timing issue as that should have caused the CRC check to fail. CRC failure should cause the packet to be dropped. Someone went into one of LTV decoders a week or two ago and put some limit checks on the values pulled for that sensor. It might have been the WSDTH. I can go back and do the same for the TH2/TH3 if you think that solution is acceptable.MikeSent from Samsung Galaxy smartphone.
-------- Original message --------From: some-random-kahuna <[email protected]> Date: 11/20/20 16:49 (GMT-05:00) To: merbanan/rtl_433 <[email protected]> Cc: Mike <[email protected]>, Author <[email protected]> Subject: Re: [merbanan/rtl_433] Added support for LaCrosse LTV-WR1 Multi Sensor (#1533)
Hi Mike,
If you're still interested in this, I've been running your TH2 decoder for a while and have noticed at least one malformed message that made it though. The file it's going into has been awked and I don't have any other information. Would you like a few more captures to fine tune the decoder timing?
2020-11-20 03:05:16 26.700 75
2020-11-20 04:05:16 226.400 302
2020-11-20 05:05:16 26.500 75
Aloha,
Mark
—You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub, or unsubscribe.
|
Using the values we should be able to convert them back to the original message, maybe something obvious pops out then? |
Good Morning Christian and Mark,
I did as Christian suggested and looked at the bit patterns. When I did Marks numbers, nothing jumped out at me at first. Then I went back and guessed that temp should have been 26.6C and humidity 75% and constructed a bit string for that pair. Comparing the two strings, it looks like 2 bits between the sync word and temp were dropped causing the values I 'expected' to be shifted left by 2. Could this be because of differences in bit timing (104us for TH3 and 107us for TH2)? Could it be only certain bit sequences cause problems when the bitbuffer is loaded? All the same, I would have expected this packet to be tossed because CRC didn't check.
Mike
… On 11/20/2020 8:10 PM Christian W. Zuckschwerdt ***@***.***> wrote:
Using the values we should be able to convert them back to the original message, maybe something obvious pops out then?
(e.g. on some decoders we assumed a value to be 8 bit but then the top bit was something like a battery flag).
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub #1533 (comment) , or unsubscribe https://github.com/notifications/unsubscribe-auth/AQZP6GIA5CAVUOR6SNKS5A3SQ4HO7ANCNFSM4S5SWPNQ .
|
Hi Mike, I've had it running for some time now without any more spurious outputs. Given that whatever is going on looks like a rare occurance, I think your suggestion of just sanity checking the temp and humidity values makes sense. Here's what I added:
__); |
Mark,That's what I had in mind. The alternative would be to try a dedicated decoder for the TH2 specifying the proper bit timing but this is a simpler solution. Let's see what Christian Z. thinks.Mike
|
The fail code shoud be SANITY not MIC :) |
Hi Christian, All good questions.
I picked the numbers based on the sensor environmental specifications mentioned earlier in the module. As for how the fields are really defined, your guess is as good as mine. Based on the operating specs, though, 2^10 seems more plausible than 2^12 for temperature and a single byte would do it for humidity. Where did the field definitions for the TH3 come from?
raw_temp is an int, so the conversion and subsequent limit check should be copacetic. I will fully agree that this is a dirty hack and that we're missing something about the bits coming in from the TH2 sensor. Suggestion? More raw captures? Aloha, -Mark |
To clarify on the |
No description provided.