How sariitani/scotlia works
Project type and purpose
• This is an IoT-driven full-stack robotics/monitoring system (“Scotlia”) combining Arduino-based devices (drones and a site sensor) with a Python web server running on a Raspberry Pi.
• The Arduinos collect flight or environmental data; the Pi hosts a Flask application that ingests that data, stores it in flat files, and serves it via a simple web front-end (HTML + JavaScript heatmap).
File structure
• Top-level “Ghoush/” directory: three Arduino sketches
• drone/drone.ino and drone2/drone2.ino — quadcopter flight control code
• site/site.ino — stationary environmental sensor code
• “sari/” directory: Python application
• app.py — entry point that launches the Flask server
• python_server/
– static/ — sensor data files (firedat*, smokedat*, treedat*)
– templates/index.html — client UI
– utils.py — data-loading and processing utilities
– views.py — Flask route handlers
• README shows how to scp the Python app to a Pi and start it.
Main components & interactions
a. Arduino devices (Ghoush/drone, drone2, site)
– Collect telemetry or environmental data
– Communicate to Raspberry Pi (via USB serial, Wi-Fi or other link)
b. Raspberry Pi host
– Runs app.py → Flask server
– Serial / network listener that writes incoming sensor data into text files under python_server/static
– Flask “views” load those files using utils.py and render JSON or HTML
c. Web Client (browser)
– Loads index.html
– Issues HTTP GETs to server endpoints (e.g., “/data/firedat0”)
– Renders heatmaps or charts via JavaScript
Architectural patterns & design principles
• Microcontroller → Edge compute → Web UI pipeline
• MVC style within Flask:
• Model: flat-file “database” under static/
• View: index.html + JS
• Controller: views.py routes
• Separation of concerns:
• Device code (C++ in .ino files) is isolated from server logic
• Server logic is isolated from presentation (templates + static assets)