sebmillet / RF433recv

Manage receiving codes from 433 Mhz RX device plugged on Arduino
GNU Lesser General Public License v3.0
6 stars 4 forks source link

Receiving <unmanaged encoding> only #3

Closed Thermisto closed 2 years ago

Thermisto commented 2 years ago

Hi,

when I run RF433any 01_main.ino, all I receive is this:

-----CODE START-----
// [WRITE THE DEVICE NAME HERE]
rf.register_Receiver(
    <unmanaged encoding>, // mod
    3820, // initseq
    0, // lo_prefix
    0, // hi_prefix
    0, // first_lo_ign
    556, // lo_short
    556, // lo_long
    1892, // hi_short (0 => take lo_short)
    3824, // hi_long  (0 => take lo_long)
    0, // lo_last
    3820, // sep
    0  // nb_bits
);
-----CODE END-----

Data: 

-----CODE START-----
// [WRITE THE DEVICE NAME HERE]
rf.register_Receiver(
    <unmanaged encoding>, // mod
    3872, // initseq
    0, // lo_prefix
    0, // hi_prefix
    0, // first_lo_ign
    516, // lo_short
    516, // lo_long
    1932, // hi_short (0 => take lo_short)
    3884, // hi_long  (0 => take lo_long)
    0, // lo_last
    3872, // sep
    0  // nb_bits
);
-----CODE END-----

Data: 

-----CODE START-----
// [WRITE THE DEVICE NAME HERE]
rf.register_Receiver(
    <unmanaged encoding>, // mod
    3856, // initseq
    0, // lo_prefix
    0, // hi_prefix
    0, // first_lo_ign
    512, // lo_short
    512, // lo_long
    1936, // hi_short (0 => take lo_short)
    3860, // hi_long  (0 => take lo_long)
    0, // lo_last
    3856, // sep
    0  // nb_bits
);
-----CODE END-----

Data: 02 52 52

-----CODE START-----
// [WRITE THE DEVICE NAME HERE]
rf.register_Receiver(
    <unmanaged encoding>, // mod
    2004, // initseq
    0, // lo_prefix
    0, // hi_prefix
    0, // first_lo_ign
    424, // lo_short
    828, // lo_long
    164, // hi_short (0 => take lo_short)
    404, // hi_long  (0 => take lo_long)
    408, // lo_last
    2004, // sep
    20  // nb_bits
);
-----CODE END-----

Data: 09 49 49

-----CODE START-----
// [WRITE THE DEVICE NAME HERE]
rf.register_Receiver(
    <unmanaged encoding>, // mod
    2008, // initseq
    0, // lo_prefix
    0, // hi_prefix
    0, // first_lo_ign
    436, // lo_short
    816, // lo_long
    184, // hi_short (0 => take lo_short)
    364, // hi_long  (0 => take lo_long)
    192, // lo_last
    1388, // sep
    22  // nb_bits
);
-----CODE END-----

Data: 

-----CODE START-----
// [WRITE THE DEVICE NAME HERE]
rf.register_Receiver(
    <unmanaged encoding>, // mod
    10508, // initseq
    0, // lo_prefix
    0, // hi_prefix
    0, // first_lo_ign
    482, // lo_short
    984, // lo_long
    0, // hi_short (0 => take lo_short)
    0, // hi_long  (0 => take lo_long)
    1016, // lo_last
    10508, // sep
    0  // nb_bits
);
-----CODE END-----

I am trying to receive the signal of several temperature and humidity sensors I have around the house. On a Raspberry PI I can receive the signal by using rtl_433 and protocol [03] Prologue, FreeTec NC-7104, NC-7159-675 temperature sensor. Is there a way to decode the protocols with RF433recv? Thank you and kind regards, Andreas

sebmillet commented 2 years ago

Hello

In order to see the signal details, could you please record the signal timing and show it? For example using the library RF433snif, https://github.com/sebmillet/rf433snif This'll help understand what the coding is made of, and whether or not RF433recv could decode it.

