-
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 1 commit
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,81 @@ | ||
| # BirmingHack Check-in & Attendee Monitoring | ||
|
|
||
| This repository contains a local Python application used for managing attendee check-in, tracking building capacity, and automating badge printing for BirmingHack. | ||
|
|
||
| The system uses a webcam to scan QR codes and interfaces with the Tito API to update attendee records. To ensure the scanning process remains fast and resilient against venue Wi-Fi dropouts, the application downloads the necessary attendee data on startup and manages print state locally, rather than relying on webhooks. | ||
|
|
||
| ## System Architecture and Logic | ||
|
|
||
| The application tracks two distinct attendee states: | ||
|
|
||
| 1. **Registration (Permanent State):** The first time an attendee is scanned, the system registers them and sends a print job to the connected thermal printer to produce their name badge and pizza token. This state is tracked so that subsequent scans do not reprint the badge. | ||
| 2. **Entry/Exit Tracking (Volatile State):** After initial registration, scanning an attendee will toggle their status between "Checked In" and "Checked Out". This is used to maintain an accurate count of attendees currently inside the building. | ||
|
|
||
| ### Dual-Scanning Capability | ||
| The scanner accepts two types of QR codes: | ||
| * **Tito Ticket QR Codes:** The standard ticket QR code emailed to attendees. | ||
| * **Student ID Cards:** The application maps the attendees' Student ID numbers (collected via Tito custom questions) during startup. This allows attendees to simply scan their university ID card instead of locating their ticket email. | ||
|
|
||
| ## Hardware Requirements | ||
|
|
||
| * A standard USB or integrated webcam. | ||
| * A Brother Thermal Printer (or an ESC/POS compatible receipt printer) connected via USB. | ||
|
MattyTheHacker marked this conversation as resolved.
Outdated
|
||
|
|
||
| ## Setup and Installation | ||
|
|
||
| ### 1. Install Dependencies | ||
| It is recommended to use a Python virtual environment. Install the required packages using: | ||
|
|
||
| pip install -r requirements.txt | ||
|
|
||
|
MattyTheHacker marked this conversation as resolved.
|
||
| *Linux User Note:* The `pyusb` and `python-escpos` libraries require direct access to the USB ports. You will likely need to run the application with `sudo` or add your user account to the `plugdev` and `lp` groups to grant the necessary permissions. | ||
|
|
||
| ### 2. Printer Configuration | ||
| Create a `config.yaml` file in the root directory. This file must contain your specific printer's USB Vendor ID (`maj`) and Product ID (`min`) in hexadecimal format. You can locate these IDs by running `lsusb` in your terminal. | ||
|
|
||
| # config.yaml | ||
| printer: | ||
| maj: "0x04b8" # Replace with your printer's Vendor ID | ||
| min: "0x0202" # Replace with your printer's Product ID | ||
|
|
||
| ### 3. Tito API Configuration | ||
| Create a `.env` file in the root directory. The application requires credentials for both the Tito Check-in API (for rapid state toggling) and the Tito Core API (for securely downloading custom answers like dietary requirements and Student IDs). | ||
|
|
||
| You must create two separate Check-in Lists on the Tito dashboard: one dedicated to initial registration, and one dedicated to entry/exit tracking. | ||
|
|
||
| # 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 Requirements | ||
| For the application to correctly map data for the printed badges and ID scanning, your Tito event must include custom 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.
|
||
|
|
||
| ## Usage | ||
|
|
||
|
MattyTheHacker marked this conversation as resolved.
|
||
| To launch the scanner, run the main script: | ||
|
|
||
| python main.py | ||
|
|
||
| Upon startup, the script will pause for a few seconds to query the Tito API and build the local dictionaries. Once the camera feed window opens, the system is ready. Hold a valid QR code up to the camera to trigger the process. | ||
|
|
||
| ### Testing the Printer Output | ||
| To verify the printer connection and scaling before the event begins, you can enable a test print. Open `main.py`, locate the printer initialization block, and uncomment the `printer.test_print()` function call. This will print the `assets/tex.png` file as soon as the script starts. | ||
|
|
||
| ## Asset Management | ||
|
|
||
| Image assets (logos, icons, and test prints) are stored in the `assets/` directory. | ||
|
|
||
| Because thermal printers have strict resolution limits, any new images added to this folder must be resized to a maximum width of **576 pixels**. If an image exceeds this width, the printer script will likely fail. | ||
|
|
||
| You can resize and convert images to a thermal-friendly monochrome format using ImageMagick via the terminal: | ||
|
|
||
| magick original_image.png -resize 576x -monochrome assets/new_image.png | ||
Oops, something went wrong.
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.