Multi-SNICS_Interlock/README.md
2024-05-09 16:15:21 -04:00

64 lines
1.7 KiB
Markdown

# Introduction
The interlock folder contains P1AM-100 code (which is Arduino MKR1000).
The Listen2Arduino.py is a script for listening the P1AM-100 output (via USB), and put the status, the tritium, Vaccum, and SubPump reading to the fsunuc.physics.fsu.edu database. It will also save the status into ~/data.txt. The data.txt is used for the statusDisplay to run the local dashboard.
A brief diagram to show the data flow
```cpp
P1AM --> Listen2Arduino.py
+---> data.txt --> statusDisplay
+---> database
```
# Setup using Arduino IDE 1.X
The P1AM.h library is needed.
* PA1M.h
* Ethernet.h
* liquidCrystal.h
also, need to add board MKR1000, use the baord manger, search for
* Arduino SAMD Boards
# Setup the Raspberry Pi
need to install the python package for InfluxDB-client
```sh
sudo python -m pip install --break-system-package inlfuxdb-client
```
## influx_token.txt
the influx database need a token for access. the token for the interlock can be found in https://fsunuc.physics.fsu.edu/elog/LabMaintenance/7
## interlock database at fsunuc.physics.fsu.edu
database name : interlock
## Setup system service for the Listen2Arduino.py
In order to make the Listen2Arduino.py to run at startup and as a background daemon,
copy the listen2P1AM.service to /etc/systemd/system/
run
```sh
sudo systemctl daemen-reload
sudo systemctl enable listen2P1AM.service`
sudo systemctl start listen2P1AM.service`
```
## make a symbolic link to ~/data.txt
Once the Listen2Arduino.py is running, it will create ~/data.txt, so that the local status display can read and update the status. create a symbolic link
```sh
cd ~/Multi-SNICS_Interlock/statusDisplay/
ln -s ~/data.txt .
```