initial release
This commit is contained in:
parent
484a6bfae0
commit
2e451d99a7
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"MQTT_SERVER": "",
|
||||
"MQTT_USE_AUTH": false,
|
||||
"MQTT_USERNAME": "",
|
||||
"MQTT_PASSWORD": "",
|
||||
"MQTT_BASE_TOPIC": "/ledstrip/fixture1",
|
||||
"FRAME_TIME": 0.05,
|
||||
"SERIAL_PORTS_MAP": [
|
||||
"COM1"
|
||||
],
|
||||
"LED_MAP": [
|
||||
60
|
||||
]
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
import json
|
||||
from getpass import getpass
|
||||
|
||||
print("Siwat Light Control Protocol Configuration Generator")
|
||||
server = input("MQTT Server Hostname / IP Address : ")
|
||||
username = ""
|
||||
password = ""
|
||||
while True:
|
||||
use_auth = input("Does this server require username and password to login (yes/no) : ")
|
||||
if use_auth.lower() == "yes":
|
||||
username = input("Username : ")
|
||||
password = getpass("Password : ")
|
||||
break
|
||||
elif use_auth.lower() == "no":
|
||||
break
|
||||
print("Please answer yes / no")
|
||||
base_topic = input("MQTT Base Topic : ")
|
||||
frame_time = input("Frame Time (1/refresh rate) : ")
|
16
install.sh
16
install.sh
|
@ -1,8 +1,16 @@
|
|||
echo "Installing Dependencies"
|
||||
sudo apt update
|
||||
sudo apt install python3 python3-pip
|
||||
sudo apt install -y python3 python3-pip
|
||||
sudo pip3 install siwat-light-control-protocol
|
||||
sudo mkdir /slcp
|
||||
|
||||
echo "Moving Directory to SLCP"
|
||||
sudo mv -v ./ /slcp
|
||||
sudo chmod 777 -Rv /slcp
|
||||
cp -v ./slcp_config.json /slcp/config.json
|
||||
echo "Adding Service to systemd"
|
||||
|
||||
echo "Creating systemd Service"
|
||||
sudo chmod +x /slcp/jumpstart.sh
|
||||
sudo ln -v /slcp/slcp.service /lib/systemd/system/slcp.service
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable slcp.service
|
||||
echo "Installation Completed!"
|
||||
echo "Adjust /slcp/config.json then run sudo \"systemctl start slcp.service\""
|
|
@ -0,0 +1,2 @@
|
|||
cd /slcp
|
||||
python -m siwat_remote_light_control_protocol_server
|
11
slcp.service
11
slcp.service
|
@ -0,0 +1,11 @@
|
|||
[Unit]
|
||||
Description=Siwat Light Control Protocol Server
|
||||
After=multi-user.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
WorkingDirectory=/slcp
|
||||
ExecStart=/slcp/jumpstart.sh
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
Loading…
Reference in New Issue