Skip to content

Add standalone Flask web app for gate control (no ROS)#2

Draft
Copilot wants to merge 1 commit intomasterfrom
copilot/add-flask-app-for-buttons
Draft

Add standalone Flask web app for gate control (no ROS)#2
Copilot wants to merge 1 commit intomasterfrom
copilot/add-flask-app-for-buttons

Conversation

Copy link
Copy Markdown

Copilot AI commented May 1, 2026

Exposes gate up/down control via a minimal Flask UI, usable without any ROS infrastructure.

Changes

  • scripts/door_flask_app.py — new self-contained Flask app:
    • Same GPIO logic as the ROS node (UP_GPIO=19, DOWN_GPIO=26, 17 s relay hold)
    • Relay cycle runs in a daemon thread; HTTP response returns immediately
    • _busy flag (guarded by threading.Lock) disables buttons mid-move and returns 409 on concurrent POSTs
    • atexit.register(GPIO.cleanup) for reliable pin release on exit
pip install flask RPi.GPIO
python scripts/door_flask_app.py
# UI at http://<pi-ip>:5000

Agent-Logs-Url: https://github.com/LCAS/fhu_auto/sessions/8928cf47-8d72-4359-9c5a-82c45d07cc4c

Co-authored-by: marc-hanheide <1153084+marc-hanheide@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants