From 4efb01b3f5c9ea236ab88accce6cf818543170db Mon Sep 17 00:00:00 2001 From: "Ryan@interlock" Date: Thu, 9 May 2024 15:16:30 -0400 Subject: [PATCH] resetup of the raspberry pi after SD card broken --- Listen2Arduino.py | 4 ++-- interlock/config.h | 2 +- interlock/interlock.ino | 8 +++++++- listen2P1AM.service | 2 +- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Listen2Arduino.py b/Listen2Arduino.py index 3864f83..be9bc68 100755 --- a/Listen2Arduino.py +++ b/Listen2Arduino.py @@ -7,7 +7,7 @@ import influxdb_client from influxdb_client import InfluxDBClient, Point, WritePrecision from influxdb_client.client.write_api import SYNCHRONOUS -with open('/home/pi02/influx_token.txt', 'r') as f: +with open('/home/pi03/influx_token.txt', 'r') as f: first_line = f.readline() @@ -24,7 +24,7 @@ print(token) ser = serial.Serial('/dev/ttyACM0', 9600, timeout=1) ser.reset_input_buffer() -outFile = "/home/pi02/data.txt" +outFile = "/home/pi03/data.txt" # cmd='curl -s -XPOST "http://fsunuc.physics.fsu.edu:8086/write?db=interlock" --data-binary @/home/pi02/data.txt' diff --git a/interlock/config.h b/interlock/config.h index 50d3dfd..b9e1139 100644 --- a/interlock/config.h +++ b/interlock/config.h @@ -93,7 +93,7 @@ bool input_normal[16] = { OPEN, // 0 , lvl= 0, Reset switch CLOSED, // 1 , lvl= 3, Emergency source trip switch CLOSED, // 2 , lvl= 1, Cage door contact, level-1 - CLOSED, // 3 , lvl= 3, Fume hood flow switch, level-3 + OPEN, // 3 , lvl= 3, Fume hood flow switch, level-3 OPEN, // 4 , lvl= 2, Vacuum condition - gnd, level-2 CLOSED, // 5 , lvl= 3, Tritium monitor CLOSED, // 6 , lvl= 3, Control Room Emergency Switch diff --git a/interlock/interlock.ino b/interlock/interlock.ino index 79b817e..425b401 100644 --- a/interlock/interlock.ino +++ b/interlock/interlock.ino @@ -83,8 +83,14 @@ void setup() { * Send start-up notice to logging server ######*/ + currentState = startup; + for( int i = 0; i < 16; i++) input[i] = 0; + + P1.writeDiscrete(LOW,out2); //Buzzer silent + output[1] = 0; + // Startup input check - app_Tasks(); + //app_Tasks(); } diff --git a/listen2P1AM.service b/listen2P1AM.service index bfa6d4a..644b028 100755 --- a/listen2P1AM.service +++ b/listen2P1AM.service @@ -3,7 +3,7 @@ Description=Listening P1AM output After=network.target # Adjust the target as needed [Service] -ExecStart=/home/pi02/Multi-SNICS_Interlock/Listen2Arduino.py +ExecStart=/home/pi03/Multi-SNICS_Interlock/Listen2Arduino.py #WorkingDirectory=/home/pi02/Multi-SNICS_Interlock/ # Optional, set the working directory #Restart=always #StartLimitIntervalSec=10