This daemon should provide basic functionality with mqtt-json context and currently undergoes test.
It will publish all data received from the RepRap web-api without modifications to the specific MQTT server/Service
On a modern Linux system just a few steps are needed to get the daemon working.
The following example shows the installation under Debian/Raspbian below the /opt
directory:
sudo apt install git python3 python3-pip bluetooth bluez
git clone https://github.com/Nightreaver/RRF_WebIF_MQTT.git /opt/rrf-mqtt-daemon
cd /opt/rrf-mqtt-daemon
sudo pip3 install -r requirements.txt
To match personal needs, all operation details can be configured using the file config.ini
.
The file needs to be created first:
cp /opt/rrf-mqtt-daemon/src/config.{ini.dist,ini}
vim /opt/rrf-mqtt-daemon/src/config.ini
Attention: You need to add at least one RRF printer to the configuration.
A first test run is as easy as:
python3 /opt/rrf-mqtt-daemon/src/service.py
With a correct configuration the result should look similar to the the screencap above.
Using the command line argument --config
, a directory where to read the config.ini file from can be specified, e.g.
python3 /opt/rrf-mqtt-daemon/src/service.py --config /opt/rrf-mqtt-daemon
The extensive output can be reduced to error messages:
python3 /opt/rrf-mqtt-daemon/src/service.py > /dev/null
You most probably want to execute the program continuously in the background. This can be done either by using the internal daemon or cron.
Attention: Daemon mode must be enabled in the configuration file (default).
-
Systemd service - on systemd powered systems the recommended option
sudo cp /opt/rrf-mqtt-daemon/template.service /etc/systemd/system/rrfd.service sudo systemctl daemon-reload sudo systemctl start rrfd.service sudo systemctl status rrfd.service sudo systemctl enable rrfd.service
-
Screen Shell - Run the program inside a screen shell:
screen -S rrf-mqtt-daemon -d -m python3 /path/to/rrf-mqtt-daemon/src/service.py
The original source was taken from Thom Dietrich from his Xiaomi Mi Flora Plant Sensor MQTT Client/Daemon.
It was released under MIT license by the time it was copied.
Thanks goes to Thom for all the previous work done with his MQTT Daemon.