Improve README
This commit is contained in:
		
							
								
								
									
										28
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										28
									
								
								README.md
									
									
									
									
									
								
							@@ -4,13 +4,11 @@ Door controller for scanning Protospace member cards on the front and back doors
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
## Setup
 | 
					## Setup
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Ensure Pi user has read permissions to /dev/ttyACM0 (Pi user needs to be part of the dialout group).
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Install dependencies:
 | 
					Install dependencies:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```text
 | 
					```text
 | 
				
			||||||
$ sudo apt update
 | 
					$ sudo apt update
 | 
				
			||||||
$ sudo apt install python3 python3-pip python-virtualenv python3-virtualenv supervisor
 | 
					$ sudo apt install python3 python3-pip python3-virtualenv supervisor git
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Clone this repo:
 | 
					Clone this repo:
 | 
				
			||||||
@@ -21,16 +19,27 @@ $ sudo mv airlock/ /opt/
 | 
				
			|||||||
$ cd /opt/airlock
 | 
					$ cd /opt/airlock
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
### Watchdog
 | 
					### Hardware Access
 | 
				
			||||||
 | 
					
 | 
				
			||||||
For the watchdog to work, we need write access to `/dev/watchdog/`.
 | 
					Ensure Pi user has read permissions to `/dev/ttyACA0` and `/dev/watchdog`.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Configure `/etc/udev/rules.d/60-watchdog.rules`:
 | 
					Configure `/etc/udev/rules.d/local.rules`:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```text
 | 
					```text
 | 
				
			||||||
 | 
					ACTION=="add", KERNEL=="dialout", MODE="0666"
 | 
				
			||||||
 | 
					ACTION=="add", KERNEL=="ttyACM0", MODE="0666"
 | 
				
			||||||
 | 
					ACTION=="add", KERNEL=="ttyAMA0", MODE="0666"
 | 
				
			||||||
KERNEL=="watchdog", MODE="0666"
 | 
					KERNEL=="watchdog", MODE="0666"
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Also ensure `/boot/cmdline.txt` doesn't contain `console=serial0,115200`.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Then reboot:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```text
 | 
				
			||||||
 | 
					$ sudo reboot
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
### Main Script
 | 
					### Main Script
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Create a venv, activate it, and install:
 | 
					Create a venv, activate it, and install:
 | 
				
			||||||
@@ -53,6 +62,13 @@ Now you can run the script to test:
 | 
				
			|||||||
(env) $ DEBUG=true python main.py
 | 
					(env) $ DEBUG=true python main.py
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Copy and edit the settings file:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```text
 | 
				
			||||||
 | 
					(env) $ cp secrets.py.example secrets.py
 | 
				
			||||||
 | 
					(env) $ vim secrets.py
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Process management
 | 
					## Process management
 | 
				
			||||||
 | 
					
 | 
				
			||||||
The script is kept alive with [supervisor](https://pypi.org/project/supervisor/).
 | 
					The script is kept alive with [supervisor](https://pypi.org/project/supervisor/).
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user