Install the apt-get dependencies before running the system. (This installation needs sudo permissions)
Get into the PreyTouch directory
chmod +x Arena/scripts/arena_init.sh
./Arena/scripts/arena_init.shPreyTouch has several dependencies that must be installed.
- Redis
- Bugs Application (Node.js)
- Periphery service (communication with the Arduino)
- PostgreSQL Database
- Mosquitto MQTT
A manual for installing docker + docker-compose on ubuntu 22.04: https://linuxhint.com/install-docker-compose-ubuntu-22-04
cd docker/
docker-compose up -d
cd ..pip install -r requirements/arena.txtCheck if you have a nvidia-driver installed on your system, by running:
nvidia-smiIf the above command is able to run, your'e all set and can skip this step, otherwise:
sudo apt install nvidia-driver-525PreyTouch only tested with this driver, but other nvidia-drivers should work as well. Notice you'll have to reboot after the driver installation.
Now the preyTouch API should be able to run, check it by running:
cd Arena
python api.pyYou can open a browser and go to: http://localhost:5084 and check the software.
If the check passed successfully, you may want to make PreyTouch start automatically after reboot. For that you can install supervisorctl, using:
sudo apt install supervisorCreate the following configuration file
sudo nano /etc/supervisor/conf.d/prey_touch.confand put the following inside it:
[program:prey_touch]
command=<path_to_python_interpreter> api.py
user=<user>
environment=PYTHONUNBUFFERED=1;HOME=/home/<user>
directory=<path_to_PreyTouch_dir>/Arena
stdout_logfile=/var/log/prey_touch.out.log
redirect_stderr=true
killasgroup=true
stopasgroup=true
autorestart=trueNotice!
- To get the path for the python interpreter you can run "which python" while your python environment is activated.
- Under "directory" you should put before "/Arena" the path to the PreyTocuh dir
- You also need to specify the user which runs PreyTouch
Now you can load this new configuration to supervisor
sudo supervisorctl reread
sudo supervisorctl updateand you can always check the logs using:
tail -f /var/log/prey_touch.out.login case you need to restart PreyTouch:
sudo supervisorctl restart prey_touch