P.E.R.A. (Ponent Exploration & Research in Aerospace) is a LleidaDrone / Liquid Galaxy project for collecting water and atmosphere readings from a water-rocket payload. An Arduino drives an ESP8266, which uploads each reading with an HTTP GET into a PHP/MySQL dashboard used to review the logs.
This repository holds the pitch, the dashboard, and the uploader sketch. It is a student-era prototype: the dashboard UI is an admin template, and the firmware ships in demo mode.
sensors (or demo stubs)
|
v
Arduino sketch (LG_Water_Data_Uploader.ino)
| AT commands over SoftwareSerial
v
ESP8266 ---- HTTP GET ----> upload-waterdata.php
|
v
MySQL `water-records`
|
v
PHP dashboard (login + tables)
- The sketch builds one reading (
buildTelemetryRequest()). WithDEMO_MODEleft at its default (true), values are simulated. Set it tofalseand fill in the sensor stubs for hardware. - The ESP8266 joins Wi-Fi and sends
GET /upload-waterdata.phpwith the parameter names the PHP endpoint expects:sea,lon,lat,stemp,atemp,hum,slp,ph,tds,rkt. dashboard/upload-waterdata.phpvalidates those parameters and inserts a row with a prepared statement.- Signed-in users review rows on
table-waterrecords.php. Login and registration use prepared statements andpassword_hash.
The upload URL is not behind the dashboard login. Treat it as a device endpoint and do not expose it on an open network without additional controls.
| Path | Role |
|---|---|
| Pitch PDF | Project objectives and system description |
| Prototype video | Hardware and dashboard demo |
dashboard/ |
PHP/MySQL UI: login, registration, water-data table |
dashboard/schema.sql |
Inferred MySQL schema (none was committed originally) |
LG_Water_Data_Uploader.ino |
Arduino + ESP8266 uploader |
.env.example |
Dummy database settings. Copy to .env locally |
dashboard/icons/ and dashboard/plugins/ are leftovers from the admin template (icon fonts, chart libraries, editors). They are still referenced by the pages, so they stay in the tree. See CLEANUP.md.
Requirements: PHP 7.4+ (8.x works) with mysqli, MySQL 5.7+ or MariaDB, and a web server whose document root is dashboard/ (or adjust UPLOAD_PATH in the sketch). Arduino IDE with SoftwareSerial (built in) for the firmware.
-
Create a database and load the inferred schema:
mysql -u root -p < dashboard/schema.sqlColumn types and the timestamp column name
recorded_atare inferred. Details and theusers/water-recordscolumns are in CONTRIBUTING.md anddashboard/schema.sql. If a live database already exists, compare names before importing. -
Configure credentials outside git:
cp .env.example .env
Set
DB_SERVER,DB_USERNAME,DB_PASSWORD, andDB_NAME. Process environment variables override.env. If nothing is set, the app falls back tolocalhost/root/ an empty password /lg-dashboardfor a local demo only. -
Point the vhost at
dashboard/and openlogin.php. Register the first account atregister.php(open registration is unchanged from the original app). -
Confirm an insert. From the dashboard host:
curl -sS "http://localhost/upload-waterdata.php?sea=Bay%20of%20Bengal&lon=88E&lat=21N&stemp=293K&atemp=301K&hum=82%25&slp=101325Pa&ph=7.8&tds=740mgl&rkt=LG%20Rocket%202FA"A valid row returns
Success!. Empty or malformed parameters return HTTP 400.
- Open
LG_Water_Data_Uploader.inoin the Arduino IDE. - Edit the block marked network configuration:
HOST,WIFI_SSID,WIFI_PASS, andUPLOAD_PATHif the dashboard is not at the web root. - Leave
DEMO_MODEastrueuntil real sensors are connected. The stubs inreadLongitude(),readLatitude(), and the otherread*()functions are the plug-in points. - Wire ESP8266 RX/TX to pins 2 and 3 (SoftwareSerial) and match
ESP_BAUDto the AT firmware baud rate. - Flash the board. The serial monitor at 9600 baud prints each AT command (
AT,AT+CWMODE=1,AT+CWJAP,AT+CIPMUX=0, thenCIPSTART/CIPSEND/CIPCLOSEper reading).
Database credentials used to be hardcoded in dashboard/config.php and are in the git history of this repository. Rotate that password on any live MySQL host that used it, then set the new password only in the environment or a local .env file. Do not commit the new value.
.env and .DS_Store are gitignored.
The Ponent Exploration & Research in Aerospace initiative, by the LleidaDrone Association, looks past the altitude range of typical drones and involves engineering students in atmospheric and space work.
Setup details, PHP/MySQL notes, and firmware configuration are in CONTRIBUTING.md.