diff --git a/systemd/README.md b/systemd/README.md index f80f01a..e548373 100644 --- a/systemd/README.md +++ b/systemd/README.md @@ -139,7 +139,26 @@ systemctl --user restart sensorpajen ``` ### Troubleshooting +### Permission Denied Errors +If you see `PermissionError: [Errno 1] Operation not permitted` in the logs: + +```bash +# Verify Bluetooth capabilities are set on Python binary +getcap ~/.local/share/virtualenvs/*/bin/python3.* + +# If not set, apply capabilities (adjust path to your venv): +sudo setcap 'cap_net_raw,cap_net_admin+eip' $(readlink -f ~/sensorpajen/.venv/bin/python3) + +# Verify it was set: +getcap $(readlink -f ~/sensorpajen/.venv/bin/python3) +# Should show: cap_net_admin,cap_net_raw+eip + +# Restart the service +systemctl --user restart sensorpajen +``` + +**Important**: Capabilities must be set on the **actual Python binary**, not symlinks. Use `readlink -f` to resolve the real path. #### Service Won't Start ```bash