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 Klimalogg/30.3180.IT Support #965

Closed
devZer0 opened this issue Jan 27, 2019 · 73 comments
Closed

Add Klimalogg/30.3180.IT Support #965

devZer0 opened this issue Jan 27, 2019 · 73 comments
Assignees
Labels
todo Maintainers should do something, but there is no defect

Comments

@devZer0
Copy link
Contributor

devZer0 commented Jan 27, 2019

is there somebody willing on supporting adding support for these sensors?
i have them running with tfrec but would like to see support in rtl_433 because it is a more capable tool.
rtl_433 does not seem to decoce anything...

i can provide any input... i have access to 5 sensors. could need some help. could also donate a sensor to the project if somebody likes...

# tfrec -D -T 1
Registering demod for TFA_1 KlimaLoggPro
Found Rafael Micro R820T tuner
AUTO GAIN
Frequency 868.2500MHz
Samplerate 1536000
START READ THREAD
#000 1548583063  2d d4 6f 44 86 44 1e 60 e0 56 7d           ID 6f44 +24.4 30%  seq e lowbat 0 RSSI 78
#001 1548583063  2d d4 39 96 85 84 2c 60 a0 56 0c           ID 3996 +18.4 44%  seq a lowbat 0 RSSI 81
#002 1548583067  2d d4 3f 14 85 22 34 60 c0 56 66           ID 3f14 +12.2 52%  seq c lowbat 0 RSSI 81
#003 1548583068  2d d4 63 41 86 26 26 60 60 56 85           ID 6341 +22.6 38%  seq 6 lowbat 0 RSSI 74
#004 1548583069  2d d4 43 56 85 76 2e 60 b0 56 c3           ID 4356 +17.6 46%  seq b lowbat 0 RSSI 81
#005 1548583073  2d d4 6f 44 86 44 1e 60 f0 56 13           ID 6f44 +24.4 30%  seq f lowbat 0 RSSI 77
#006 1548583073  2d d4 39 96 85 84 2c 60 b0 56 62           ID 3996 +18.4 44%  seq b lowbat 0 RSSI 81

# rtl_433 -f 868.25M -s 1536000 -G
rtl_433 version 18.12-71-gb8578dc branch master at 201901231237 inputs file rtl_tcp RTL-SDR
Trying conf file at "rtl_433.conf"...
Trying conf file at "/root/.rtl_433/rtl_433.conf"...
Trying conf file at "/usr/local/etc/rtl_433/rtl_433.conf"...
Trying conf file at "/etc/rtl_433/rtl_433.conf"...
Registered 114 out of 120 device decoding protocols [ 1-4 6-8 10-26 29-64 67-120 ]
rtl_433: warning: 104 "Wireless M-Bus, Mode C&T, 100kbps (-f 868950000 -s 1200000)" does not support CSV output
rtl_433: warning: 105 "Wireless M-Bus, Mode S, 32.768kbps (-f 868300000 -s 1000000)" does not support CSV output
rtl_433: warning: 106 "Wireless M-Bus, Mode R, 4.8kbps (-f 868330000)" does not support CSV output
rtl_433: warning: 107 "Wireless M-Bus, Mode F, 2.4kbps" does not support CSV output
Found Rafael Micro R820T tuner
[R82XX] PLL not locked!
Sample rate set to 1536000 S/s.
Tuner gain set to Auto.
Tuned to 868.250MHz.
@zuckschwerdt
Copy link
Collaborator

Sure, I'll take a look.
I contacted the tfrec guys on joining efforts some time ago but the project seems somewhat dormant.

@zuckschwerdt zuckschwerdt self-assigned this Jan 27, 2019
@zuckschwerdt zuckschwerdt added the todo Maintainers should do something, but there is no defect label Jan 27, 2019
@devZer0
Copy link
Contributor Author

devZer0 commented Jan 27, 2019

i would rename the issue title of baycom/tfrec#7 to better reflect the intention

@zuckschwerdt
Copy link
Collaborator

I've added NRZ-S decoding (cce293c) so support should be simple. Can you grab some (3-5) signals and add them along with a readme describing the sensor and the approx. grabbed values. S.a. https://github.com/merbanan/rtl_433_tests#contributing

@devZer0
Copy link
Contributor Author

devZer0 commented Jan 27, 2019

