sebmillet/RF433recv

Help with decoding parktronic

Closed this issue · 2 comments

i sniffed 51740 us packets

short pulse 360us, long 720us. 10 pulses sync, 3240us (or 2880?) after sync, 1080us at end

Figure_1

What is

 mod,  initseq,
 lo_prefix,  hi_prefix,  first_lo_ign,
 lo_last,  sep, nb_bits

here?

Captured with rf433snif

Figure_1

Waiting for signal...
^
|---> < 572588 us > elapsed without recording
v
Signal duration: 846619 us
  N     LOW,  HIGH
-----BEGIN RF433 LOW HIGH SEQUENCE-----
           ,103451
000     356,   360
001     356,   360
002     356,   360
003     356,   360
004     352,   360
005     352,   360
006     352,   360
007     356,   360
008     352,   360
009     356,  3236
010     356,   356
011     356,   716
012     364,   352
013     360,   352
014     716,   360
015     352,   712
016     364,   352
017     716,   360
018     352,   376
019     340,   360
020     352,   716
021     716,   712
022     364,   352
023     364,   352
024     360,   352
025     364,   352
026     364,   352
027     712,   364
028     352,   716
029     360,   352
030     364,   352
031     716,   712
032     716,   716
033     712,   720
034     360,   352
035     364,   352
036     364,   352
037     360,   352
038     716,   716
039     360,   352
040     716,   716
041     712,   716
042     716,   712
043     716,   716
044     712,   716
045     716,   360
046     352,   372
047     344,   712
048     716,   716
049     712,   716
050    1076,154640
051     356,   360
052     352,   360
053     352,   360
054     356,   360
055     352,   360
056     356,   360
057     352,   360
058     356,   360
059     356,   360
060     356,  3240
061     352,   360
062     356,   716
063     364,   352
064     360,   352
065     716,   364
066     352,   712
067     364,   352
068     716,   360
069     352,   372
070     344,   360
071     352,   716
072     716,   712
073     364,   352
074     364,   352
075     360,   352
076     364,   352
077     364,   352
078     716,   360
079     352,   716
080     360,   352
081     364,   352
082     716,   712
083     716,   716
084     716,   716
085     360,   352
086     364,   352
087     364,   352
088     360,   352
089     716,   716
090     360,   352
091     716,   720
092     712,   716
093     716,   716
094     716,   716
095     712,   716
096     716,   360
097     352,   372
098     340,   712
099     716,   716
100     712,   716
101    1076,154644
102     360,   360
103     356,   360
104     352,   360
105     356,   360
106     352,   360
107     356,   360
108     352,   360
109     352,   360
110     356,   360
111     356,  3240
112     356,   356
113     356,   716
114     364,   352
115     360,   352
116     716,   364
117     352,   716
118     364,   352
119     716,   360
120     352,   368
121     344,   360
122     352,   716
123     716,   712
124     364,   352
125     364,   352
126     360,   352
127     364,   352
128     364,   352
129     712,   364
130     352,   716
131     360,   352
132     364,   352
133     716,   712
134     716,   716
135     712,   716
136     360,   352
137     364,   352
138     364,   352
139     360,   352
140     724,   708
141     360,   352
142     716,   716
143     712,   716
144     716,   712
145     716,   716
146     712,   716
147     716,   360
148     352,   368
149     344,   712
150     716,   716
151     712,   716
152    1076,129028
153     356,   360
154     356,   360
155     356,   360
156     352,   360
157     356,   360
158     356,   360
159     356,   360
160     356,   360
161     352,   360
162     356,  3240
163     356,   356
164     356,   716
165     364,   352
166     360,   352
167     716,   364
168     352,   712
169     364,   352
170     716,   360
171     352,   368
172     344,   360
173     352,   716
174     716,   712
175     364,   352
176     364,   352
177     360,   352
178     364,   352
179     364,   352
180     712,   364
181     352,   716
182     360,   352
183     364,   352
184     716,   712
185     716,   716
186     712,   716
187     360,   352
188     364,   352
189     364,   352
190     360,   352
191     716,   716
192     360,   352
193     716,   716
194     712,   716
195     716,   712
196     716,   716
197     712,   716
198     716,   360
199     352,   372
200     344,   716
201     716,   716
202     712,   716
203    1076,154636
204     356,   360
205     356,   360
206     356,   360
207     356,   360
208     352,   360
209     356,   360
210     352,   360
211     352,   360
212     352,   360
213     352,  3240
214     352,   716
215     716,   716
216     360,   352
217     720,   364
218     352,   712
219     364,   352
220     716,   360
221     352,   376
222     340,   360
223     352,   716
224     716,   712
225     364,   352
226     364,   352
227     360,   352
228     364,   352
229     364,   352
230     712,   364
231     352,   716
232     360,   352
233     716,   716
234     360,   352
235     716,   716
236     712,   716
237     360,   352
238     364,   352
239     364,   352
240     360,   352
241     716,   716
242     360,   352
243     716,   720
244     712,   716
245     716,   712
246     716,   716
247     716,   716
248     716,   360
249     352,   372
-----END RF433 LOW HIGH SEQUENCE-----
Waiting for signal...
^
|---> < 470160 us > elapsed without recording
v
Signal duration: 745562 us
  N     LOW,  HIGH
