···7788## Setup
991010-Put raspberry pi os lite 64-bit onto an SD card using the Raspberry Pi Imager and in the configureation step make sure to 1) add your SSH key and 2) set the user:password to `inky:inkycamera`. Oh and also make sure to add your wifi creds so we can update and install packages.
1010+Put raspberry pi os lite 64-bit onto an SD card using the Raspberry Pi Imager and in the configureation step make sure to 1) add your SSH key and 2) set the user:password to `ink:inkycamera`. Oh and also make sure to add your wifi creds so we can update and install packages.
11111212Next you need to configure network over usb so we can ssh in easily and be able to access the photo webserver.
1313···27272828now ssh in:
2929```bash
3030-ssh ink@inkpress.local
3030+ssh ink@inky.local
3131# Default password: inkycamera
3232```
33333434-The firmware instructions are in [`src/README.md`](src/README.md)
3434+The firmware instructions are in [`src/README.md`](src/README.md) or you can run the following to auto configure
3535+3636+```bash
3737+bash -c "$(curl -fsSL hack.club/crgqvn)"
3838+```
35393640## Build Notes
3741
+66
configure-gadget.sh
···11+#!/bin/bash
22+# setup_gadget_mode.sh - Script to configure USB gadget mode on a Raspberry Pi SD card
33+44+# Check if running as root
55+if [ "$EUID" -ne 0 ]; then
66+ echo "Please run as root"
77+ exit 1
88+fi
99+1010+# Check if SD card boot partition is provided
1111+if [ $# -lt 1 ]; then
1212+ echo "Usage: $0 /path/to/sd_card_boot_partition"
1313+ exit 1
1414+fi
1515+1616+BOOT_PARTITION=$1
1717+1818+# Verify the boot partition exists
1919+if [ ! -d "$BOOT_PARTITION" ]; then
2020+ echo "Error: Boot partition not found at $BOOT_PARTITION"
2121+ exit 1
2222+fi
2323+2424+echo "Configuring USB gadget mode on $BOOT_PARTITION..."
2525+2626+# Modify config.txt to enable dwc2 overlay
2727+CONFIG_FILE="$BOOT_PARTITION/config.txt"
2828+if [ -f "$CONFIG_FILE" ]; then
2929+ if ! grep -q "dtoverlay=dwc2" "$CONFIG_FILE"; then
3030+ echo "Adding dtoverlay=dwc2 to config.txt..."
3131+ echo "dtoverlay=dwc2" >> "$CONFIG_FILE"
3232+ else
3333+ echo "dtoverlay=dwc2 already exists in config.txt"
3434+ fi
3535+else
3636+ echo "Error: config.txt not found in boot partition"
3737+ exit 1
3838+fi
3939+4040+# Modify cmdline.txt to load required modules
4141+CMDLINE_FILE="$BOOT_PARTITION/cmdline.txt"
4242+if [ -f "$CMDLINE_FILE" ]; then
4343+ if ! grep -q "modules-load=dwc2,g_ether" "$CMDLINE_FILE"; then
4444+ echo "Adding modules-load=dwc2,g_ether to cmdline.txt..."
4545+ sed -i 's/$/ modules-load=dwc2,g_ether/' "$CMDLINE_FILE"
4646+ else
4747+ echo "modules-load=dwc2,g_ether already exists in cmdline.txt"
4848+ fi
4949+else
5050+ echo "Error: cmdline.txt not found in boot partition"
5151+ exit 1
5252+fi
5353+5454+# Create empty ssh file to enable SSH
5555+SSH_FILE="$BOOT_PARTITION/ssh"
5656+if [ ! -f "$SSH_FILE" ]; then
5757+ echo "Creating empty ssh file to enable SSH..."
5858+ touch "$SSH_FILE"
5959+else
6060+ echo "SSH already enabled"
6161+fi
6262+6363+echo "USB gadget mode configuration complete!"
6464+echo "Now you can insert the SD card into your Raspberry Pi and boot it."
6565+echo "After booting, you should be able to connect via: ssh ink@inky.local"
6666+echo "Default password: inkycamera"
+65
setup.sh
···11+#!/bin/bash
22+# inky_setup.sh - auto setup the inky server
33+44+# Check if running as root
55+if [ "$EUID" -ne 0 ]; then
66+ echo "Please run as root or with sudo"
77+ exit 1
88+fi
99+1010+echo "Setting up Inky camera server from GitHub repository..."
1111+1212+# Update system packages and install dependencies
1313+echo "Updating package lists and installing dependencies..."
1414+apt update
1515+apt install -y python3-picamera2 python3-websockets python3-rpi.gpio git
1616+1717+# Create directory for storing photos
1818+echo "Creating photos directory..."
1919+mkdir -p /home/ink/photos
2020+chown ink:ink /home/ink/photos
2121+2222+# Clone the repository
2323+echo "Cloning repository from GitHub..."
2424+cd /home/ink
2525+if [ -d "/home/ink/inky" ]; then
2626+ cd /home/ink/inky
2727+ git pull
2828+else
2929+ git clone https://github.com/taciturnaxolotl/inky.git
3030+fi
3131+chown -R ink:ink /home/ink/inky
3232+3333+# Copy camera_server.py to user's home directory
3434+echo "Setting up camera server..."
3535+cp /home/ink/inky/src/camera_server.py /home/ink/
3636+chown ink:ink /home/ink/camera_server.py
3737+chmod +x /home/ink/camera_server.py
3838+3939+# Copy and set up systemd service
4040+echo "Setting up systemd service..."
4141+cp /home/ink/inky/src/camera.service /etc/systemd/system/
4242+4343+# Test the camera
4444+echo "Testing camera..."
4545+if command -v rpicam-still &> /dev/null; then
4646+ mkdir -p /tmp/camera_test
4747+ if rpicam-still -o /tmp/camera_test/test.jpg; then
4848+ echo "Camera test successful!"
4949+ else
5050+ echo "Camera test failed. Please check your camera connection."
5151+ fi
5252+else
5353+ echo "rpicam-still not found. Please make sure the camera is properly enabled."
5454+fi
5555+5656+# Enable and start the service
5757+echo "Enabling and starting camera service..."
5858+systemctl daemon-reload
5959+systemctl enable camera.service
6060+systemctl start camera.service
6161+6262+echo "Setup complete!"
6363+echo "Camera server should now be running."
6464+echo "You can access the web interface at: http://inky.local"
6565+echo "Check service status with: sudo systemctl status camera"