From 01ff4dcd9e2d07bb080b3f09cefc93ca523378e7 Mon Sep 17 00:00:00 2001 From: Matthew Grove Date: Sun, 2 Nov 2025 11:19:44 +0000 Subject: [PATCH] Add example service file --- README.md | 2 +- thingy52-bridge.service | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 thingy52-bridge.service diff --git a/README.md b/README.md index e7c1373..1bf6a55 100644 --- a/README.md +++ b/README.md @@ -4,4 +4,4 @@ MQTT bridge for BLE Nordic Instruments Thingy:52. ## Usage -Update the parameters found in `app.py` and run it with `python3 app.py`. +Update the parameters found in `app.py` and run it with `python3 app.py`. To run the app as a service, copy `thingy52-bridge.service` to `/etc/systemd/system/` and edit the path to `app.py` within it. diff --git a/thingy52-bridge.service b/thingy52-bridge.service new file mode 100644 index 0000000..7327e39 --- /dev/null +++ b/thingy52-bridge.service @@ -0,0 +1,14 @@ +[Unit] +Description=Bridge Thingy:52 to MQTT +Wants=network-online.target +After=network.target network-online.target + +[Service] +Type=simple +User=service +ExecStart=python3 /path/to/thingy52-mqtt-bridge/app.py +Restart=on-failure +RestartSec=10s + +[Install] +WantedBy=multi-user.target