Debian package
The Debian package shall check all dependencies and install the application on the Raspberry Pi.
Dependencies
Before starting the installation, the following dependencies are verified
- Apache 2 with php
- MariaDB
- bcrypt (for running the database setup script)
Content
The Debian package contains the following data:
| File name | Description | Origin | Target directory |
|---|---|---|---|
aquarium_control |
executable of main control | target/release of main control repo |
/usr/local/bin
|
aquarium_control.toml |
configuration of main control | config of main control repo |
/etc/aquarium_control
|
aquarium.sql |
database dump containing empty database | database repo | - |
aquariumcontrol_database_cleanup_setup.sh |
script for setting up database maintenance | database repo | /usr/local/bin
|
aquariumcontrol_database_setup.sh |
script for initializing database | database repo | /usr/local/bin
|
aquarium_client |
executable of terminal application | target/release of client repo |
/usr/local/bin
|
api.php |
main file of REST API | REST API repo | /var/www/html
|
db.php |
supporting file of REST API | REST API repo | /var/www/html
|
functions.php |
supporting file of REST API | REST API repo | /var/www/html
|
balling-manager.html |
dynamic webpage | webpage repo | /var/www/html
|
feed-manager.html |
dynamic webpage | webpage repo | /var/www/html
|
heating-manager.html |
dynamic webpage | webpage repo | /var/www/html
|
index.html |
dynamic webpage | webpage repo | /var/www/html
|
logs.html |
dynamic webpage | webpage repo | /var/www/html
|
refill-manager.html |
dynamic webpage | webpage repo | /var/www/html
|
schedule-manager.html |
dynamic webpage | webpage repo | /var/www/html
|
ventilation-manager.html |
dynamic webpage | webpage repo | /var/www/html
|
14550230.png |
image for dynamic webpage | webpage repo | /var/www/html/images
|
1843544.png |
image for dynamic webpage | webpage repo | /var/www/html/images
|
3173192.png |
image for dynamic webpage | webpage repo | /var/www/html/images
|
4236594.png |
image for dynamic webpage | webpage repo | /var/www/html/images
|
478544.png |
image for dynamic webpage | webpage repo | /var/www/html/images
|
5109802.png |
image for dynamic webpage | webpage repo | /var/www/html/images
|
748967.png |
image for dynamic webpage | webpage repo | /var/www/html/images
|
8593001.png |
image for dynamic webpage | webpage repo | /var/www/html/images
|
9602773.png |
image for dynamic webpage | webpage repo | /var/www/html/images
|
9803219.png |
image for dynamic webpage | webpage repo | /var/www/html/images
|
Except for the database dump, the files are copied to their target directories.
The database dump file is extracted to a temporary location and deleted after use.
Creation of directories and files
The Debian package creates
- a directory and a set of files for the file-based communication as defined in the section
[data_logger]of the configuration file. - an empty log file as defined in the section
[logger]of the configuration file.
Database creation
During the installation of the package the user is asked if the database for the aquarium control already exists. If the user informs that the database does not exist, the user shall provide the following information:
- desired database name
- default user name
- password
The script:
- creates the database using the desired database name
- imports the SQL dump to the database
- creates the SQL user with the corresponding user name and password
- grants all privileges on the database to the user
- updates the main control configuration file with the database name, user name and password
- updates the db.php with the database name, user name and password
Database update
The database contains a table version which includes the release number and a corresponding hash of the executable.
MariaDB [aquarium]> desc version; +-------+--------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------+--------------+------+-----+---------+-------+ | major | int(11) | YES | | NULL | | | minor | int(11) | YES | | NULL | | | build | int(11) | YES | | NULL | | | hash | varchar(255) | YES | | NULL | | +-------+--------------+------+-----+---------+-------+ 4 rows in set (0.032 sec)
This table needs to be updated with the hash of the executable.
When executing the main control with the parameter --version, the program will inform the version and the hash:
pi@raspberrypi:/var/www/html $ aquarium_control --version [2026-01-01 15:58:04.558 +01:00 INFO aquarium_control::utilities::version_information] path of this executable is: /usr/local/bin/aquarium_control Version information: Major: 0 Minor: 16 Build: 1 Hash: 7066cbf85e2fa71b47d984b7da09d791a3003675a9a8f16ea16ee63d3487b14e
Setup of webpage
Additionally, to copying the corresponding php, html and png files from the package to the target directory, the script downloads a set of libraries to /var/www/html/js/:
Chart.min.jsfromhttps://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.4/Chart.min.jsmoment.min.jsfromhttps://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.1/moment.min.jsvue.global.prod.jsfromhttps://unpkg.com/vue@3/dist/vue.global.prod.js
Automatic start
The package configures the operating system to automatically start the application after booting up as described here.
Instructions to the user
After executing above activities, the package installation informs the user that the corresponding database content needs to be created in case the database has been created during the installation of the package.
The installation refers to the aquariumcontrol_database_setup.sh.