-----BEGIN RF433 LOW HIGH SEQUENCE-----
           , 42028
000     360,   360
001     356,   360
002     356,   360
003     352,   360
004     356,   360
005     356,   360
006     352,   360
007     356,   360
008     356,   360
009     352,  3240
010     356,   716
011     716,   716
012     360,   352
013     716,   364
014     352,   716
015     364,   352
016     716,   360
017     352,   372
018     344,   360
019     352,   716
020     716,   716
021     364,   352
022     364,   352
023     360,   352
024     364,   352
025     364,   352
026     712,   364
027     352,   716
028     360,   352
029     716,   716
030     360,   352
031     716,   724
032     704,   720
033     360,   352
034     364,   352
035     364,   352
036     360,   352
037     716,   716
038     360,   352
039     716,   716
040     716,   716
041     716,   712
042     716,   716
043     712,   716
044     716,   360
045     352,   376
046     340,   712
047     716,   716
048     712,   716
049    1076,103512
050     356,   360
051     356,   360
052     356,   360
053     352,   360
054     352,   360
055     356,   360
056     356,   360
057     356,   360
058     356,   360
059     352,  3240
060     356,   356
061     356,   716
062     364,   352
063     360,   352
064     716,   364
065     352,   716
066     364,   352
067     716,   360
068     352,   376
069     340,   360
070     352,   716
071     716,   712
072     364,   352
073     364,   352
074     360,   344
075     364,   352
076     364,   352
077     712,   364
078     352,   716
079     360,   352
080     716,   716
081     360,   352
082     716,   716
083     712,   720
084     360,   352
085     364,   352
086     364,   352
087     360,   352
088     716,   716
089     360,   352
090     716,   716
091     712,   716
092     716,   716
093     716,   716
094     712,   716
095     364,   352
096     712,   372
097     340,   716
098     716,   720
099     712,   716
100    1076,103508
101     356,   360
102     360,   360
103     356,   360
104     356,   360
105     356,   360
106     356,   360
107     352,   360
108     356,   352
109     352,   360
110     356,  3240
111     356,   356
112     356,   716
113     364,   352
114     360,   352
115     716,   364
116     352,   712
117     364,   352
118     716,   360
119     352,   372
120     344,   360
121     352,   716
122     716,   716
123     364,   352
124     364,   352
125     360,   352
126     364,   352
127     364,   352
128     712,   360
129     352,   716
130     360,   352
131     716,   716
132     360,   352
133     716,   716
134     712,   720
135     360,   352
136     364,   352
137     364,   352
138     360,   352
139     716,   716
140     360,   352
141     716,   716
142     712,   720
143     716,   716
144     716,   716
145     716,   716
146     364,   352
147     712,   376
148     340,   712
149     716,   716
150     716,   716
151    1076,129080
152     356,   360
153     356,   360
154     352,   360
155     356,   360
156     352,   360
157     356,   360
158     352,   360
159     356,   360
160     352,   360
161     352,  3240
162     356,   360
163     356,   716
164     364,   352
165     360,   352
166     716,   364
167     352,   712
168     364,   352
169     716,   360
170     352,   376
171     340,   360
172     352,   716
173     716,   712
174     364,   352
175     356,   352
176     360,   352
177     364,   352
178     364,   352
179     716,   364
180     352,   716
181     360,   352
182     716,   716
183     360,   352
184     716,   716
185     712,   716
186     360,   352
187     364,   352
188     364,   352
189     360,   352
190     716,   720
191     360,   352
192     716,   716
193     716,   716
194     716,   712
195     716,   716
196     716,   716
197     364,   352
198     712,   372
199     344,   712
200     716,   716
201     712,   716
202    1076,154680
203     356,   360
204     360,   360
205     356,   360
206     356,   360
207     352,   360
208     352,   360
209     356,   360
210     352,   360
211     352,   360
212     352,  3240
213     352,   716
214     716,   716
215     360,   352
216     716,   364
217     352,   712
218     364,   352
219     716,   360
220     352,   372
221     340,   360
222     352,   716
223     716,   712
224     364,   352
225     364,   352
226     360,   352
227     364,   352
228     364,   352
229     716,   360
230     352,   716
231     360,   352
232     716,   716
233     360,   352
234     716,   716
235     716,   716
236     360,   352
237     364,   352
238     364,   352
239     360,   352
240     716,   716
241     360,   352
242     716,   716
243     716,   716
244     716,   712
245     716,   716
246     716,   716
247     716,   360
248     352,   372
249     344,   712
-----END RF433 LOW HIGH SEQUENCE-----
Waiting for signal...
^
|---> < 622434 us > elapsed without recording
v
Signal duration: 722773 us
  N     LOW,  HIGH
