rfmqtt - RF 433MHz to MQTT bridge.
- Change your working directory to the project directory.
- Create a build directory, e.g.
mkdir build
. - Change to the build directory, e.g.
cd build
. - Use CMake to create project files, e.g.
cmake ..
to create aMakefile
orcmake -GNinja ..
to create a Ninja build file. - Compile the code, e.g.
make -j4
orninja
. This takes several minutes on a Raspberry Pi 2. - After successful compilation, the
rfmqtt
executable should be ready and waiting in the build directory.
For everyday use, you might want to build as a Release
or RelWithDebInfo
build type to be more efficient on resources.
- Download or compile the
rfmqtt
binary and exampleconfig.yaml
. - Configure your MQTT connection, RF devices and mappings in
config.yaml
.
- Copy
rfmqtt
to/usr/local/bin
to installrfmqtt
to be used globally, e.g.cp rfmqtt /usr/local/bin
. - Copy
config.yaml
to~/.config/rfmqtt/config.yaml
for it to be picked up automatically, e.g.cp config.yaml ~/.config/rfmqtt/
.
The config file will also get picked up in the working directory and other
dirs defined by the "XDG Base Directory Specification". You can also use the
--config
command line option to set a custom path.
- Copy
rfmqtt
to/usr/local/bin
if you want to use the default service configuration, e.g.cp rfmqtt /usr/local/bin
. - Copy
config.yaml
to/etc/xdg/rfmqtt/config.yaml
for it to be picked up automatically, e.g.mkdir /etc/xdg/rfmqtt; cp config.yaml /etc/xdg/rfmqtt/
. - Copy
service/rfmqtt.service
to/etc/systemd/system/
, e.g.sudo cp service/rfmqtt.service /etc/systemd/system/
. - Run
sudo systemctl daemon-reload
to refresh services. This should be done every time you change the.service
file.
- Run
rfmqtt
if installed or./rfmqtt
to run from working directory.
See ./rfmqtt -h
for more info on command line arguments.
- Install as a service if you haven't already.
- Run
sudo systemctl start rfmqtt.service
to start the service. - Now it should always run in the background automatically.
You can use status
in place of start
to see the status of the service.
Also useful are stop
and restart
.