Add configs for toml in controller

This commit is contained in:
Tobias Reisinger 2020-11-22 01:49:20 +01:00
parent 750002daf2
commit 87b3f06092
6 changed files with 79 additions and 74 deletions

View file

@ -0,0 +1,66 @@
[controller]
database = "emgauwa-controller.sqlite"
mqtt-host = "127.0.0.1"
[ports]
# 4422 for testing; 4421 for dev-env; 4420 for testing-env; 4419 for prod-env
discovery = 4422
# 1886 for testing; 1885 for dev-env; 1884 for testing-env; 1883 for prod-env
mqtt = 1886
[logging]
level = "debug"
file = "stdout"
[[relays]]
driver = "piface"
pin = 0
inverted = 0
[[relays]]
driver = "piface"
pin = 1
inverted = 0
[[relays]]
driver = "gpio"
pin = 5
inverted = 1
[[relays]]
driver = "gpio"
pin = 4
inverted = 1
[[relays]]
driver = "gpio"
pin = 3
inverted = 1
[[relays]]
driver = "gpio"
pin = 2
inverted = 1
[[relays]]
driver = "gpio"
pin = 1
inverted = 1
pulse-duration = 3
[[relays]]
driver = "gpio"
pin = 0
inverted = 1
pulse-duration = 3
[[relays]]
driver = "gpio"
pin = 16
inverted = 1
[[relays]]
driver = "gpio"
pin = 15
inverted = 1

View file

@ -1,65 +0,0 @@
[controller]
name = new emgauwa device
: 4422 for testing; 4421 for dev-env; 4420 for testing-env; 4419 for prod-env
discovery-port = 4422
: 1886 for testing; 1885 for dev-env; 1884 for testing-env; 1883 for prod-env
mqtt-port = 1886
mqtt-host = localhost
relay-count = 10
database = controller.sqlite
log-level = debug
log-file = stdout
[relay-0]
driver = piface
pin = 0
inverted = 0
[relay-1]
driver = piface
pin = 1
inverted = 0
[relay-2]
driver = gpio
pin = 5
inverted = 1
[relay-3]
driver = gpio
pin = 4
inverted = 1
[relay-4]
driver = gpio
pin = 3
inverted = 1
[relay-5]
driver = gpio
pin = 2
inverted = 1
[relay-6]
driver = gpio
pin = 1
inverted = 1
pulse-duration = 3
[relay-7]
driver = gpio
pin = 0
inverted = 1
pulse-duration = 3
[relay-8]
driver = gpio
pin = 16
inverted = 1
[relay-9]
driver = gpio
pin = 15
inverted = 1

View file

@ -15,7 +15,8 @@ then
mkdir -p controller
cd controller
git pull >/dev/null || git clone --quiet ssh://git@git.serguzim.me:3022/emgauwa/controller.git . || exit
echo "Trying to pull or clone controller"
git clone --quiet ssh://git@git.serguzim.me:3022/emgauwa/controller.git . >/dev/null 2>&1 || git pull >/dev/null || exit
git checkout dev >/dev/null 2>&1
git checkout $target_branch >/dev/null 2>&1
@ -32,7 +33,7 @@ fi
echo "Emgauwa controller: $($EMGAUWA_CONTROLLER_EXE --version)"
$EMGAUWA_CONTROLLER_EXE start -c $source_dir/emgauwa-controller-testing.ini >$working_dir/controller.log 2>&1 &
$EMGAUWA_CONTROLLER_EXE -c $source_dir/emgauwa-controller-testing.conf >$working_dir/controller.log 2>&1 &
controller_id=$!
cd $working_dir