Regards, Sébastien

Thermisto commented 2 years ago

Hi, I will do as requested, but I will not be able to upload the results until the end of next week. Thank you for your support, Andreas

Thermisto commented 2 years ago

Here is a sequence of one of the sensors (It is labeled NC-7200-675 and send temperature and humidity):

Waiting for signal...
^
|---> < 4612436 us > elapsed without recording
v
Signal duration: 1058896 us
  N     LOW,  HIGH
-----BEGIN RF433 LOW HIGH SEQUENCE-----
           ,  8628
000     532,  3808
001     544,  1876
002     532,  1892
003     520,  3804
004     524,  3816
005     528,  1900
006     508,  3820
007     520,  1904
008     516,  1896
009     504,  1912
010     508,  3828
011     508,  1912
012     500,  3836
013     508,  3828
014     512,  1904
015     524,  3828
016     512,  1912
017     516,  1908
018     516,  1904
019     516,  3836
020     508,  1920
021     508,  1908
022     516,  1904
023     512,  1912
024     508,  3836
025     508,  1920
026     500,  3836
027     508,  1912
028     508,  1916
029     508,  1920
030     508,  3828
031     516,  1912
032     508,  3836
033     508,  3828
034     516,  1900
035     516,  3836
036     512,  3856
037     524,  8624
038     524,  3820
039     524,  1904
040     516,  1904
041     516,  3828
042     516,  3828
043     508,  1904
044     524,  3820
045     520,  1904
046     516,  1912
047     508,  1912
048     508,  3844
049     504,  1904
050     520,  3828
051     516,  3832
052     512,  1920
053     500,  3832
054     516,  1912
055     508,  1920
056     500,  1920
057     508,  3832
058     508,  1912
059     520,  1908
060     508,  1920
061     504,  1920
062     500,  3840
063     508,  1920
064     508,  3836
065     508,  1912
066     508,  1912
067     508,  1912
068     508,  3844
069     500,  1920
070     504,  3836
071     516,  3840
072     500,  1920
073     508,  3832
074     508,  3860
075     524,  8620
076     528,  3820
077     516,  1908
078     524,  1896
079     520,  3832
080     508,  3828
081     520,  1912
082     508,  3836
083     512,  1912
084     504,  1916
085     508,  1920
086     504,  3836
087     516,  1912
088     508,  3836
089     508,  3836
090     500,  1920
091     508,  3828
092     516,  1912
093     508,  1916
094     508,  1920
095     504,  3844
096     500,  1920
097     500,  1920
098     508,  1912
099     508,  1920
100     500,  3840
101     500,  1920
102     500,  3840
103     500,  1920
104     504,  1920
105     508,  1920
106     504,  3844
107     492,  1920
108     504,  3844
109     500,  3836
110     508,  1920
111     500,  3836
112     508,  3864
113     524,  8624
114     516,  3828
115     516,  1908
116     512,  1904
117     516,  3832
118     508,  3836
119     508,  1916
120     508,  3828
121     516,  1916
122     508,  1912
123     508,  1920
124     500,  3844
125     504,  1920
126     504,  3844
127     500,  3836
128     508,  1920
129     500,  3836
130     504,  1920
131     492,  1920
132     508,  1920
133     500,  3844
134     504,  1920
135     504,  1920
136     500,  1920
137     504,  1928
138     500,  3840
139     508,  1920
140     500,  3836
141     508,  1920
142     500,  1920
143     500,  1920
144     508,  3836
145     500,  1928
146     504,  3836
147     508,  3840
148     508,  1920
149     500,  3836
150     508,  3888
151     508,  8628
152     524,  3820
153     516,  1904
154     516,  1904
155     508,  3836
156     508,  3836
157     512,  1912
158     508,  3844
159     504,  1912
160     508,  1920
161     500,  1920
162     508,  3832
163     508,  1912
164     508,  3840
165     500,  3836
166     512,  1912
167     508,  3836
168     512,  1920
169     500,  1916
170     500,  1920
171     500,  3840
172     500,  1920
173     504,  1928
174     500,  1920
175     504,  1924
176     492,  3844
177     504,  1928
178     500,  3836
179     504,  1928
180     500,  1916
181     500,  1920
182     504,  3844
183     500,  1920
184     504,  3844
185     500,  3844
186     504,  1920
187     500,  3844
188     504,  3864
189     524,  8624
190     524,  3820
191     516,  1908
192     516,  1912
193     508,  3840
194     500,  3828
195     512,  1912
196     508,  3836
197     508,  1912
198     508,  1920
199     500,  1920
200     500,  3844
201     500,  1920
202     504,  3844
203     500,  3844
204     500,  1920
205     500,  3844
206     508,  1912
207     508,  1920
208     500,  1920
209     500,  3836
210     500,  1920
211     500,  1920
212     500,  1916
213     500,  1928
214     500,  3848
215     500,  1920
216     504,  3848
217     492,  1912
218     504,  1928
219     492,  1928
220     504,  3836
221     508,  1920
222     504,  3844
223     500,  3848
224     500,  1920
225     504,  3840
226     500,200004
227       4, 46864
228     392,  7460
229      96,  1488
230     324,   776
231     196,  6004
232     116,   948
233     456,   636
234     760,   192
235     784,  2112
236     152,  1712
237     116,   860
238     128,   900
239      80,   848
240     952,   152
241     840,   572
242     528,  2388
243     440,   932
244      36,  1000
245     136,   836
246     556,   424
247     984,   144
248     820,  1008
249      92,   888
-----END RF433 LOW HIGH SEQUENCE-----
Thermisto commented 2 years ago

