Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 42 additions & 15 deletions KeyMaster.ini
Original file line number Diff line number Diff line change
@@ -1,41 +1,68 @@
#
# Configuration for Auto Lift 1
# 19 July 2025, Mod 1/21/26
#
[Drivers]
##### Large Machine Setup #####

controller = LargeMachineController
auth = ADApiAuth

rfid = StdInRFID
auth = ADCommonAPIAuth

#rfid = KeyboardRFID
rfid = StdInRFID
log = FileLog

relay = Relay
relay_interface = PiFaceInterface
relay_interface = PiGpioInterface

currentSense = BinaryCurrentSense
currentsense_interface = PiFaceInterface
currentsense_interface = PiGpioInterface

light = RGBLight
light_interface = PiFaceInterface
light_interface = PiGpioInterface

[LargeMachineController]
#light_idle = blue, false, false
#light_error = red, true, 3
#rise_time = # Time (in seconds, (default 0.3) to wait before checking current sensor state
#key = #allows remapping of color assignments. See LargeMachineController code

#
# This is the ***inactivity timer*** any use resets it.
#

#timeout_time = 900
timeout_time = 30

[ADCommonAPIAuth]
url = http://192.168.203.30:8083/badgeGroupMembership
group = Infrastructure Interlock Test

[ADApiAuth]
url = http://192.168.200.32:8080/api/v1/lookupByRfid
#[KeyboardRFID]
#device=/dev/input/by-id/usb-Sycreader_RFID_Technology_Co.__Ltd_SYC_ID_IC_USB_Reader_08FF20140315-event-kbd
#device=/dev/RFID_Reader_0

# Groups denied are checked first, then groups allowed are checked
groups_denied =
groups_allowed = Machine Shop Shark Lathe
# RFID reader was aliased using a UDEV rule to a common name so that swapping readers is less likely to
# require editing the ini file, now ussing StdInRFID instaed of KeyboardRFID

[BinaryCurrentSense]
# Threshold value to begin counting as ON
threshold = 1
interface_position = 1
interface_position = GPIO27, inverting
#interface_position = 1 # used with PiFaceInterface

[Relay]
interface_position = 2
interface_position = GPIO17 , non-inverting
#interface_position = 2 # used with PiFaceInterface

[RGBLight]
interface_position_red = 8
interface_position_green = 7
interface_position_blue = 6
interface_position_red = GPIO22, non-inverting
interface_position_green = GPIO23, non-inverting
interface_position_blue = GPIO24, non-inverting

[FileLog]
filename = KeyMaster.log
# format =
# date_format =
# log_level= debug|info|error
40 changes: 40 additions & 0 deletions KeyMaster.ini.cabinet
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[Drivers]
##### Cabinet Controller Setup #####

controller = CabinetStapleLatchController

auth = ADCommonAPIAuth

rfid = StdInRFID

log = FileLog

controller_io_interface = PiGpioInterface

cabinet_sense = CabinetSwitchSense
cabinet_sense_interface = PiGpioInterface

light = RGBLight
light_interface = PiGpioInterface

[CabinetStapleLatchController]
latch_control_interface = GPIO17, non-inverting

[CabinetSwitchSense]
latch_sense_interface = GPIO18, non-inverting
door_sense_interface = GPIO27, non-inverting
#debounce_tries = 4

[ADCommonAPIAuth]
url = http://192.168.203.30:8083/badgeGroupMembership
group = Infrastructure Cabinet Test

[RGBLight]
interface_position_red = GPIO22, non-inverting
interface_position_green = GPIO23, non-inverting
interface_position_blue = GPIO24, non-inverting

[FileLog]
filename = KeyMaster.log
loglevel = debug

41 changes: 41 additions & 0 deletions KeyMaster.ini.piface
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
[Drivers]
##### Large Machine Setup #####
controller = LargeMachineController
auth = ADApiAuth

rfid = StdInRFID

log = FileLog
relay = Relay
relay_interface = PiFaceInterface
currentSense = BinaryCurrentSense
currentsense_interface = PiFaceInterface
light = RGBLight
light_interface = PiFaceInterface

[LargeMachineController]
#light_idle = blue, false, false
#light_error = red, true, 3

[ADApiAuth]
url = http://192.168.200.32:8080/api/v1/lookupByRfid

# Groups denied are checked first, then groups allowed are checked
groups_denied =
groups_allowed = Machine Shop Shark Lathe

[BinaryCurrentSense]
# Threshold value to begin counting as ON
threshold = 1
interface_position = 1

[Relay]
interface_position = 2

[RGBLight]
interface_position_red = 8
interface_position_green = 7
interface_position_blue = 6

