Skip to content

Add service file #7

Open
Open
@geoffbon

Description

@geoffbon

Hi - I finally got this working as a service, using your hack_ble.sh file. I think it would be useful to add instructions to create a service file:

  1. Create new file /etc/systemd/system/ble_sensor_mqtt.service
  2. Paste in, adjusting the path to hack_ble.sh and the user name:
[Unit]
Description=BLE Sensor MQTT service
After=network.target
StartLimitIntervalSec=0

[Service]
Type=simple
Restart=on-abort
RestartSec=1
User=pi
ExecStart=/usr/bin/sudo /home/pi/govee/bluetooth-temperature-sensors/hack_ble.sh

[Install]
WantedBy=multi-user.target
  1. Edit the path in hack_ble.sh to match the source dir
  2. sudo chmod a+x ./hack_ble.sh
  3. sudo systemctl daemon-reload
  4. sudo systemctl start ble_sensor_mqtt
  5. sudo systemctl status ble_sensor_mqtt
  6. If everything looks good, sudo systemctl enable ble_sensor_mqtt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions