From 37a879bab812a70308f74b34bf579597dc6dd663 Mon Sep 17 00:00:00 2001 From: Franco Carbognani Date: Sat, 24 Aug 2024 15:01:51 +0200 Subject: [PATCH 1/2] Create mqttproxy.service --- configs/mqttproxy.service | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 configs/mqttproxy.service diff --git a/configs/mqttproxy.service b/configs/mqttproxy.service new file mode 100644 index 00000000..751cf6cb --- /dev/null +++ b/configs/mqttproxy.service @@ -0,0 +1,26 @@ +# This unit file is used to launch the mqttproxy scripts on boot. +# Symlink it with `ln -s configs/mqttproxy.service +# /etc/systemd/system/mqttproxy.service` before using. +# Use e.g. `systemctl enable mqttproxy.service` +# to enable the service. +# Once symlinked and enabled for each sensor, the services will +# start automatically on boot. +# They can be controlled with `start`/`stop`/`restart`/`status`. +# Use e.g. `journalctl -u mqttproxy.service -f` to +# see the script output. + +[Unit] +Description= mqttproxy (sending data to mqtt.simoc.space) service +After=network.target + +[Service] +User=pi +WorkingDirectory=/home/pi/simoc-sam +Environment=PYTHONUNBUFFERED=1 +ExecStart=/home/pi/simoc-sam/venv/bin/python -m simoc_sam.mqttproxy +Restart=always +StandardOutput=journal +StandardError=journal + +[Install] +WantedBy=multi-user.target From 64cedbcc05ae4c1a87352f8b7d06cd9b1e08feed Mon Sep 17 00:00:00 2001 From: Franco Carbognani Date: Sat, 24 Aug 2024 15:07:02 +0200 Subject: [PATCH 2/2] Create mqttbridge.service --- configs/mqttbridge.service | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 configs/mqttbridge.service diff --git a/configs/mqttbridge.service b/configs/mqttbridge.service new file mode 100644 index 00000000..9e4f3ed4 --- /dev/null +++ b/configs/mqttbridge.service @@ -0,0 +1,25 @@ +# This unit file is used to launch the mqttbridge scripts on boot. +# Symlink it with `ln -s configs/mqttbridge.service +# /etc/systemd/system/mqttbridge.service` before using. +# Use e.g. `systemctl enable mqttbridge.service` +# to enable the service. +# Once symlinked and enabled for each sensor, the services will +# start automatically on boot. +# They can be controlled with `start`/`stop`/`restart`/`status`. +# Use e.g. `journalctl -u mqttbridge.service -f` to +# see the script output. +[Unit] +Description= mqttbridge (forwarding data to simoc web) service +After=network.target + +[Service] +User=pi +WorkingDirectory=/home/pi/simoc-sam +Environment=PYTHONUNBUFFERED=1 +ExecStart=/home/pi/simoc-sam/venv/bin/python -m simoc_sam.mqttbridge +Restart=always +StandardOutput=journal +StandardError=journal + +[Install] +WantedBy=multi-user.target