mirror of
https://github.com/akuker/RASCSI.git
synced 2026-04-20 11:17:58 +00:00
Rebrand project to PiSCSI (#1016)
* Rebrand project to PiSCSI - rascsi ->piscsi - rasctl -> scsictl - rasdump -> scsidump - ras* -> piscsi* (rasutil -> piscsi_util, etc.) * Refined the formatting and wording of the app startup banner * Kept some references to rascsi and rasctl where backwards compatibility is concerned * Point to the new github repo URL Co-authored-by: nucleogenic <nr@nucleogenic.com> Co-authored-by: Uwe Seimet <Uwe.Seimet@seimet.de>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# RaSCSI OLED Screen
|
||||
# PiSCSI OLED Screen
|
||||
|
||||
## Run as standalone script for development / troubleshooting
|
||||
|
||||
@@ -9,7 +9,7 @@ $ python3 -m venv venv
|
||||
$ source venv/bin/activate
|
||||
# Install requirements
|
||||
$ pip3 install -r requirements.txt
|
||||
$ PYTHONPATH=$PWD/src:$(dirname $PWD)/common/src python3 src/rascsi_oled_monitor.py
|
||||
$ PYTHONPATH=$PWD/src:$(dirname $PWD)/common/src python3 src/piscsi_oled_monitor.py
|
||||
```
|
||||
|
||||
### Parameters
|
||||
@@ -20,7 +20,7 @@ The script takes two positional parameters:
|
||||
|
||||
Ex.
|
||||
```
|
||||
$ python3 rascsi_oled_monitor.py --rotation 180 --height 64
|
||||
$ python3 piscsi_oled_monitor.py --rotation 180 --height 64
|
||||
```
|
||||
|
||||
_Note:_ Both parameters must be passed for the script to read them. Ordering is also important.
|
||||
|
||||
+5
-5
@@ -1,16 +1,16 @@
|
||||
[Unit]
|
||||
Description=RaSCSI-OLED service
|
||||
After=network.target rascsi.service
|
||||
Description=PiSCSI-OLED Monitor service
|
||||
After=network.target piscsi.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Restart=always
|
||||
RestartSec=2s
|
||||
ExecStart=/home/pi/RASCSI/python/oled/start.sh
|
||||
ExecStop=/bin/pkill --signal 2 -f "python3 src/rascsi_oled_monitor.py"
|
||||
ExecStart=/home/pi/piscsi/python/oled/start.sh
|
||||
ExecStop=/bin/pkill --signal 2 -f "python3 src/piscsi_oled_monitor.py"
|
||||
# Sleep 2s as a crude way for the python interrupt handler to take effect and show the shutdown splash
|
||||
ExecStop=/bin/sleep 2
|
||||
SyslogIdentifier=RASCSIMON
|
||||
SyslogIdentifier=PISCSIMON
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Executable → Regular
+13
-13
@@ -1,8 +1,8 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
"""
|
||||
RaSCSI Updates:
|
||||
Updates to output rascsi status to an OLED display
|
||||
PiSCSI Updates:
|
||||
Updates to output piscsi status to an OLED display
|
||||
Copyright (C) 2020 Tony Kuker
|
||||
Author: Tony Kuker
|
||||
Developed for:
|
||||
@@ -40,11 +40,11 @@ from board import I2C
|
||||
from adafruit_ssd1306 import SSD1306_I2C
|
||||
from PIL import Image, ImageDraw, ImageFont
|
||||
from interrupt_handler import GracefulInterruptHandler
|
||||
from rascsi.ractl_cmds import RaCtlCmds
|
||||
from rascsi.socket_cmds import SocketCmds
|
||||
from rascsi.sys_cmds import SysCmds
|
||||
from piscsi.piscsi_cmds import PiscsiCmds
|
||||
from piscsi.socket_cmds import SocketCmds
|
||||
from piscsi.sys_cmds import SysCmds
|
||||
|
||||
parser = argparse.ArgumentParser(description="RaSCSI OLED Monitor script")
|
||||
parser = argparse.ArgumentParser(description="PiSCSI OLED Monitor script")
|
||||
parser.add_argument(
|
||||
"--rotation",
|
||||
type=int,
|
||||
@@ -107,7 +107,7 @@ elif args.height == 32:
|
||||
TOKEN = args.password
|
||||
|
||||
sock_cmd = SocketCmds(host=args.host, port=args.port)
|
||||
ractl_cmd = RaCtlCmds(sock_cmd=sock_cmd, token=TOKEN)
|
||||
piscsi_cmd = PiscsiCmds(sock_cmd=sock_cmd, token=TOKEN)
|
||||
sys_cmd = SysCmds()
|
||||
|
||||
WIDTH = 128
|
||||
@@ -158,8 +158,8 @@ LINE_SPACING = 8
|
||||
# Some other nice fonts to try: http://www.dafont.com/bitmap.php
|
||||
FONT = ImageFont.truetype("resources/type_writer.ttf", FONT_SIZE)
|
||||
|
||||
REMOVABLE_DEVICE_TYPES = ractl_cmd.get_removable_device_types()
|
||||
PERIPHERAL_DEVICE_TYPES = ractl_cmd.get_peripheral_device_types()
|
||||
REMOVABLE_DEVICE_TYPES = piscsi_cmd.get_removable_device_types()
|
||||
PERIPHERAL_DEVICE_TYPES = piscsi_cmd.get_peripheral_device_types()
|
||||
|
||||
# After how many screen updates the network data should be refreshed
|
||||
NETWORK_REFRESH_TICKS = 10
|
||||
@@ -182,10 +182,10 @@ def formatted_output():
|
||||
Formats the strings to be displayed on the Screen
|
||||
Returns a (list) of (str) output
|
||||
"""
|
||||
device_list = ractl_cmd.list_devices()["device_list"]
|
||||
device_list = piscsi_cmd.list_devices()["device_list"]
|
||||
output = []
|
||||
|
||||
if not TOKEN and not ractl_cmd.is_token_auth()["status"]:
|
||||
if not TOKEN and not piscsi_cmd.is_token_auth()["status"]:
|
||||
output += ["Permission denied!"]
|
||||
elif device_list:
|
||||
has_luns = False
|
||||
@@ -204,8 +204,8 @@ def formatted_output():
|
||||
line += [unidecode(device["file"])]
|
||||
elif device["device_type"] in REMOVABLE_DEVICE_TYPES:
|
||||
line += ["[No Media]"]
|
||||
# Print only the Vendor/Product info if it's not generic RaSCSI
|
||||
if device["vendor"] not in "RaSCSI":
|
||||
# Print only the Vendor/Product info if it's not generic PiSCSI
|
||||
if device["vendor"] not in "PiSCSI":
|
||||
line += [device["vendor"], device["product"]]
|
||||
output += [" ".join(line)]
|
||||
else:
|
||||
@@ -47,10 +47,10 @@ if [ $ERROR = 1 ] ; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if pgrep -f "python3 src/rascsi_oled_monitor.py" &> /dev/null; then
|
||||
echo "Detected active rascsi_oled_monitor.py process"
|
||||
if pgrep -f "python3 src/piscsi_oled_monitor.py" &> /dev/null; then
|
||||
echo "Detected active piscsi_oled_monitor.py process"
|
||||
echo "Terminating before launching a new one."
|
||||
sudo pkill -f "python3 src/rascsi_oled_monitor.py"
|
||||
sudo pkill -f "python3 src/piscsi_oled_monitor.py"
|
||||
fi
|
||||
|
||||
if ! i2cdetect -y 1 &> /dev/null ; then
|
||||
@@ -155,4 +155,4 @@ fi
|
||||
|
||||
PYTHON_COMMON_PATH=$(dirname $PWD)/common/src
|
||||
export PYTHONPATH=$PWD/src:${PYTHON_COMMON_PATH}
|
||||
python3 src/rascsi_oled_monitor.py ${ROTATION} ${HEIGHT} ${INTERVAL} ${PASSWORD}
|
||||
python3 src/piscsi_oled_monitor.py ${ROTATION} ${HEIGHT} ${INTERVAL} ${PASSWORD}
|
||||
|
||||
Reference in New Issue
Block a user