-
Notifications
You must be signed in to change notification settings - Fork 0
Add README for BirmingHack Check-in Application #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
MattyTheHacker
wants to merge
5
commits into
main
Choose a base branch
from
readme
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
0b5e714
Add README for BirmingHack Check-in Application
MattyTheHacker 6f632c8
Revise README for clarity and detail enhancements
MattyTheHacker f0ff7db
Update README with git and API credentials information
MattyTheHacker f3b1e89
Clarify badge printing and update printer rate limiting
MattyTheHacker c143229
Update README with attendee scan details and .env setup
MattyTheHacker File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,106 @@ | ||
| # BirmingHack Check-in & Attendee Monitoring | ||
|
|
||
| This repository contains a Python application for managing attendee check-in, tracking venue capacity, and printing badges. | ||
|
|
||
| The application uses a webcam to scan QR codes and Data Matrix codes. It interfaces with the Tito API to fetch attendee data and update check-in lists. | ||
|
|
||
| ## System Architecture and State Management | ||
|
|
||
| The application tracks two attendee states using two separate Tito check-in lists: | ||
|
|
||
| 1. Registration State (Printed): The first time an attendee is scanned, the application prints a name badge. If the attendee provided a pizza preference, a pizza token is also printed. The attendee is then checked into the Registration list on Tito. On startup, the application downloads this list to know who has already received a badge. The application requires internet connectivity to Tito on startup to restore this state. | ||
| 2. Capacity State (Entry/Exit): Every scan, including the initial registration scan, toggles the attendee's status on the Entry/Exit list in Tito. This tracks how many people are currently inside the venue. | ||
|
|
||
| ## Hardware Requirements | ||
|
|
||
| * A webcam (USB or integrated). | ||
| * An ESC/POS-compatible USB receipt printer. The application defaults to the Epson TM-P80 profile. | ||
|
|
||
| ## Setup and Installation | ||
|
|
||
| ### 1. Install Dependencies | ||
|
|
||
| The application requires `git` to install version-controlled dependencies from GitHub. Ensure `git` (and standard build essentials, if required by your operating system) is installed on your machine before proceeding. | ||
|
|
||
| Install the required Python packages using a virtual environment: | ||
|
|
||
| pip install -r requirements.txt | ||
|
|
||
| Linux USB Permissions: The application requires direct access to USB ports to communicate with the printer. Add your user to the `lp` and `plugdev` groups using the following commands, then log out and log back in: | ||
|
|
||
| sudo usermod -aG lp $USER | ||
| sudo usermod -aG plugdev $USER | ||
|
|
||
| ### 2. Printer Configuration | ||
|
|
||
| Create a `config.yaml` file in the root directory. Add your printer's USB Vendor ID (`maj`) and Product ID (`min`) in hexadecimal format. Use the `lsusb` command in the terminal to find these values. | ||
|
|
||
| # config.yaml | ||
| printer: | ||
| maj: "0x04b8" # Epson Vendor ID example | ||
| min: "0x0202" # Product ID example | ||
|
|
||
| ### 3. Tito API Configuration | ||
|
|
||
| Copy the `example.env` file to a new file named `.env` in the root directory and populate it with your event credentials. | ||
|
|
||
| Core API credentials are strictly mandatory. If they are missing, the application cannot verify the Hackathons UK Data Sharing Agreement, and all check-ins will be rejected. | ||
|
|
||
| Important: Do not copy the placeholders literally. You must replace the `202X` and `your-...` values with your actual event year, slugs, and secrets. | ||
|
|
||
| # Check-in API Configuration | ||
| TITO_REGISTRATION_LIST_SLUG="birminghack-202X-registration" | ||
| TITO_CHECKIN_LIST_SLUG="birminghack-202X-building-access" | ||
|
|
||
| # Core API Configuration | ||
| TITO_ACCOUNT_SLUG="your-tito-account-name" | ||
| TITO_EVENT_SLUG="birminghack-202X" | ||
| TITO_SECRET="your-secret-tito-api-token" | ||
|
MattyTheHacker marked this conversation as resolved.
|
||
|
|
||
| ### 4. Tito Dashboard Custom Questions | ||
|
|
||
| The application parses specific custom questions from Tito to print badges, enforce data sharing agreements, and map student IDs. Your Tito event must include questions with these exact titles: | ||
|
|
||
| * `What are your preferred pronouns?` | ||
| * `What is your pizza preference?` | ||
| * `Do you have any dietary restrictions?` | ||
| * `What is your Student ID?` | ||
|
MattyTheHacker marked this conversation as resolved.
|
||
| * `Are you fasting?` | ||
| * `Hackathons UK Data Sharing Agreement` | ||
|
|
||
| Agreement Enforcement: The application will deny entry to any attendee whose response to the Hackathons UK Data Sharing Agreement is not exactly `I agree`. | ||
|
|
||
|
MattyTheHacker marked this conversation as resolved.
|
||
| ## Usage and Operations | ||
|
|
||
| Run the application: | ||
|
|
||
| python main.py | ||
|
|
||
| The application will query Tito, map the responses, and open the camera feed. | ||
|
|
||
| ### Scanning Codes | ||
|
|
||
| Hold a code up to the camera. The application supports two code types: | ||
| * Tito Ticket QR Codes: Found in the attendee's ticket email. | ||
| * Student ID Data Matrix: Use the Data Matrix code located in the top right corner of the student ID card. The barcodes at the bottom of the card are not supported and will not scan. | ||
|
|
||
| ### Keyboard Controls | ||
|
|
||
| While the camera window is active, use the following keys to operate the application: | ||
|
|
||
| * `q`: Quit the application. | ||
| * `p`: Print the pizza summary report. Separates fasting and non-fasting counts. | ||
| * `d`: Print the dietary requirement summary report. | ||
| * `c`: Print the checked-in capacity summary report. | ||
| * `s`: Print a generic security badge. | ||
| * `r`: Enable reprint mode. The next scanned ticket will reprint the badge and food token (if applicable). Note: The scan will still process normally after printing, meaning it will also toggle their entry/exit or registration state. | ||
|
|
||
| Printer Rate Limiting: The printer enforces a strict 3-second minimum interval between print requests. If a scan or command attempts to print before 3 seconds have passed, the new print job is immediately canceled and ignored (it is not queued). | ||
|
|
||
| ## Asset Management | ||
|
|
||
| Place image assets in the `assets/` directory. | ||
|
|
||
| Thermal printers have strict resolution limits. Images must be resized to a maximum width of 576 pixels. You can resize and convert images to a monochrome format using ImageMagick: | ||
|
|
||
| magick original_image.png -resize 576x -monochrome assets/new_image.png | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.