-----BEGIN RF433 LOW HIGH SEQUENCE-----
           ,180141
000     356,   360
001     356,   360
002     360,   360
003     356,   360
004     356,   360
005     352,   360
006     356,   360
007     352,   360
008     352,   360
009     356,  3236
010     356,   356
011     356,   720
012     364,   352
013     364,   352
014     716,   360
015     352,   716
016     360,   352
017     716,   364
018     352,   368
019     344,   360
020     352,   712
021     716,   716
022     360,   352
023     364,   352
024     716,   716
025     364,   352
026     716,   360
027     352,   716
028     364,   352
029     712,   716
030     364,   352
031     712,   716
032     716,   716
033     364,   352
034     360,   352
035     364,   352
036     364,   352
037     712,   716
038     364,   352
039     716,   716
040     716,   712
041     716,   716
042     716,   716
043     716,   716
044     364,   352
045     364,   352
046     372,   340
047     716,   360
048     352,   716
049     716,   712
050    1076,154636
051     360,   360
052     356,   360
053     356,   360
054     356,   360
055     352,   360
056     356,   360
057     356,   360
058     356,   360
059     352,   360
060     356,  3236
061     356,   360
062     356,   716
063     364,   352
064     364,   352
065     712,   364
066     352,   716
067     360,   352
068     716,   364
069     352,   368
070     344,   364
071     352,   716
072     716,   716
073     360,   352
074     364,   352
075     720,   712
076     364,   352
077     716,   360
078     352,   716
079     364,   352
080     360,   352
081     716,   716
082     716,   716
083     716,   712
084     364,   352
085     360,   352
086     364,   352
087     364,   352
088     712,   716
089     364,   352
090     716,   716
091     716,   712
092     716,   716
093     712,   716
094     716,   712
095     716,   716
096     368,   344
097     716,   360
098     352,   716
099     716,   716
100    1076,103500
101     360,   360
102     352,   360
103     352,   360
104     356,   360
105     352,   360
106     356,   360
107     356,   360
108     356,   360
109     352,   360
110     352,  3236
111     356,   716
112     364,   352
113     364,   352
114     364,   352
115     716,   360
116     352,   716
117     360,   352
118     716,   364
119     352,   364
120     348,   360
121     352,   712
122     716,   716
123     360,   352
124     716,   716
125     360,   352
126     364,   352
127     716,   360
128     352,   716
129     364,   344
130     360,   352
131     716,   716
132     716,   716
133     720,   712
134     364,   352
135     360,   352
136     364,   352
137     364,   352
138     712,   716
139     364,   352
140     712,   716
141     716,   712
142     716,   716
143     716,   716
144     716,   712
145     716,   360
146     352,   372
147     340,   716
148     716,   716
149     720,   712
150    1076,103512
151     356,   360
152     356,   360
153     356,   360
154     356,   360
155     356,   360
156     356,   360
157     352,   360
158     352,   360
159     356,   360
160     356,  3240
161     352,   716
162     364,   352
163     364,   352
164     360,   352
165     720,   360
166     352,   716
167     364,   352
168     716,   360
169     352,   372
170     340,   360
171     352,   716
172     720,   712
173     364,   352
174     716,   716
175     364,   352
176     364,   352
177     716,   360
178     352,   716
179     360,   352
180     364,   352
181     716,   712
182     716,   716
183     712,   720
184     360,   352
185     364,   352
186     364,   352
187     360,   352
188     716,   716
189     360,   352
190     716,   720
191     712,   716
192     716,   716
193     716,   716
194     716,   716
195     716,   360
196     352,   372
197     344,   712
198     716,   716
199     716,   716
200    1076,103500
201     356,   360
202     356,   360
203     356,   360
204     356,   360
205     352,   360
206     356,   360
207     356,   360
208     356,   360
209     352,   360
210     356,  3240
211     356,   716
212     364,   352
213     364,   352
214     360,   352
215     716,   364
216     352,   712
217     364,   352
218     716,   360
219     352,   368
220     344,   360
221     352,   716
222     716,   716
223     364,   352
224     716,   716
225     364,   352
226     364,   352
227     712,   364
228     352,   716
229     360,   352
230     364,   352
231     720,   712
232     716,   716
233     712,   716
234     360,   352
235     364,   352
236     364,   352
237     360,   352
238     716,   716
239     360,   352
240     716,   720
241     712,   716
242     716,   712
243     716,   716
244     712,   716
245     716,   360
246     352,   368
247     348,   712
248     716,   716
249     716,   716
-----END RF433 LOW HIGH SEQUENCE-----