This is the result from rtl_433 -R 3 on my Raspberry PI:

rtl_433 -R 3
rtl_433 version 21.12-142-ge8ec15e6 branch master at 202208271539 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"...
Registered 1 out of 223 device decoding protocols [ 3 ]
Found Fitipower FC0012 tuner
Exact sample rate is: 250000.000414 Hz
Sample rate set to 250000 S/s.
Tuner gain set to Auto.
Tuned to 433.920MHz.
Allocating 15 zero-copy buffers
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
time      : 2022-09-07 18:31:32
model     : Prologue-TH  subtype   : 9             id        : 162
Channel   : 2            Battery   : 1             Temperature: 27.50 C      Humidity  : 48 %          Button    : 1
Thermisto commented 2 years ago

This is the output from from rtl_433 -A -R 3:

Detected OOK package    2022-09-07 18:38:25
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
time      : 2022-09-07 18:38:25
model     : Prologue-TH  subtype   : 9             id        : 162
Channel   : 2            Battery   : 1             Temperature: 28.80 C      Humidity  : 53 %          Button    : 1
Analyzing pulses...
Total count:  266,  width: 897.51 ms            (224378 S)
Pulse width distribution:
 [ 0] count:  266,  width:  480 us [456;496]    ( 120 S)
Gap width distribution:
 [ 0] count:    7,  width: 8696 us [8692;8704]  (2174 S)
 [ 1] count:  104,  width: 3892 us [3876;3932]  ( 973 S)
 [ 2] count:  154,  width: 1968 us [1956;1980]  ( 492 S)
Pulse period distribution:
 [ 0] count:    7,  width: 9184 us [9152;9196]  (2296 S)
 [ 1] count:  104,  width: 4372 us [4356;4420]  (1093 S)
 [ 2] count:  154,  width: 2452 us [2440;2464]  ( 613 S)
Pulse timing distribution:
 [ 0] count:  266,  width:  480 us [456;496]    ( 120 S)
 [ 1] count:    8,  width: 8860 us [8692;10004] (2215 S)
 [ 2] count:  104,  width: 3892 us [3876;3932]  ( 973 S)
 [ 3] count:  154,  width: 1968 us [1956;1980]  ( 492 S)
