From a3d85453109cd717b778f8045ba8c494307c4ec5 Mon Sep 17 00:00:00 2001 From: Darryl Bond Date: Sat, 4 Jun 2022 17:34:28 +1000 Subject: [PATCH] Fix mqtt installation coco Better describe installation of the mqtt daemon on Fedora and Debian --- README.md | 42 ++++++++++++++++++++++++++++++++++++------ 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 4b7f51f..cd05902 100644 --- a/README.md +++ b/README.md @@ -457,27 +457,57 @@ MQTT support provides capability of using Home Assistant or nodered with usbrela #### usbrelayd A python daemon using libusbrelay to connect to an MQTT server. When the daemon starts, it publishes the state of all usbrelay devices found and subscribes to command topics for each relay. To install: + +Debian ``` -sudo useradd usbrelay -sudo apt-get install python-paho-mqtt (Debian) -dnf install python3-paho-mqtt (Fedora) +sudo apt-get install python3-paho-mqtt sudo cp usbrelayd /usr/sbin sudo cp usbrelayd.conf /etc/usbrelayd.conf ``` +Fedora +``` +sudo useradd usbrelay +sudo dnf install python3-paho-mqtt +sudo cp usbrelayd /usr/sbin +sudo cp usbrelayd.conf /etc/usbrelayd.conf +``` + Modify /etc/usbrelayd.conf to suit your circumstances. #### usbrelay.service -A systemd unit for controlling and monitoring the usbrelayd daemon -The systemd service file references your MQTT broker hostname as mymqttbroker. Either create that hostname in DNS or /etc/hosts. Alternatively, If you are using an external MQTT broker, modify the service file accordingly. +A systemd unit for controlling and monitoring the usbrelayd daemon. The file comes configured for Fedora and needs to be modified for Debian. + + +Debian + +Edit usbrelayd.service and change +``` +SupplementaryGroups=usbrelay +``` +to +``` +SupplementaryGroups=plugdev +``` To install: + ``` sudo cp usbrelayd.service /etc/systemd/system sudo systemctl daemon-reload ``` #### 50-usbrelay.rules -A udev rule file that reacts and starts/stops the usbrelayd.service when a module is pluggedin or removed. The file should be installed with the initial installation. +A udev rule file that reacts and starts/stops the usbrelayd.service when a module is pluggedin or removed. The file should be installed with the initial installation. The file comes configured for Fedora and needs to be modified for Debian. +Debian + +Edit 50-usbrelay.rules and change +``` +GROUP="usbrelay" +``` +to +``` +GROUP="plugdev" +``` To install: ``` sudo cp 50-usbrelay.rules /etc/udev/rules.d