Analyzing the timings of different 433 mhz radio frequencies can be challenging and tedious work. This project aims to simplify that process by determining signal averages and sequences with a little math and guesswork. Initially this project was created to retrieve which codes were sent by the RF controllers to that they could be used by @milaq/rpi-rf in Home Assistant.
Git clone or download as zip this project. Open the location in a terminal and run:
npm install
You will need a raw dump in the format of input name followed a sequence of timings (only the first number is used):
button1
0.00254 0
0.01262 1
0.00273 0
0.01222 1
...
button2
0.00248 0
0.01222 1
0.00246 0
0.01253 1
...
This can be fetched using the library over at @jderehag/rpi-rfsniffer and a GPIO attached RF receiver such as an MX-RM-5V
attached to a raspberry pi (careful to not send 5V, but 3.3V to the GPIO pin). Install following the instructions and then start storing inputs running the record command:
rfsniffer record button1
Use the --help flag to learn what options exist
When you are satisfied that the inputs have been recorded, dump the raw data to a text file:
rfsniffer -v dump > codes.txt
and transfer it to the machine running this decode project, e.g from a local machine run:
scp user@host:/path/to/codes.txt /path/to/decoder
Final step is to run the decoder and fine tune the arguments.
npm start [-- --flags value]
This should give you an output in the following format:
If some of the inputs are faulty, either incorrect number of bits, bad averages, or decimal not sequencing, try retraining the sniffer using the same record
command as earlier for that input. Another alternative is to fine tune the analysis using some of argument the flags below.
All flags are optional.
Default location to resolve file from
--path string
Default: 'codes.txt'
Number of signals before cutoff 128 * 6 + margin
--limit number
Default: 800
Unit the timings are specified in
--unit s|ms|us|μs
Default: 's'
Noise deviation
--deviation number
Default: 1.1
Factor which to consider modulation as a pause between sequences: short + long * pause
--pause number
Default: 4
Factor which to consider modulation as a sync signal: short + long * sync
--sync number
Default: 1.5
Filter out sequences not matching bits length
--bits number
Default: 32
Bits use Manchester encoding 0 => 01
and 1 => 10
--me boolean
Default: true
Debug specific input only with increased detail or summary of all
--input all|string
Default: 'all'