initialize
This commit is contained in:
19
eg4battery/etc/systemd/system/eg4-battery.service
Normal file
19
eg4battery/etc/systemd/system/eg4-battery.service
Normal file
@@ -0,0 +1,19 @@
|
||||
[Unit]
|
||||
Description=EG4 LifePower4 RS485 -> MQTT bridge
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=noise
|
||||
Group=dialout
|
||||
# Systemd's default PATH does not include ~/.local/bin where `uv` is installed.
|
||||
# The script's `#!/usr/bin/env -S uv run --script` shebang needs to find uv.
|
||||
Environment=PATH=/home/noise/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
||||
# uv manages the ephemeral venv per the PEP-723 inline deps in the script
|
||||
ExecStart=/usr/local/bin/eg4-battery -C /home/noise/.config/eg4-battery/eg4-battery.yaml
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
5
eg4battery/etc/udev/rules.d/99-eg4-rs485.rules
Normal file
5
eg4battery/etc/udev/rules.d/99-eg4-rs485.rules
Normal file
@@ -0,0 +1,5 @@
|
||||
# EG4 LifePower4 RS485 bus via USB-serial adapter.
|
||||
# Grants dialout group access; /dev/serial/by-id/ symlink survives USB moves.
|
||||
# Adjust idVendor/idProduct if you use a CP210x (0x10c4:0xea60) or CH340
|
||||
# (0x1a86:0x7523) adapter instead of the reference FTDI FT232R.
|
||||
SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", MODE="0660", GROUP="dialout"
|
||||
Reference in New Issue
Block a user