great. how to submit? should i fork into my own repo and then add that files and create a pull request - or better send via email to you ? (unsure, because seeing unmerged pull requests at https://github.com/merbanan/rtl_433_tests/pulls )

@zuckschwerdt
Copy link
Collaborator

PR to rtl_433_tests is prefered. Some PRs there are pending on various updates and changes, but generally we always merge directly.

@anse1
Copy link

anse1 commented Jan 28, 2019 via email

@zuckschwerdt
Copy link
Collaborator

For OOK_PCM with NRZ(S) short and long should equal, otherwise it's RZ-code. Also reset=65 says "if there is a 65 µs gap then end the packet" you rather want something like 480 there (for bursts of up to 10 equal bits).

devZer0 pushed a commit to devZer0/rtl_433_tests that referenced this issue Feb 3, 2019
@devZer0
Copy link
Contributor Author

devZer0 commented Feb 3, 2019

i collected testdata for klimalogg and have done a pull-request.

isn't that a little bit too large binary repo? checking out >1gig for adding some megabytes is rather inefficient and afair, git is not made for storing large amounts of binary data

@zuckschwerdt
Copy link
Collaborator

Nearly 5000 files, each around 200KB. Git is still well suited for that (large files wouldn't be too good, many files are ok).
But you are right, adding samples should be easier and better structured (guided, example Readme).

Ideas anyone?

@merbanan
Copy link
Owner

merbanan commented Feb 4, 2019

We could rebuild the git. That should help getting rid of some history. But other then that the only way is to thin out the sample archive. One could try to check out a subset. But I'm not sure how that would work.

@zuckschwerdt
Copy link
Collaborator

I just tested recreating the repo and it isn't any smaller. We are mostly only ever adding stuff so that sounds about right.
We could perhaps shave of 5% by removing files. But there are no obvious offenders:

find tests -type d | while read d ; do echo $(find "$d" -type f -maxdepth 1 |wc -l) $(du -sh "$d") ; done | sort -g

Even the over stuffed sample collections (the last lines there) don't weigh too heavy.

Perhaps we could set up a mostly empty branch to pull (shallow clone) and commit to? Not sure how much hassle it would be to move the new commits.

@zuckschwerdt
Copy link
Collaborator

Note that for this signal the PD_MIN_PULSE_SAMPLES needs tuning down to about 5. Even then the detection isn't very good. We really need to rework the pulse detect to work better for GFSK / CPFSK.

@merbanan
Copy link
Owner

merbanan commented Feb 4, 2019

As far as I understood the code logic the demodulated signal is low pass filtered. Then 2 estimators of the low and high level needs to converge (the symbol threshold is then just the mid point between these levels). I think that is the hardest demand of this generic demodulator. These level estimators are just set by some initial heuristics that might not be optimal for this type of signal. How to make it better is not really clear to me but in theory because we have the complete signal we can analyse the complete signal in one pass to recover optimal parameters that we use in a second bit recovery pass.

Maybe we need to move the problem to the the frequency domain. There was someone who did an OOK demod via fftw.

@zuckschwerdt
Copy link
Collaborator

I guess FFT would be really expensive. I made a note to look into wavelets for cheaper FSK, but so far I havn't delved into that. Also someday I want to try a FIR lowpass filter instead of the PD_MIN_PULSE_SAMPLES counter.

For the estimators we can perhaps use a proper mean+variance band and better see where transitions are. That would apply to (non-gaussian) OOK only. For GFSK we probably need another detector -- measuring the direction/slope of the frequency shift looks more reliable than looking at the level. I'll try to finish the modularization soon, so people can mess around with (many) different detectors easily.

@MichaelRenner
Copy link

Is there any news here? I would like to use the KlimaLOGG too. Apparently rtl_433 does not know the sensor yet.

@merbanan
Copy link
Owner

merbanan commented Apr 7, 2019

I am slowly working on a new FSK capable demodulator. If/when that is in place we will be able to better support more types of FSK signals.

@MichaelRenner
Copy link

Thanks for this info, good to know. And thank you for writing such an useful application!

@merbanan
Copy link
Owner

merbanan commented Apr 7, 2019

Try with changing PD_MIN_PULSE_SAMPLES to 5. If that works we can start figuring out the payload structure. And try to record a clear set of sample signals.

@MichaelRenner
Copy link

I gave up. Regardless of the gain settings, a lot of crap was received, sometimes with only one bit - even with a dummyload instead of an antenna. And even worse: Even with tfrec, which actually supports this device, no decode was possible.
Now I read the signals of the neighbors :-)

@pjenglund
Copy link

I am also interested in getting support for this sensor in rtl_433. I changed the PD_MIN_PULSE_SAMPLES to 5 but I could not see any noticeable difference in the output. I have six different sensors of which tfrec finds 4 continuously, one only occasionally (very rarely) and one not at all. However, they are all detected and displayed correctly by the KlimaLogg main unit. I can try to record some clean samples with different settings if there is still a need for that?

@merbanan
Copy link
Owner

Well adding a few signals (from each sensor) should be a fair contribution.

@MichaelRenner
Copy link

Well, that motivated me to keep looking for it. I found the sensor 100kHz higher than expected. I collect the data soon.

@merbanan
Copy link
Owner

The samples in the samples repository are distorted. We now have a wip fsk demod that might work with this sensor.

https://github.com/merbanan/rtl_433/tree/feat-fsk_demod_new

@tophee
Copy link

tophee commented Nov 11, 2019

How can I test this? (Sorry, if this is a dumb question. I am just getting started with rtl_433...)

@merbanan
Copy link
Owner

merbanan commented Jan 7, 2020

This signal is ASK modulated, not a FSK based one. Looks like a demodulator rework is needed to be able to decode this signal.

@merbanan
Copy link
Owner

merbanan commented Jan 7, 2020

@tophee nothing to test yet.

@merbanan
Copy link
Owner

merbanan commented Jan 7, 2020

This is highly suspicious. The tfrec project uses a FSK demod for this. The samples are all distorted, I need better samples before I do any further work.

@merbanan
Copy link
Owner

@zuckschwerdt I mainly prototype things in Octave. Anyway the tfrec code has this:

//-------------------------------------------------------------------------
// Vastly reduced mixed demodulator for FM-NRZS:
// It doesn't need to be linear, nor do we care about frequency shift direction
//-------------------------------------------------------------------------
int fm_dev_nrzs(int ar, int aj, int br, int bj)
{
	int cr=ar*br+aj*bj;

	// This limits also the max RSSI
	if (cr>1e9)
		cr=1e9;
	if (cr<-1e9)
		cr=-1e9;
	return cr;
}

ar = I[n]
aj = Q[n]
br = I[n-1]
bj = Q[n-1]

I'm not sure if it makes sense to do any further work. At least without the real sensor. And currently I'd rather work on enabling 2 fsk demods and some other parts that I need so I'm not sure sending a sensor to me is the best use of resources.

The signal could be dual tone modulated. But this puzzles me much. We might have to look at the transceiver chip or ask an expert.

@zuckschwerdt
Copy link
Collaborator

That's a very fast phase difference estimator. But it's amplitude sensitive.
Usually you want arg(x[n] × conj(x[n-1])), e.g. here atan2(aj×br-ar×bj, ar×br+aj×bj)

So they are looking at the FSK. I can't seem to get anything from that. At least with the DC hitting samples. I wouldn't expect a OOK to be visible? Maybe an artifact of DC correction or such. We do need samples at lower gain and with a frequency offset.

@zuckschwerdt
Copy link
Collaborator

zuckschwerdt commented Feb 20, 2020

Ah, wait, with that crude estimation they (unintentionally?) do look at the OOK…

@merbanan
Copy link
Owner

The calling code calculates how many 1-bit duration's fit between the "OOK" pulses. I do the same in my code but this is unfiltered whole rtl_433 uses and IIR filter.

cr=arbr+ajbj; -> i[n]*i[n-1] + q[n]*q[n-1] -> ~ I^2 + Q^2

That is the same as rtl_433 uses to demodulate OOK.

For some reason that works, but looking at a frequency spectrum one can see 2 frequencies present. But looking at the waveform both frequencies are present at the same time at least when one of the bits are transmitted.

@zuckschwerdt
Copy link
Collaborator

zuckschwerdt commented Feb 21, 2020

If you use x[n] and x[n-1] then you are looking at (FSK) phase differences. If you want a (OOK) amplitude that's xr[n]^2+xj[n]^2, and for the magnitude it's sqrt(xr[n]^2+xj[n]^2).

@merbanan
Copy link
Owner

I know I just thought that at 1.5Ms that n~=n-1. But the difference might be 4. Anyway I figured out the signal. Octave code follows:

m=0:0.0003:3*2*pi;
l=0:0.0001:2*pi;
sig=sin(l)+sin(m);
plot(l,sig)

Klimalogg_signal.pdf

This matches what is seen when looking at the signal visually. And it makes sense for this type of device. There is a carrier always transmitted at Y Hz when a one symbol is transmitted and 3*YHz+YHz (actually modulated 2 times) when a zero symbol is transmitted (with a slowly drifting phase). What can this be called, maybe OOK added with a carrier. From the Audacity frequency analyzer I get 555Hz on the lower frequency and 1670Hz on the high frequency. This confirms the frequency difference of 3 times.

So what to do from here?

@merbanan
Copy link
Owner

The Hz values are from defauls of 44100Hz with working with Audacity. The times 3 factor should still be valid. And a PSK demodulator might work. Or high-pass filter and then a envelope detector.

@zuckschwerdt
Copy link
Collaborator

The plot is time vs. amplitude in the I (or Q) signal? I don't grasp how changing the carrier frequency affects the amplitude. Are the 0-amplitude parts the edges of the data or are they one of the bits?

@merbanan
Copy link
Owner

Well I only figured out how the signal was generated on the transmitter side. There is no amplitude changes in reality just this addition of a sine wave with a times 3 frequency. When you do an envelope estimation it doesnt match how we expect a transmission would look. A sin(x) is the modell we assume. The estimation recovers the A. And we have sin(x)+sin(3x).

@merbanan
Copy link
Owner

Ok, the above description might be wrong but not so far away, by looking at the signal there are parts that look like a pure sine wave and others that looks like a sine wave + sine wave at an offset.

@merbanan
Copy link
Owner

If you apply a band-pass filter to the offset signal (ie get rid of the carrier) it becomes very clear that the offset signal turns on and off (OOK). But how to do generic pulse recovery is highly unclear to me.

Anyway

env(i) = in_i(i)*in_i(i-4) + in_q(i)*in_q(i-4);
env(i) = in_i(i)*in_i(i) + in_q(i)*in_q(i);

gives almost the same pulse output.

@merbanan
Copy link
Owner

Klimalogg_demod.pdf

@alxlo
Copy link

alxlo commented Feb 25, 2020

In the hope that this will be helpful, here are some more samples taken with varying gain settings via
rtl_433 -S unknown -g <40,35,30,25,20,15,10> -f 868250000

2020-02-23_samples.zip

Setup and conditions where as follows. This was a place where no or minimal interference with other sensors should occur. There might be interference from other strong radio sources due to an airport nearby.

ID type °C / %rH
before
°C / %rH
after
location
0cde 30.3180 11.1 / 81 11.5 / 80 4m away, through wooden wall/window
0706 30.3180 8.4 / 79 8.5 / 81 14m away, outside tool shed, through 2 wooden walls
081a 30.3180 9.4 / 73 9.4 / 74 5m away, adjacent room through 2 wooden walls
0642 30.3180 ? / ? ? / ? 7m, enclosed outside supply duct
04c9 30.3181 11.7 / --- 12.1 / --- 2m, same room

04c9 has no humidity sensor, only an external temp sensor.

The Dostmann base station has reliable reception of all sensors except 0642, that is located in a very unsuitable place and is planned to be replaced with 04c9.

Tests with 'tfrec' had serious trouble picking up the sensors which came as a surprise, as in another setup it produced quite good results . As 04c9 was so close, reception was only possible with -g 20. 081a could only be received in auto gain mode. I still wonder why there was no reception of 0cde at all. 0706 should technically be not that hard to receive, but there were no signs of it whatsoever.

Terminal output for measurements was

> ./tfrec -D -g 25
Registering demod for TFA_1 KlimaLoggPro
Registering demod for TFA_2 sensors, 17240 bit/s
type 0x1: Samples per bit: 22.3
Registering demod for TFA_3 sensors, 9600 bit/s
type 0x2: Samples per bit: 40.0
Found Rafael Micro R820T tuner
GAIN 25.4
Frequency 868.2500MHz
Samplerate 1536000
START READ THREAD
#000 1582457458  2d d4 04 c9 85 18 6a 60 00 56 8d           TFA1 ID 04c9 +11.8 0% seq 0 lowbat 0 RSSI 77
#001 1582457468  2d d4 04 c9 85 18 6a 60 00 56 8d           TFA1 ID 04c9 +11.8 0% seq 0 lowbat 0 RSSI 77
#002 1582457479  2d d4 04 c9 85 18 6a 60 00 56 8d           TFA1 ID 04c9 +11.8 0% seq 0 lowbat 0 RSSI 77
#003 1582457489  2d d4 04 c9 85 18 6a 60 00 56 8d           TFA1 ID 04c9 +11.8 0% seq 0 lowbat 0 RSSI 77
#004 1582457499  2d d4 04 c9 85 18 6a 60 00 56 8d           TFA1 ID 04c9 +11.8 0% seq 0 lowbat 0 RSSI 77
#005 1582457509  2d d4 04 c9 85 18 6a 60 00 56 00           TFA1 BAD 1 RSSI 77 (CRC 00 8d)

##############################################################

> ./tfrec -D 
Registering demod for TFA_1 KlimaLoggPro
Registering demod for TFA_2 sensors, 17240 bit/s
type 0x1: Samples per bit: 22.3
Registering demod for TFA_3 sensors, 9600 bit/s
type 0x2: Samples per bit: 40.0
Found Rafael Micro R820T tuner
AUTO GAIN
Frequency 868.2500MHz
Samplerate 1536000
START READ THREAD
#000 1582457612  2d d4 04 c9 05 33 a8 81 01 b0 f2           TFA1 BAD 1 RSSI 79 (CRC f2 7e)
#001 1582457615  2d d4 08 1a 04 14 49 60 00 56 fc           TFA1 BAD 2 RSSI 69 (CRC fc a3)
#002 1582457625  2d d4 08 1a 84 94 49 60 00 56 fc           TFA1 ID 081a +9.4 73% seq 0 lowbat 0 RSSI 68
#003 1582457636  2d d4 08 1a 84 94 49 40 00 56 fc           TFA1 BAD 3 RSSI 67 (CRC fc 85)
#004 1582457642  2d d4 08 22 8e c0 0c 6a 60 00 56           TFA1 BAD 4 RSSI 80 (CRC 56 73)
#005 1582457646  2d d4 08 1a 84 94 01 60 00 56 fc           TFA1 BAD 5 RSSI 67 (CRC fc 00)
#006 1582457657  2d d4 08 1a 84 94 49 60 00 56 fc           TFA1 ID 081a +9.4 73% seq 0 lowbat 0 RSSI 67

##############################################################

> rtl_433 -S unknown -g 40 -f 868250000
rtl_433 version 19.08-235-ge49f53c branch master at 202002161316 inputs file rtl_tcp RTL-SDR
Use -h for usage help and see https://triq.org/ for documentation.
Trying conf file at "rtl_433.conf"...
Trying conf file at "/home/bigalex/.config/rtl_433/rtl_433.conf"...
Trying conf file at "/usr/local/etc/rtl_433/rtl_433.conf"...
Trying conf file at "/etc/rtl_433/rtl_433.conf"...
Registered 122 out of 149 device decoding protocols [ 1-4 8 11-12 15-17 19-21 23 25-26 29-36 38-60 63 67-71 73-100 102-105 108-116 119 121 124-128 130-149 ]
Found Rafael Micro R820T tuner
Exact sample rate is: 1000000.026491 Hz
[R82XX] PLL not locked!
Sample rate set to 1000000 S/s.
Tuner gain set to 40.200000 dB.
Tuned to 868.250MHz.
*** Saving signal to file g001_868.25M_1000k.cu8 (39858 samples, 131072 bytes)
*** Saving signal to file g002_868.25M_1000k.cu8 (52826 samples, 131072 bytes)
*** Saving signal to file g003_868.25M_1000k.cu8 (39859 samples, 131072 bytes)
*** Saving signal to file g004_868.25M_1000k.cu8 (82556 samples, 262144 bytes)
*** Saving signal to file g005_868.25M_1000k.cu8 (39858 samples, 131072 bytes)
*** Saving signal to file g006_868.25M_1000k.cu8 (82546 samples, 262144 bytes)
*** Saving signal to file g007_868.25M_1000k.cu8 (39859 samples, 131072 bytes)
*** Saving signal to file g008_868.25M_1000k.cu8 (81786 samples, 262144 bytes)
*** Saving signal to file g009_868.25M_1000k.cu8 (39859 samples, 131072 bytes)
*** Saving signal to file g010_868.25M_1000k.cu8 (82046 samples, 262144 bytes)
^CSignal caught, exiting!

##############################################################

> rtl_433 -S unknown -g 35 -f 868250000
rtl_433 version 19.08-235-ge49f53c branch master at 202002161316 inputs file rtl_tcp RTL-SDR
Use -h for usage help and see https://triq.org/ for documentation.
Trying conf file at "rtl_433.conf"...
Trying conf file at "/home/bigalex/.config/rtl_433/rtl_433.conf"...
Trying conf file at "/usr/local/etc/rtl_433/rtl_433.conf"...
Trying conf file at "/etc/rtl_433/rtl_433.conf"...
Registered 122 out of 149 device decoding protocols [ 1-4 8 11-12 15-17 19-21 23 25-26 29-36 38-60 63 67-71 73-100 102-105 108-116 119 121 124-128 130-149 ]
Found Rafael Micro R820T tuner
Exact sample rate is: 1000000.026491 Hz
[R82XX] PLL not locked!
Sample rate set to 1000000 S/s.
Tuner gain set to 36.400000 dB.
Tuned to 868.250MHz.
*** Saving signal to file g011_868.25M_1000k.cu8 (39858 samples, 131072 bytes)
*** Saving signal to file g012_868.25M_1000k.cu8 (80755 samples, 262144 bytes)
*** Saving signal to file g013_868.25M_1000k.cu8 (39858 samples, 131072 bytes)
*** Saving signal to file g014_868.25M_1000k.cu8 (33319 samples, 131072 bytes)
*** Saving signal to file g015_868.25M_1000k.cu8 (39858 samples, 131072 bytes)
*** Saving signal to file g016_868.25M_1000k.cu8 (83057 samples, 262144 bytes)
*** Saving signal to file g017_868.25M_1000k.cu8 (39858 samples, 131072 bytes)
*** Saving signal to file g018_868.25M_1000k.cu8 (81016 samples, 262144 bytes)
*** Saving signal to file g019_868.25M_1000k.cu8 (39858 samples, 131072 bytes)
*** Saving signal to file g020_868.25M_1000k.cu8 (81016 samples, 262144 bytes)
^CSignal caught, exiting!

##############################################################

> rtl_433 -S unknown -g 30 -f 868250000
rtl_433 version 19.08-235-ge49f53c branch master at 202002161316 inputs file rtl_tcp RTL-SDR
Use -h for usage help and see https://triq.org/ for documentation.
Trying conf file at "rtl_433.conf"...
Trying conf file at "/home/bigalex/.config/rtl_433/rtl_433.conf"...
Trying conf file at "/usr/local/etc/rtl_433/rtl_433.conf"...
Trying conf file at "/etc/rtl_433/rtl_433.conf"...
Registered 122 out of 149 device decoding protocols [ 1-4 8 11-12 15-17 19-21 23 25-26 29-36 38-60 63 67-71 73-100 102-105 108-116 119 121 124-128 130-149 ]
Found Rafael Micro R820T tuner
Exact sample rate is: 1000000.026491 Hz
[R82XX] PLL not locked!
Sample rate set to 1000000 S/s.
Tuner gain set to 32.800000 dB.
Tuned to 868.250MHz.
*** Saving signal to file g021_868.25M_1000k.cu8 (80755 samples, 262144 bytes)
*** Saving signal to file g022_868.25M_1000k.cu8 (39857 samples, 131072 bytes)
*** Saving signal to file g023_868.25M_1000k.cu8 (81275 samples, 262144 bytes)
*** Saving signal to file g024_868.25M_1000k.cu8 (39858 samples, 131072 bytes)
*** Saving signal to file g025_868.25M_1000k.cu8 (80755 samples, 262144 bytes)
*** Saving signal to file g026_868.25M_1000k.cu8 (41910 samples, 131072 bytes)
*** Saving signal to file g027_868.25M_1000k.cu8 (80755 samples, 262144 bytes)
*** Saving signal to file g028_868.25M_1000k.cu8 (39858 samples, 131072 bytes)
*** Saving signal to file g029_868.25M_1000k.cu8 (80755 samples, 262144 bytes)
*** Saving signal to file g030_868.25M_1000k.cu8 (39859 samples, 131072 bytes)

##############################################################

> rtl_433 -S unknown -g 25 -f 868250000
rtl_433 version 19.08-235-ge49f53c branch master at 202002161316 inputs file rtl_tcp RTL-SDR
Use -h for usage help and see https://triq.org/ for documentation.
Trying conf file at "rtl_433.conf"...
Trying conf file at "/home/bigalex/.config/rtl_433/rtl_433.conf"...
Trying conf file at "/usr/local/etc/rtl_433/rtl_433.conf"...
Trying conf file at "/etc/rtl_433/rtl_433.conf"...
Registered 122 out of 149 device decoding protocols [ 1-4 8 11-12 15-17 19-21 23 25-26 29-36 38-60 63 67-71 73-100 102-105 108-116 119 121 124-128 130-149 ]
Found Rafael Micro R820T tuner
Exact sample rate is: 1000000.026491 Hz
[R82XX] PLL not locked!
Sample rate set to 1000000 S/s.
Tuner gain set to 25.400000 dB.
Tuned to 868.250MHz.
*** Saving signal to file g031_868.25M_1000k.cu8 (245330 samples, 524288 bytes)
*** Saving signal to file g032_868.25M_1000k.cu8 (49847 samples, 131072 bytes)
*** Saving signal to file g033_868.25M_1000k.cu8 (33283 samples, 131072 bytes)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
time      : 2020-02-23 12:42:13
Model     : Oregon-SL109H Id        : 0
Channel   : 3            Celsius   : 0.00 C        Humidity  : 0 %
Status    : 0            Integrity : CHECKSUM
*** Saving signal to file g034_868.25M_1000k.cu8 (80504 samples, 262144 bytes)
*** Saving signal to file g035_868.25M_1000k.cu8 (49847 samples, 131072 bytes)
*** Saving signal to file g036_868.25M_1000k.cu8 (80504 samples, 262144 bytes)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
time      : 2020-02-23 12:42:34
Model     : Oregon-SL109H Id        : 0
Channel   : 3            Celsius   : 0.00 C        Humidity  : 0 %
Status    : 0            Integrity : CHECKSUM
*** Saving signal to file g037_868.25M_1000k.cu8 (80504 samples, 262144 bytes)
*** Saving signal to file g038_868.25M_1000k.cu8 (49847 samples, 131072 bytes)
*** Saving signal to file g039_868.25M_1000k.cu8 (80504 samples, 262144 bytes)
*** Saving signal to file g040_868.25M_1000k.cu8 (82296 samples, 262144 bytes)

##############################################################

> rtl_433 -S unknown -g 20 -f 868250000
rtl_433 version 19.08-235-ge49f53c branch master at 202002161316 inputs file rtl_tcp RTL-SDR
Use -h for usage help and see https://triq.org/ for documentation.
Trying conf file at "rtl_433.conf"...
Trying conf file at "/home/bigalex/.config/rtl_433/rtl_433.conf"...
Trying conf file at "/usr/local/etc/rtl_433/rtl_433.conf"...
Trying conf file at "/etc/rtl_433/rtl_433.conf"...
Registered 122 out of 149 device decoding protocols [ 1-4 8 11-12 15-17 19-21 23 25-26 29-36 38-60 63 67-71 73-100 102-105 108-116 119 121 124-128 130-149 ]
Found Rafael Micro R820T tuner
Exact sample rate is: 1000000.026491 Hz
[R82XX] PLL not locked!
Sample rate set to 1000000 S/s.
Tuner gain set to 20.700000 dB.
Tuned to 868.250MHz.
*** Saving signal to file g041_868.25M_1000k.cu8 (82307 samples, 262144 bytes)
*** Saving signal to file g042_868.25M_1000k.cu8 (49847 samples, 131072 bytes)
*** Saving signal to file g043_868.25M_1000k.cu8 (82307 samples, 262144 bytes)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
time      : 2020-02-23 12:44:06
Model     : Oregon-SL109H Id        : 0
Channel   : 3            Celsius   : 0.00 C        Humidity  : 0 %
Status    : 0            Integrity : CHECKSUM
*** Saving signal to file g044_868.25M_1000k.cu8 (49266 samples, 131072 bytes)
*** Saving signal to file g045_868.25M_1000k.cu8 (49847 samples, 131072 bytes)
*** Saving signal to file g046_868.25M_1000k.cu8 (49847 samples, 131072 bytes)
*** Saving signal to file g047_868.25M_1000k.cu8 (82307 samples, 262144 bytes)
*** Saving signal to file g048_868.25M_1000k.cu8 (82047 samples, 262144 bytes)
*** Saving signal to file g049_868.25M_1000k.cu8 (82296 samples, 262144 bytes)
*** Saving signal to file g050_868.25M_1000k.cu8 (82307 samples, 262144 bytes)
^CSignal caught, exiting!

##############################################################

> rtl_433 -S unknown -g 15 -f 868250000
rtl_433 version 19.08-235-ge49f53c branch master at 202002161316 inputs file rtl_tcp RTL-SDR
Use -h for usage help and see https://triq.org/ for documentation.
Trying conf file at "rtl_433.conf"...
Trying conf file at "/home/bigalex/.config/rtl_433/rtl_433.conf"...
Trying conf file at "/usr/local/etc/rtl_433/rtl_433.conf"...
Trying conf file at "/etc/rtl_433/rtl_433.conf"...
Registered 122 out of 149 device decoding protocols [ 1-4 8 11-12 15-17 19-21 23 25-26 29-36 38-60 63 67-71 73-100 102-105 108-116 119 121 124-128 130-149 ]
Found Rafael Micro R820T tuner
Exact sample rate is: 1000000.026491 Hz
[R82XX] PLL not locked!
Sample rate set to 1000000 S/s.
Tuner gain set to 15.700000 dB.
Tuned to 868.250MHz.
*** Saving signal to file g051_868.25M_1000k.cu8 (81024 samples, 262144 bytes)
*** Saving signal to file g052_868.25M_1000k.cu8 (81273 samples, 262144 bytes)
*** Saving signal to file g053_868.25M_1000k.cu8 (72553 samples, 262144 bytes)
*** Saving signal to file g054_868.25M_1000k.cu8 (49841 samples, 131072 bytes)
*** Saving signal to file g055_868.25M_1000k.cu8 (49841 samples, 131072 bytes)
*** Saving signal to file g056_868.25M_1000k.cu8 (49306 samples, 131072 bytes)
*** Saving signal to file g057_868.25M_1000k.cu8 (49840 samples, 131072 bytes)
*** Saving signal to file g058_868.25M_1000k.cu8 (49841 samples, 131072 bytes)
*** Saving signal to file g059_868.25M_1000k.cu8 (49841 samples, 131072 bytes)
*** Saving signal to file g060_868.25M_1000k.cu8 (49839 samples, 131072 bytes)

##############################################################

> rtl_433 -S unknown -g 10 -f 868250000
rtl_433 version 19.08-235-ge49f53c branch master at 202002161316 inputs file rtl_tcp RTL-SDR
Use -h for usage help and see https://triq.org/ for documentation.
Trying conf file at "rtl_433.conf"...
Trying conf file at "/home/bigalex/.config/rtl_433/rtl_433.conf"...
Trying conf file at "/usr/local/etc/rtl_433/rtl_433.conf"...
Trying conf file at "/etc/rtl_433/rtl_433.conf"...
Registered 122 out of 149 device decoding protocols [ 1-4 8 11-12 15-17 19-21 23 25-26 29-36 38-60 63 67-71 73-100 102-105 108-116 119 121 124-128 130-149 ]
Found Rafael Micro R820T tuner
Exact sample rate is: 1000000.026491 Hz
[R82XX] PLL not locked!
Sample rate set to 1000000 S/s.
Tuner gain set to 12.500000 dB.
Tuned to 868.250MHz.
*** Saving signal to file g061_868.25M_1000k.cu8 (49265 samples, 131072 bytes)
*** Saving signal to file g062_868.25M_1000k.cu8 (49266 samples, 131072 bytes)
*** Saving signal to file g063_868.25M_1000k.cu8 (43597 samples, 131072 bytes)
*** Saving signal to file g064_868.25M_1000k.cu8 (49264 samples, 131072 bytes)
*** Saving signal to file g065_868.25M_1000k.cu8 (49266 samples, 131072 bytes)
*** Saving signal to file g066_868.25M_1000k.cu8 (49317 samples, 131072 bytes)
*** Saving signal to file g067_868.25M_1000k.cu8 (49319 samples, 131072 bytes)
^CSignal caught, exiting!

@merbanan
Copy link
Owner

Can you redo it with -s 2560k? and also some samples with -s 1536k?

@alxlo
Copy link

alxlo commented Feb 25, 2020

I will not be in this place for some time. What I can do is take as many samples as needed here at my flat with only 2 sensors and a much noisier environment with some other sensors around. Will this help? What are useful gain values (3dB steps might possibly make more sense)?

@merbanan
Copy link
Owner

If you look at the samples we just don't want them to clip. To look at the samples use sigrok or audacity. And 2-3 samples will be enough but it would be nice with a high samplerate.

@pjenglund
Copy link

Is this capture something useful? Not quite sure how to verify it Audacity and sigrok but the latter showed some binary signal...

g002_868.25M_2560k.cu8.zip

rtl_433 -S unknown -g 30 -f 868250000 -s 2560k
rtl_433 version 20.02-1-gf5e5a6a branch master at 202002181022 inputs file rtl_tcp RTL-SDR
Use -h for usage help and see https://triq.org/ for documentation.
Trying conf file at "rtl_433.conf"...
Trying conf file at "/home/pi/.config/rtl_433/rtl_433.conf"...
Trying conf file at "/usr/local/etc/rtl_433/rtl_433.conf"...
Trying conf file at "/etc/rtl_433/rtl_433.conf"...

New defaults active, use "-Y classic -s 250k" for the old defaults!

Registered 122 out of 149 device decoding protocols [ 1-4 8 11-12 15-17 19-21 23 25-26 29-36 38-60 63 67-71 73-100 102-105 108-116 119 121 124-128 130-149 ]
Found Rafael Micro R820T tuner
[R82XX] PLL not locked!
Sample rate set to 2560000 S/s.
Tuner gain set to 32.800000 dB.
Tuned to 868.250MHz.
*** Saving signal to file g001_868.25M_2560k.cu8 (115872 samples, 262144 bytes)
*** Saving signal to file g002_868.25M_2560k.cu8 (76475 samples, 262144 bytes)
*** Saving signal to file g003_868.25M_2560k.cu8 (76468 samples, 262144 bytes)
*** Saving signal to file g004_868.25M_2560k.cu8 (78354 samples, 262144 bytes)
*** Saving signal to file g005_868.25M_2560k.cu8 (78355 samples, 262144 bytes)
*** Saving signal to file g006_868.25M_2560k.cu8 (76472 samples, 262144 bytes)
*** Saving signal to file g007_868.25M_2560k.cu8 (76475 samples, 262144 bytes)
*** Saving signal to file g008_868.25M_2560k.cu8 (76467 samples, 262144 bytes)
*** Saving signal to file g009_868.25M_2560k.cu8 (95421 samples, 262144 bytes)
*** Saving signal to file g010_868.25M_2560k.cu8 (72485 samples, 262144 bytes)
*** Saving signal to file g011_868.25M_2560k.cu8 (76473 samples, 262144 bytes)

@zuckschwerdt
Copy link
Collaborator

Great! The gain is good and the (time)resolution is enough to make out the actual sine of the carrier. It's really looks like the "second" frequency is a harmonic only.

@merbanan
Copy link
Owner

@zuckschwerdt what every it is, when I run the code on this sample it actually works because of the sample rate. So I'm guessing this will work with the current code if you use 2Ms/s as sample rate. As such I am inclined to add the decoder disabled with the note that you need a high sample rate for it to work.

Later on when some one reworks the pulse recovery flow so it will be possible for several FSK algorithms we could also add other algorithms and the Klimalogg_demod.pdf is basically the output of unfiltered I^2+Q^2. Then it would be possible to run at 1Ms/s, it almost works right now.

Is that an acceptable solution?

@pjenglund
Copy link

Sorry to inform but my last sample may have been contamination from another, unknown device (may of course also be the sensor but now I'm not sure). I had a hunch when these samples came in at good quality, first try, that there is something going on. Sure enough, a quick nightly drive to the place where I usually collect samples (remote place, just one house close by) with sdr# and I got something on the same frequency as these sensors...

But now that I have the mobile setup ready to go again, I can try to collect more samples if time permits. Is there something I should consider (in addition to check for contamination first this time)? I use the main version of the program, is that ok?

Once again, sorry for the inconvenience...

@merbanan
Copy link
Owner

Well the samples we have now are enough to analyze the signal. The current suggestion will make it work in the near time and better in the future. Just need consensus to move forward.

@merbanan
Copy link
Owner

So wait with more samples for the time being.

@zuckschwerdt
Copy link
Collaborator

Sure, add the decoder disabled. I will look into why the carrier deviates and possibly the reason, might be interesting but will take time.

The I^2+Q^2 is what we do already. But that amplitude emphasizes strong signals. Note that for CS16 (SoapySDR) the more refined magnitude is used (also to scale to a U16 range).

Note that in any case both work:

rtl_433 -s2560k -X 'name=klimalogg,modulation=OOK_PCM,short=12,long=12,reset=200,match=0x55df755dd' g002_868.25M_2560k.cu8

rtl_433 -s2560k -w g002_868.25M_2560k.cs16 g002_868.25M_2560k.cu8
rtl_433 -s2560k -X 'name=klimalogg,modulation=OOK_PCM,short=12,long=12,reset=200,match=0x55df755dd' g002_868.25M_2560k.cs16

@merbanan
Copy link
Owner

@zuckschwerdt if you look at the signal in some parts it looks like a sine wave that instead of going towards period max or min it changes direction. Klimalogg_signal.pdf is a synthetic period of it. I think it is quite clear that there is a constant carrier and an added OOK signal at an offset.

If you run a high pass filter in between the frequencies you should see the OOK signal quite clearly.

Anyway, I'll work on the PR.

@merbanan
Copy link
Owner

And here it is:

#1319

Some one with real signals can check what samples rates are needed.

@anse1
Copy link

anse1 commented Feb 28, 2020 via email

@merbanan
Copy link
Owner

Ok, I'll revise relevant comments and suggest the max sample rate for now.

@merbanan
Copy link
Owner

Ok, a working decoder has been merged. A high sample rate is needed. This is as good as it gets for the time being.

@alxlo
Copy link

alxlo commented Mar 1, 2020

Thank you for your time.

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

No branches or pull requests

9 participants