# Party Cam: Instant Thermal Camera & Digital Gallery A DIY point-and-shoot camera that prints dithered lo-fi photos on thermal receipts and instantly uploads high-res copies to a local Rust server. ## Hardware BOM - **ESP32-CAM** - **Thermal Printer** (TTL Serial, 5V-9V) - **Batteries** (Recommended: 2x 18650 Li-Ion in series = 7.4V, powering printer directly + buck converter to 5V for ESP32) - **Button** (Tactile switch) - **Programmer**: FTDI Adapter or Arduino Uno (for flashing) ## Wiring ### 1. Camera & Printer | ESP32-CAM Pin | Component | Function | | :---------------- | :--------- | :--------------------------------- | | **5V** | PSU 5V | Power In | | **GND** | PSU GND | Common Ground | | **GPIO 12** | Button | Trigger (Connect other leg to GND) | | **GPIO 14** (U1T) | Printer RX | Data TO Printer | | **GPIO 15** (U1R) | Printer TX | Data FROM Printer | | **GPIO 4** | Flash LED | (Optional) Built-in Flash | ### 2. Flashing (Using Arduino Uno as Bridge) _See "How to Flash" section below._ --- ## Setup Guide ### A. The Server (Rust) The server receives images and hosts the gallery for guests. 1. **Install Rust:** `curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh` 2. **Configure:** Create a `.env` file in the `server` folder: ```ini SERVER_HOST=0.0.0.0 SERVER_PORT=3000 GALLERY_PASSWORD=partytime UPLOAD_DIR=./uploads ``` 3. **Run:** ```bash cd server cargo run --release ``` _Server will listen on port 3000._ ### B. The Camera (Firmware) 1. **Open Project:** Open this folder in VS Code with the PlatformIO extension. 2. **Flash Mode Wiring (Arduino Uno Method):** - **Arduino RESET** -> **Arduino GND** (Bypasses Arduino chip). - **Arduino Pin 0 (RX)** -> **ESP32 U0R** (Direct passthrough). - **Arduino Pin 1 (TX)** -> **ESP32 U0T** (Direct passthrough). - **ESP32 IO0** -> **ESP32 GND** (Enables Download Mode). 3. **Upload:** - Connect via USB. - Click "Upload". - Press the **RST** button on ESP32 when "Connecting..." appears. 4. **Run Mode:** - **Disconnect IO0 from GND.** - Press **RST** to boot. --- ## Configuration (First Boot) 1. **Power on** the camera. 2. Connect your phone to the WiFi network: `PartyCam-Setup`. 3. A captive portal should open (or go to `192.168.4.1`). 4. **WiFi:** Select the venue's WiFi (or your phone hotspot). 5. **Server URL:** Enter your laptop's IP (e.g., `http://192.168.1.15:3000/upload`). 6. **Settings:** Adjust Contrast/Heat if the print is too faint or dark. 7. **Save & Reboot.** The camera is now live!