|
hace 1 día | |
---|---|---|
.. | ||
esp32_firmware | hace 1 día | |
README.md | hace 1 día | |
README_v2.md | hace 1 día | |
camera_aim_calibration.md | hace 1 día | |
octv2_server.py | hace 1 día | |
octv2_server_v2.py | hace 1 día | |
requirements.txt | hace 1 día | |
requirements_v2.txt | hace 1 día | |
setup_mouth_detection.md | hace 1 día | |
wide_mouth_detection_guide.md | hace 1 día |
Python server to control your Oreo Cookie Thrower hardware from the iOS app.
# Copy files to your Pi
scp -r raspberry_pi_server/ pi@your-pi-ip:~/octv2/
# SSH into your Pi
ssh pi@your-pi-ip
cd ~/octv2
# Update system
sudo apt update
# Install Python camera library
sudo apt install python3-picamera2
# Install GPIO library (usually pre-installed)
sudo apt install python3-rpi.gpio
# Or install from requirements
pip3 install -r requirements.txt
Edit octv2_server.py
to match your hardware:
# GPIO pins (adjust for your hardware)
self.SERVO_PIN = 18 # Servo for aiming
self.STEPPER_PINS = [19, 20, 21, 22] # Stepper motor pins
self.FIRE_PIN = 23 # Fire mechanism trigger
# Make executable
chmod +x octv2_server.py
# Run the server
python3 octv2_server.py
# Or run in background
nohup python3 octv2_server.py &
Find your Pi's IP address:
hostname -I
In OCTv2 iOS app:
The server handles these commands from the iOS app:
Command | Description |
---|---|
aim_left |
Move aim left by 5° |
aim_right |
Move aim right by 5° |
fire |
Fire Oreo at specified angle |
home |
Home device to reference position |
set_mode |
Set auto/manual mode |
capture_photo |
Take high-res photo |
start_video_stream |
Begin video streaming |
stop_video_stream |
Stop video streaming |
status |
Get device status |
# Enable camera
sudo raspi-config
# Interface Options → Camera → Enable
# Test camera
libcamera-hello
# Add user to gpio group
sudo usermod -a -G gpio $USER
# Logout and login again
# Check if server is running
ps aux | grep octv2_server
# Check firewall
sudo ufw status
# Test connectivity
telnet your-pi-ip 8080
# Check Python version
python3 --version
# Check dependencies
pip3 list | grep -E "(picamera2|RPi.GPIO)"
# Run with verbose logging
python3 octv2_server.py --debug
Server logs are displayed in the terminal. To save logs:
python3 octv2_server.py 2>&1 | tee octv2.log
The server runs on port 8080 without authentication. For local network use only.
Your OCTv2 is ready to launch cookies with precision control from your iPhone!