Control application

From Aquarium-Control
Revision as of 20:44, 2 January 2026 by Uwe (talk | contribs)
Jump to navigation Jump to search

The main control application of Aquarium control implements the following features:

The control of the relays for operating the devices can use two different modes:

Additionally, the main control application implements the following supporting features:

  • Version comparison between database and application
  • Configuration using a Rust .toml configuration file
  • Logging
  • Command interface to receive instructions from outside of the application via a POSIX message queue
  • Storage of recorded data in SQL database
  • File-based communication to RAM-disk
  • Usage of simulator to run with simulated sensor data for development purposes
  • Schedule checks to limit the hour of day of operating certain actuators
  • Communication with HW Watchdog

The application is written in Rust and is automatically started using systemd.

The documentation of the software is available here.

Development for the main control application requires the setup of the development environment.

There is a release procedure which is highly recommended to be followed also by anyone developing the SW further.

Architecture

The application spawns the following threads:

Overview of threads
Thread name Purpose
signal_handler Receiving signals from the operating system
schedule_check Polling the database to capture changes of the actuator channel. Informing other threads about it.
sensor_manager Data acquisition
relay_manager Actuation of relays
data_logger Recording of data
tank_level_switch Postprocessing of tank level switch position signal
refill Fresh water refill control
heating Heating control
ventilation Ventilation control
balling Balling mineral dosing control
watchdog Sending alive signal to Raspberry Pi hardware watchdog
monitors Diagnostics (not implemented as of January, 2026)
messaging Receiving communication via message queue
memory Monitoring memory utilization
ds18b20 Recording data from DS18B20 temperature sensor
feed Feed control
i2c_interface Communication via I2C
atlas_scientific Recording data from Atlas Scientific temperature sensor
dht Recording data from DHT sensor
publish_pid Writing PID to lock file