[FileLog]
filename = KeyMaster.log
36 changes: 24 additions & 12 deletions KeyMaster.template.ini
Original file line number Diff line number Diff line change
@@ -1,29 +1,40 @@
#
# Keymaster .ini teplate file with all options shown
# Keymaster .ini template file with all options shown
# OZINDFW 29 Jan 2026
# add current check bypass option 23 March 2026
#
# add Cabinet Sense Siwtch debounce retries 8 July 2026

[Drivers]
##### Large Machine Setup #####
controller = LargeMachineController
#controller = CabinetStapleLatchController

auth = ADCommonAPIAuth

#rfid = KeyboardRFID
rfid = StdInRFID

log = FileLog

controller_io_interface = PiGpioInterface

relay = Relay
relay_interface = PiGpioInterface
# relay_interface = PiFaceInterface

currentSense = BinaryCurrentSense
currentsense_interface = PiGpioInterface
# currentsense_interface = PiFaceInterface

#[CabinetSwitchSense]
#latch_sense_interface = GPIO18, non-inverting
#door_sense_interface = GPIO27, non-inverting
#debounce_tries = 4

light = RGBLight
light_interface = PiGpioInterface
# light_interface = PiFaceInterface

# auth = ADAPIAuth (ADCacheAuth is deprecated)
# log = FileLog

#buzzer = BuzzerIndicator
#buzzer_interface = PiGpioInterface

Expand All @@ -44,17 +55,13 @@ light_interface = PiGpioInterface
#but are OK to power up (eg Juki Sewing Machines)
#bypass_startup_current_check = True

#[CabinetStapleLatchController]
#latch_control_interface = GPIO17, non-inverting

[ADCommonAPIAuth]
url = http://192.168.203.30:8083/badgeGroupMembership
group = Machine Shop Shark Lathe

#[ADApiAuth]
#url = http://192.168.200.32:8080/api/v1/lookupByRfid

# Groups denied are checked first, then groups allowed are checked
#groups_denied =
#groups_allowed = Members

#[KeyboardRFID]
#
# The RFID reader is aliased using a UDEV rule to a common name so that swapping broken
Expand All @@ -72,6 +79,11 @@ interface_position = GPIO27, inverting
# PiFace interface positions are integers 0 thorugh 7
#interface_position = 1

[CabinetSwitchSense]
#latch_sense_interface = GPIO18, non-inverting
#door_sense_interface = GPIO27, non-inverting
#debounce_tries = 4

[Relay]
# specifies the power control relay
# GPIO interface positions are specified by GPIO numbers and logic sense
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ KeyMaster RFID Interlock for Raspberry Pi

Aux_files contains support files for KeyMaster Implementation on a raspberry Pi.

KeyMaster_Start.sh needs to be marked as executable. It's called by the modified Bashrc script on login.
KeyMaster_Start.sh needs to be marked as executable. It's called by the modified Bashrc script in aux_files\BashMod on login.

`
chmod +x KeyMaster_Start.sh
Expand Down
20 changes: 0 additions & 20 deletions ToDo.txt

This file was deleted.

4 changes: 2 additions & 2 deletions aux_files/BashMod/readme.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
These two files are used to start, detect failure and restart the KeyMaster script.
There are two files are used to start, detect failure and restart the KeyMaster script.

Keymaster is not started if already running (So SSH sessions don't spawn a second process)

Append the content of *bashrc-addendum.bash* to the *.bashrc* file in the KeyMaster home directory

copy *KeyMaster_Start.sh* to the KeyMaster home directory and make it exectuable by running
make *KeyMaster_Start.sh* in the KeyMaster home directory exectuable by running

chmod +x KeyMaster_Start.sh
65 changes: 0 additions & 65 deletions aux_files/Networking/dhcpcd.conf

This file was deleted.

4 changes: 0 additions & 4 deletions aux_files/Networking/readme.md

This file was deleted.

2 changes: 2 additions & 0 deletions aux_files/UDEV/readme.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
This is no longer used in new installations that use the StdInRFID driver

Copy 10-local.rules to /etc/udev/rules.d directory. The file should be named "10-local.rules"

This generates a symlink 'RFID_Reader_x' so that the varying RFID reader strings don't prevent swapping readers without modifying the ini file.
22 changes: 22 additions & 0 deletions drivers/CabinetSense/CabinetSense.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from drivers.Loadable import Loadable
from utils.Observer import Observable

class CabinetSense(Loadable):
def __init__(self, config, loader):
super().__init__(config, loader)
self.CabinetChangeNotifier = self.CabinetChangeNotifier()
self.value = "none"

def getValue(self):
return self.value

def observeCabinetChange(self, observer):
self.CabinetChangeNotifier.addObserver(observer)

def notifyCabinetChangeObservers(self, value):
self.CabinetChangeNotifier.notifyObservers(value)

class CabinetChangeNotifier(Observable):
def notifyObservers(self, value):
self.setChanged()
Observable.notifyObservers(self, value)
Loading