Hello

ABOUT YOUR QUESTIONS

mod

Is the encoding type, and RF433recv can manage three:
RFMOD_TRIBIT = "0" is "short signal low then long signal high", "1" is "long signal low then short signal high".
RFMOD_TRIBIT_INVERTED = "0" is "short signal high then long signal low", "1" is "long signal high then short signal low".
RFMOD_TRIBIT and RFMOD_TRIBIT_INVERTED are very close, it is just that in the first one a bit is encoded by the "low-then-high" signal durations, whereas the latter is encoded by "high-then-low" signal durations.
RFMOD_MANCHESTER = "0" is "short low then short high" and "1" is "short high then short low". As you can see there are only "short" here (on the encoding side) but when decoding, a "low-then-high" followed by "high-then-low" (for example) will lead to a long duration (two shorts). As opposed to TRIBIT/TRIBIT_INVERTED where short and long durations are arbitrary (long is not necessary the double of short, and low durations can be different from high durations), with MANCHESTER, "long" is by definition the exact double of "short", and low and high short and long durations must be identical.
You can see help about it in the "More Details" section of RF433any library, here:

https://github.com/sebmillet/RF433any

initseq

The prefix before encoding, always much longer then any of short or long durations. It serves to tell the receiver that "something encoded will follow".

lo_prefix, hi_prefix

