Skip to content

Commit

Permalink
Add systemd service file
Browse files Browse the repository at this point in the history
  • Loading branch information
bofh69 committed Mar 9, 2024
1 parent cd5a946 commit fb8665f
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,17 @@ This can be written via NXP's TagWriter on a phone, or better yet,
use the `write_tags.py` program. The later fetches Spoolman's filaments,
shows a simple text interface where the spool can be chosen, and when
pressing return, writes to the tag.

## Run automaticly with systemd

Copy nfc2klippper.service to `/etc/systemd/system`, then run:

```sh
sudo systemctl start nfc2klipper
sudo systemctl enable nfc2klipper
```

To see its status, run:
```sh
sudo systemctl status nfc2klipper
```
20 changes: 20 additions & 0 deletions nfc2klipper.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#Systemd NFC to Klipper Service

[Unit]
Description=Starts nfc2klipper
Documentation=https://github.com/bofh69/nfc2klipper
After=moonraker.service
Wants=udev.target

[Install]
Alias=nfc2klipy
WantedBy=multi-user.target


[Service]
Type=simple
User=pi
RemainAfterExit=yes
ExecStart= /home/pi/nfc2klipper/venv/bin/python3 /home/pi/nfc2klipper/nfc2klipper.py
Restart=always
RestartSec=10

0 comments on commit fb8665f

Please sign in to comment.