Crate aquarium_control

Source
Expand description

Aquarium control is an open-source application that is part of a control system for salt-water aquariums. It contains the following functionality:

  • Data acquisition of sensors (water temperature, pH, conductivity, ambient air temperature, ambient humidity)
  • Fresh water refill
  • Heating control
  • Ventilation control
  • Automatic feeding
  • Balling mineral dosing

ModulesΒ§

beacon πŸ”’
This container module features all functionality related to RGB LED.
database πŸ”’
This is the container module for the database communication. Communicating with the SQL database includes preparing SQL queries, executing the queries and processing of query results.
dispatch πŸ”’
Communication with the user via client application or webserver using POSIX message queues.
food πŸ”’
This container module features all the functionality to execute the automatic feeding.
launch πŸ”’
This container module features all supporting functionality for the main module.
mineral πŸ”’
This container module features all the functionality to execute the Balling mineral dosing.
permission πŸ”’
The container module contains the schedule checker.
recorder πŸ”’
This container module contains all functionality to periodically store signals either in one table of the SQL database or in specific text files stored in the RAM disk
relays πŸ”’
This container module features all functionality to actuate the relays which control the actuators.
sensors πŸ”’
This container module features all functionality to read and postprocess sensor data.
simulator πŸ”’
This container module features all functionality to communicate with the test server via TCP.
thermal πŸ”’
This container module features all functionality to either cool the water using ventilation heat the water using a heater.
utilities πŸ”’
This container module features all functionality that could not be assigned to any other container module.
watchmen πŸ”’
This container module features all functionality to monitor the control system.
water πŸ”’
This container module features all functionality to replace the evaporated water with fresh water.

MacrosΒ§

check_quit_increment_counter_ping_database
A macro to handle common end-of-loop tasks for Balling and Feed.
manage_cycle_time_thermal
A macro to manage the timing of a fixed-duration loop applicable to both thermal control modules.
perform_schedule_check
A macro to perform a request-response check with the schedule_check module.
update_thermal_set_values
A macro to update set values from a data source and handle logging on failure.

StructsΒ§

Arc
A thread-safe reference-counting pointer. β€˜Arc’ stands for β€˜Atomically Reference Counted’.
AtomicBool
A boolean type which can be safely shared between threads.
Mutex
A mutual exclusion primitive useful for protecting shared data

FunctionsΒ§

check_argument_for_valid_config_file_name πŸ”’
Checks if the provided string is a valid path to a .toml configuration file.
check_is_command πŸ”’
Checks if a command-line argument is a recognized command and executes it.
display_usage πŸ”’
Displays the valid command line parameter combinations
is_running_as_root πŸ”’
Checks if the current process is running with root (UID 0) privileges.
main πŸ”’
The main function is a simple error handler. The main entry point for the application is within the run() function.
run πŸ”’
The main entry point of the Aquarium Control application.