Level estimates [high, low]:   9008,    201
RSSI: -2.6 dB SNR: 16.5 dB Noise: -19.1 dB
Frequency offsets [F1, F2]:    8478,      0     (+32.3 kHz, +0.0 kHz)
Guessing modulation: Pulse Position Modulation with fixed pulse width
view at https://triq.org/pdv/#AAB00B040101E0229C0F3407B08155+AAB030040601E0229C0F3407B0828383828283828383838283828283828383838283838283838383838383828283828382828155+AAB02F040101E0229C0F3407B08283838282838283838382838282838283838382838382838383838383838282838283828155
Attempting demodulation... short_width: 1968, long_width: 3892, reset_limit: 8708, sync_width: 0
Use a flex decoder with -X 'n=name,m=OOK_PPM,s=1968,l=3892,g=3936,r=8708'
pulse_slicer_ppm(): Analyzer Device
bitbuffer:: Number of rows: 8
[00] { 0}                :
[01] {37} 9a 2d 12 03 58 : 10011010 00101101 00010010 00000011 01011
[02] {37} 9a 2d 12 03 58 : 10011010 00101101 00010010 00000011 01011
[03] {37} 9a 2d 12 03 58 : 10011010 00101101 00010010 00000011 01011
[04] {37} 9a 2d 12 03 58 : 10011010 00101101 00010010 00000011 01011
[05] {37} 9a 2d 12 03 58 : 10011010 00101101 00010010 00000011 01011
[06] {37} 9a 2d 12 03 58 : 10011010 00101101 00010010 00000011 01011
[07] {36} 9a 2d 12 03 50 : 10011010 00101101 00010010 00000011 0101
sebmillet commented 2 years ago

Hello

Given signal timings, RF433any cannot interpret it: it is made of a unique duration followed by a "short or long" signal. RF433any can only interpret "short then long" versus "long then short". The good news is, RF433recv should be able to decode such a signal.

You may try the below decoder:

[...] // Depends on schema...

define PIN_RFINPUT 2

[...] RF_manager rf(PIN_RFINPUT); [...] void callback(const BitVector *recorded) { // Implement instructions here to execute when code is received... } [...] rf.register_Receiver(RFMOD_TRIBIT, 8550, 0, 0, 0, 500, 500, 1900, 3800, 500, 8550, 37, callback, 1000); [...]

Hope it'll work for you.

Regards, Sébastien Millet

Thermisto commented 2 years ago

Hello Sébastien,

I tried what you suggested, but unfortunately it did not work. Thank you very much for your support. I will try a different approach now.

Kind regards, Andreas

sebmillet commented 2 years ago

Ok this is too bad... I can't reproduce the signal and test reception at the moment but I'll do in a few days and let you know.

sebmillet commented 2 years ago

Hello

I finally could compile and test my code and the correct reception constructor is actually a bit different from what I sent in the first place. Here we go:

// ========================================

include "RF433recv.h"

include

...

define PIN_RFINPUT 2

... RF_manager rf(PIN_RFINPUT); ... void callback_anycode(const BitVector *recorded) { // Write code here }

rf.register_Receiver( RFMOD_TRIBIT_INVERTED, // mod 8550, // initseq 0, // lo_prefix 0, // hi_prefix 500, // first_lo_ign 500, // lo_short 500, // lo_long 1900, // hi_short 3800, // hi_long 0, // lo_last 8550, // sep 37, // nb_bits callback_anycode, // callback 1000 // delay between two calls to callback ); // ========================================

I tested it in real conditions, with a TX emitting the code timings you indicated in a previous post, and it works.

Regards, Sébastien

Thermisto commented 2 years ago

Hello Sébastien,

looking good. Thank you so much. Your library is really excellent.

Kind Regards, Andreas