Drive Conrad RSL switch with Raspberry Pi
Starting version 2.1.0:
- Bookworm is the minimum Debian version needed
- Linux user which run rc-rsl must be part of
gpio
group
Steps are to perform directly on the Raspberry Pi:
- Get rc-rsl repository
# Move into sources directory
cd ~/src
# Get sources
git clone https://github.com/cyosp/rc-rsl
- Install compile dependency
sudo apt install libgpiod-dev -y
- Compile and install rc-rsl
# Move into sources directory
cd ~/src/rc-rsl
# Compile rc-rsl
make
# Install rc-rsl
sudo make install
First, a cross compilation toolchain for arm-linux-gnueabihf
must be installed.
This link could help you if needed: https://github.com/Pro/raspi-toolchain.
Then copy file systems /usr
and /lib
from latest Raspbian image (Buster the 8th december 2019) into a rootfs
folder like: ~/raspberrypi/rootfs
.
Last, add package content: libgpiod-dev
and libgpiod2
into ~/raspberrypi/rootfs
folder.
Now, run:
make CROSS_COMPILE=arm-linux-gnueabihf SYSTEM_ROOT=~/raspberrypi/rootfs
rc-rsl <GPIO device> <GPIO offset> <emitter id> <channel id> <command name> [repeat command]
Arguments detailed:
-
GPIO device
Raspberry Pi GPIO pin headers are available through:
/dev/gpiochip0
. -
GPIO offset
Pin offset for GPIO device.
Raspberry Pi mapping can be found here: https://www.raspberrypi.org/documentation/usage/gpio/.
-
emitter id
Unique id of the emitter: a number between 0 and 67108863
-
channel id
Emitter channel: a number between 1 and 16
-
command name
Command to send to the switch:
- on
- off
- onoff (on and off in the same time)
-
repeat command
How many times the command must be repeated : a number greater than 0
# Pairing a switch with remote control id: 123456 and channel: 7
rc-rsl /dev/gpiochip0 17 123456 7 on 6
# Switch off a switch with remote control id: 123456 and channel: 7
rc-rsl /dev/gpiochip0 17 123456 7 off
# Switch on a switch with remote control id: 123456 and channel: 7
rc-rsl /dev/gpiochip0 17 123456 7 on
# Unbind a switch with remote control id: 123456 and channel: 7
rc-rsl /dev/gpiochip0 17 123456 7 onoff 6
rc-rsl /dev/gpiochip0 17 123456 7 off 6
rc-rsl is released under the BSD 3-Clause License. See the bundled LICENSE.md
for details.