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