Difference between revisions of "Control application"

From aquarium-doc
Jump to navigationJump to search
Line 54: Line 54:
Create the file <code>/var/www/app.ini</code> with the following content (set the correct password):
Create the file <code>/var/www/app.ini</code> with the following content (set the correct password):
<code>
<code>
[database]
[database]
server = localhost
server = localhost
port = 3306
port = 3306
user = aquarium
user = aquarium
password = YourPassword
password = YourPassword
database = aquarium
database = aquarium
</code>
</code>
[[Download and install the node JavaScript libraries.]]


=== Setup of database ===
=== Setup of database ===
* Import an empty database.
* Import an empty database.
* Create the user <code>aquarium</code> and assign access rights to the <code>aquarium</code> database.
* Create the user <code>aquarium</code> and assign access rights to the <code>aquarium</code> database.

Revision as of 09:40, 28 March 2023

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

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

  • HW-Tests
  • Text-To-Speech interface
  • Logging
  • Command interface to receive instructions from outside of the application
  • Storage of recorded data in SQL database
  • File-based communication to web application
  • Monitoring and repair of relay board state

The control application makes extensive use of the pigpio library.

The architecture of the application uses various threads.

The application is automatic start by using systemd.

Installation

Enable I2C on Raspberry Pi

See detailed instructions how to use rasp-config.

Create a file for the message queue

The file is automatically created when running make install.

Alternatively, run the command sudo touch /var/local/aquarium-ctrl.mq.

The file is defined in the source file UsrIntrfc/MsgQu.h.

Create a ramdisk

Create the folder /mnt/ramdisk.

Add the following line to /etc/fstab: tmpfs /mnt/ramdisk tmpfs nodev,nosuid,size=50M 0 0.

Add a symbolic link using the command ln -s /mnt/ramdisk /var/local/aquarium-ctrl.

Automatic start of control application

Follow instructions for configuring automatic start of control application.

Create the website

In the folder /var/www/html, create the website using git clone https://in-dubio@bitbucket.org/in-dubio/aquarium-web.git.

Change the owner of the website to user pi and change the group of the website to www-data.

Create a symbolic link to the log file running ln -s /var/log/aquarium-ctrl-session.log /var/www/html/aquarium-web/logfile.txt.

Create the file /var/www/app.ini with the following content (set the correct password):

[database]

server = localhost

port = 3306

user = aquarium

password = YourPassword

database = aquarium

Download and install the node JavaScript libraries.

Setup of database

  • Import an empty database.
  • Create the user aquarium and assign access rights to the aquarium database.