Writing a new device driver

111 views
Skip to first unread message

Or Goshen

unread,
Apr 10, 2023, 7:00:29 AM4/10/23
to rtl_433
Hi,

I'm trying to write a new device driver for a new device.

I know the following things about that device:
Transmission frequency: 916.3Mhz
Modulation: FSK
Codec: Manchester 1

I manage to capture signal using the command "rtl_433 -f 916.32M -S all -T 60" and analyze it using another program called URH (Universal Radio Hacker, that is how I figured it uses FSK and manchester 1).
I know exactly what a transmitted packet contains and where the fields are (Used URH).

Question is - how to I use this knowledge to write a driver ?
Right now I'm stuck at parsing a captured packet using rtl_433.

I run the following command:
"rtl_433 -A -r g001_916.3M_1000k.cu8" (same file I analysed successfully in URH), but the output doesnt make any sense.

I tried running the following command with the flex driver:
"rtl_433 -R0 -X "n=Test,m=FSK_MC_ZEROBIT,s=8,l=16,r=4000" -r g001_916.3M_1000k.cu8 (I guessed the s,l,r values - no idea what to assign to them)

The output doesnt look the same as it is in URH.

What am I doing wrong / what am I missing ?

Thanks

Christian Z.

unread,
Apr 10, 2023, 2:09:52 PM4/10/23
to rtl_433
I tried running the following command with the flex driver:
"rtl_433 -R0 -X "n=Test,m=FSK_MC_ZEROBIT,s=8,l=16,r=4000" -r g001_916.3M_1000k.cu8 (I guessed the s,l,r values - no idea what to assign to them)

Proper timings are the first thing to analyze. For MC and the underlying PCM (NRZ) short and long are the same value: the length of a (half-)bit.
Use a FSK_PCM decoder first and set s and l to the half-bit length. Then check if the bitstream really is valid MC and maybe switch to using MC, otherwise decode the MC later.
 

Or Goshen

unread,
Apr 10, 2023, 3:12:54 PM4/10/23
to rtl_433
I know for a fact that the codec used is Manchester 1.
When I'm using this tool I get correct results (as seen in attached picture).
I also attached the signal file.

The command:
rtl_433 -R0 -X "n=Test,m=FSK_MC_ZEROBIT,s=8,l=8,r=4000" -r g001_916.3M_1000k.cu8
.. doesn't return the same results the online tool does.
That should the "r" value be ?
g001_916.3M_1000k.cu8
Screenshot from 2023-04-10 21-44-10.png

Christian Z.

unread,
Apr 11, 2023, 5:22:55 AM4/11/23
to rtl_433
Use the minmax demod and 20 for reset. See https://github.com/merbanan/rtl_433/issues/2479 why the output has a different prefix.

rtl_433 -Y minmax -R 0 -X "n=Test,m=FSK_MC_ZEROBIT,s=8,l=8,r=20"

Or Goshen

unread,
Apr 11, 2023, 6:21:53 AM4/11/23
to rtl_433
Result of "tl_433 -Y minmax -R 0 -X "n=Test,m=FSK_MC_ZEROBIT,s=8,l=8,r=20" -r g001_916.3M_1000k.cu8" is:
time      : @0.045390s
model     : Test         count     : 1             num_rows  : 1             rows      :
len       : 220          data      : 7fffffffffc196f5138537b4ef079033ed786ff5fffabeed8e06870
codes     : {220}7fffffffffc196f5138537b4ef079033ed786ff5fffabeed8e06870

Result of the online tool (for same file which I attached) is:
Bits: {234} 00 00 00 00 00 00 / 06 5B D4 4E 14 DE D3 BC 1E 40 CF B5 E1 BF D7 FF EA FB B6 38 1A 1C 0

The online tool returns the correct result.

How can I make rtl_433 return same result as the online tool ?

Christian Z.

unread,
Apr 11, 2023, 7:22:34 AM4/11/23
to rtl_433
Except for the prefix (which is a preamble and has no data) the bits are the same, see

Also note that here actually PDV is wrong about the preamble. It is truely all 1's as in 7fffffffffc. And that is denoted by the slash ("/") in the output.

Or Goshen

unread,
Apr 11, 2023, 7:42:02 AM4/11/23
to rtl_433
Thanks,

I was missing the "invert".

This works:
rtl_433 -Y minmax -R 0 -X "n=Test,m=FSK_MC_ZEROBIT,s=8,l=8,r=20,invert" -r g001_916.3M_1000k.cu8
Reply all
Reply to author
Forward
0 new messages