Skip to content

PantryPilot/PantryPilot-Embedded

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PantryPilot Embedded

In-fridge capture hardware for PantryPilot.

Detects door-close via a reed switch, captures a JPEG, and POSTs it to POST /images on the backend. The rest of the system is hardware-agnostic.

Hardware options

Folder Hardware Language Toolchain
esp32_cam/ ESP32-CAM + reed switch C++ PlatformIO
raspberry_pi/ Raspberry Pi + Pi Camera + reed switch Python uv
phone_fallback/ Any spare smartphone manual / app

Use whichever fits your setup. The ESP32-CAM is the primary target (cheapest, battery-friendly). The RPi is the fallback for faster iteration. The phone fallback requires no hardware wiring.

Backend contract

The only interface between this repo and the backend:

POST {BACKEND_BASE_URL}/images
Content-Type: multipart/form-data
Body: file=<JPEG bytes>

Response: { "job_id": "<uuid>" }

Set BACKEND_BASE_URL in your .env (see below).

ESP32-CAM setup

Requirements: PlatformIO CLI or PlatformIO IDE extension for VSCode.

cd esp32_cam
pio run                  # build
pio run --target upload  # flash to board
pio device monitor       # serial output

Wire the reed switch to GPIO 12 (configurable in src/main.cpp). Mount the board inside the fridge door with a small LED strip for even lighting.

Bill of materials: ESP32-CAM ($10), magnetic reed switch ($3), USB battery pack ($15), small LED strip ($8), mounting bracket.

Raspberry Pi setup

Requirements: Python 3.11+, uv, Pi Camera module.

cd raspberry_pi
cp .env.example .env    # set BACKEND_BASE_URL
uv sync
uv run python -m src.capture

The script blocks and listens for GPIO door events. Connect the reed switch to GPIO 17 (configurable in src/door_sensor.py).

Phone fallback

Open the camera app, photograph the fridge shelves, and upload through the PantryPilot web app (/upload). No hardware required.

Environment

cp .env.example .env
Variable Description
BACKEND_BASE_URL e.g. http://192.168.1.x:8000 or the deployed backend URL
CAPTURE_INTERVAL_S Minimum seconds between captures (RPi, default 2)

About

No description, website, or topics provided.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors