From: Benjamin Braatz Date: Wed, 24 Feb 2021 13:04:48 +0000 (+0100) Subject: Baudrate und Lüfter Schaltschrank X-Git-Url: http://git.graph-it.com/?a=commitdiff_plain;h=0206a50e34351ea7a87ede90e585a98975f202ea;p=graphit%2Fschaltschrank.git Baudrate und Lüfter Schaltschrank --- diff --git a/conf.json b/conf.json index 8ff9199..df698d1 100644 --- a/conf.json +++ b/conf.json @@ -6,7 +6,7 @@ [ [ "A1-1", "T1-1", "Motorschütz" ], [ "A1-2", "T1-2" ], [ "A1-3", "T1-3", "Zentralschmierung" ], [ "A1-4", "T1-4", "Ölpumpe" ], [ "A1-5", "T1-5" ], [ "A1-6", "T1-6", "Notaus Schaltschrank Lampe" ], - [ "A1-7", "T1-7" ], [ "A1-8", "T1-8", "Notaus Maschine Lampe" ] ] }, + [ "A1-7", "T1-7", "Lüfter Schaltschrank" ], [ "A1-8", "T1-8", "Notaus Maschine Lampe" ] ] }, { "name": "A2", "type": "output", "address": 57, @@ -54,10 +54,11 @@ "andpins": [ { "name": "Okay", "pins": - [ "Zentralschmierung Rückmeldung", "Ölpumpe Rückmeldung", + [ "Zentralschmierung", "Ölpumpe", "Schwungrad", "Öldruck", "Bruchplatte Einzug" ] } ], "modbus": { "serial device": "/dev/serial0", + "baudrate": 115200, "slave id": 1 }, "statemachines": [ { "name": "Notaus Schaltschrank", @@ -115,6 +116,9 @@ "value": false }, { "name": "setpin", "pin": "Ölpumpe", + "value": false }, + { "name": "setpin", + "pin": "Lüfter Schaltschrank", "value": false } ], "events": [ { "name": "pinstate", @@ -128,6 +132,9 @@ "value": false }, { "name": "setpin", "pin": "Ölpumpe", + "value": false }, + { "name": "setpin", + "pin": "Lüfter Schaltschrank", "value": false } ], "events": [ { "name": "pinstate", @@ -147,6 +154,9 @@ "value": true }, { "name": "setpin", "pin": "Ölpumpe", + "value": true }, + { "name": "setpin", + "pin": "Lüfter Schaltschrank", "value": true } ], "events": [ { "name": "pinstate", @@ -170,6 +180,9 @@ "value": true }, { "name": "setpin", "pin": "Ölpumpe", + "value": true }, + { "name": "setpin", + "pin": "Lüfter Schaltschrank", "value": true } ], "events": [ { "name": "pinstate", diff --git a/schaltschrank/config.py b/schaltschrank/config.py index 902cd20..a4cd59b 100644 --- a/schaltschrank/config.py +++ b/schaltschrank/config.py @@ -115,8 +115,8 @@ async def fu_handler(queues, fu): async def process_modbus_conf(modbus_conf, queues): print("Configuring FU") - #port = SerialPort(modbus_conf['serial device']) - port = serialio.serial_for_url(f"serial://{modbus_conf['serial device']}") + port = serialio.serial_for_url(f"serial://{modbus_conf['serial device']}", + baudrate=modbus_conf['baudrate']) await port.open() client = SerialClient(port, modbus_conf['slave id']) fu = SJP1Fu(client)