is almost never used. It follows initseq and is made of one (and only one) succession of "low-then-high" (low duration = lo_prefix, high duration = hi_prefix) signal with a timing distinct from "everything" (distinct from the encoding "short" and "long" timings, distinct from sep/initseq).
I encoded such a prefix because I discovered it on a FLO/R. The simple "FLO" telecommand does not send such a prefix, the FLO/R (a more elaborate FLO with rolling code) does send such a prefix, I guess, to help the receiver distinguish between FLO and FLO/R.
If you don't get it, just set it to zero - it is extremely rarely used.

first_lo_ign

Is used only with RFMOD_TRIBIT_INVERTED. Because this mod uses successions of "high-then-low" signals, the first low signal that follows initseq (initseq is always high), is not part of the encoding. So it could be of any duration.
De facto it is most frequently the "short" duration but it is not a rule, any duration is possible here.

lo_last

This is the kind-of "symetric" of first_lo_ign and is used only with RFMOD_TRIBIT. Because this mod uses successions of "low-then-high" signals, the last low signal (before next initseq and/or separator) is not part of encoding and can be of any duration.
De facto it is most frequently the "short" duration but it is not a rule, any duration is possible here.

sep

A code is typically sent multiple times when pressing the button, to increase the likelihood of receiver to catch the code.
'sep' is the duration of "high" signal between two codes.
It is often equal to initseq, but not necessarily. With some telecommands, 'sep' is smaller than 'initseq'.
Still, 'sep' must be much longer than 'long' durations (to help identify the code sequence has ended).
I guess, 'sep' is used to speed up the transmission of code sending when sent repeatedly.
If you don't get it, just set it to the same value as 'initseq'.

nb_bits

Is the number of bits of the value decoded.

ABOUT YOUR SIGNAL TIMING POSTED

You'll see what encoding is being used by using the library RF433any:

https://github.com/sebmillet/RF433any

I sent the timings you give to RF433any (in SIMULATED mode) and the response is:

----- BEGIN TEST -----
[0] Sync 9
T=SYN, E=0, I=29696, S(lo)=352, L(lo)=352, S(hi)=352, L(hi)=352, P=3200, Y=0, Z=352
[1] Received 57 bits: 00 e6 17 e7 57 da aa 2a
T=MAN, E=0, I=0, S=352, L=704, P=29696, Y=0, Z=1072
----- END TEST -----

The above is a bit difficult to read.
So, when asking to display the code to read it (to be used with RF433recv library), we get the below outputs:

First code (sync):

-----CODE START-----
// [WRITE THE DEVICE NAME HERE]
rf.register_Receiver(
, // mod
29696, // initseq
0, // lo_prefix
0, // hi_prefix
0, // first_lo_ign
352, // lo_short
352, // lo_long
352, // hi_short (0 => take lo_short)
352, // hi_long (0 => take lo_long)
352, // lo_last
3200, // sep
9 // nb_bits
);
-----CODE END-----

Actually it is possible to read the one above, considering it is Manchester with 352 us of typical duration step, of 9 bits.
You'd then see it is only ZEROs (and it is why RF433any cannot guess encoding: at no moment does the "long" duration show up).

Second code (encoded with Manchester):

-----CODE START-----
// [WRITE THE DEVICE NAME HERE]
rf.register_Receiver(
RFMOD_MANCHESTER, // mod
3200, // initseq
0, // lo_prefix
0, // hi_prefix
0, // first_lo_ign
352, // lo_short
704, // lo_long
0, // hi_short (0 => take lo_short)
0, // hi_long (0 => take lo_long)
1072, // lo_last
3200, // sep
57 // nb_bits
);
-----CODE END-----

(i've updated durations so that they don't go beyond 30000 ~= near max 16-bit integer value)

ULTIMATELY

In order to receive the code, I suggest you ignore the first sync sequence and only try and get the MANCHESTER sequence, using the rf.register_Receiver you see above (the one declared with RFMOD_MANCHESTER).

Hope this helps,

Regards, Sébastien Millet