Adding a new remote device - Geoff99/rtl_433 GitHub Wiki
Simple doorbell, remote button, PIR, … devices are best added as flex decoders with a short .conf file. There are already some conf files, mostly you just need to change the timings.
How to use git to create new repositories by forking of rtl_433_tests and rtl_433
Create a github account
Once you have an account you will need to create your own copies of the rtl_433 and rtl_433_tests code repositories. To do this find the fork icon on the top right of the following pages:
https://github.com/merbanan/rtl_433
https://github.com/merbanan/rtl_433_tests
This will create equivalent repositories under your account.
Install git on your home PC
sudo apt-get git
Use "git clone" to download the code to your home PC
git clone https://github.com/YOUR-NAME/rtl_433.git
git clone https://github.com/YOUR-NAME/rtl_433_tests.git
Generally, origin should be your github repo (a fork of merbanan/rtl_433_tests). Typically when you clone the repository locally to do development, you are cloning your fork on github that you have permission to push to. After you push changes to a branch of your github repo, you use github's web interface to create a pull request.
How to record, prepare an push signals to rtl_433_tests
Record
Create a new directory structure in rtl_433_tests/tests/ to store your radio signals
Add signals by creating a directory with the protocol name and then add the gfiles under a directory with 2 number directory name. Also add a readme.md and a picture of the hardware.
E.g tests/prologue/01
using rtl_433 -a -t record samples to the new directory path.
Prepare
Now add & then commit your radio samples to your local repository
You can propose changes (add it to the Index) using git add
To record a comment for your changed files use: git commit -m "New device recording for prologue device" Now the file is committed to the HEAD, but not in your remote repository (github) yet.
Push
Your changes are now in the HEAD of your local working copy. To send those changes to your remote repository, execute
git push origin master
Further Notes:
Periodically you will want to synchronise your local repos with https://github.com/merbannan/rtl_433_tests.git
git remote add merbanan https://github.com/merbannan/rtl_433_tests.git
git pull merbanan
git push origin master
How to analyse a recorded signal and create a new device specification
To add a new remote device specification, you will need to implement the callback method declared in r_device, add your source file to src/devices, and your r_device to the rtl_433_devices.h header file. You also need to add the name of your source file to src/CMakeLists.txt and Makefile.am.
Analyse the signal
rtl_433 -A
Is the modulation AM (OOK) or FM (FSK)
Using a program called Audacity http://www.audacityteam.org/ import the signal as raw_data and have a look at the waveform to determine if it using OOK or FSK modulation.
Find out the timings/limits for short and long pulses. Units of _limit data are in microseconds, and values are given by the -a option.
.name = "Rubicson Temperature Sensor",
.modulation = OOK_PULSE_PPM_RAW,
.short_limit = 488+970, // Gaps: Short 976µs, Long 1940µs, Sync 4000µs
.long_limit = 970+2000, // Pulse: 500µs (Initial pulse in each package is 388µs)
.reset_limit = 4800, // Two initial pulses and a gap of 9120µs is filtered out
.json_callback = &rubicson_callback,
.disabled = 0,
.demod_arg = 0,
.fields = output_fields,
};
Appropriate short, long and reset limits
How to upload the new device driver to your forked repository and request a pull request
Generally, origin should be your github repo (a fork of merbanan/rtl_433_tests). Typically when you clone the repo locally to do development, you are cloning your fork on github that you have permission to push to. After you push changes to a branch of your github repo, you use github's web interface to create a pull request.