This repo contains a few things:
- autostart for the camera stream (ustreamer)
- logging stuff
There a few key details about the autostart process.
- Make sure the absolute path to ustreamer is correct (spelling, capitalization,etc).
- Check the camera paths (which video device), ports, resolutions, etc are correct.
- Move the respective camera service file into: /etc/systemd/system/
i. You can either use copy / paste with GUI, or you can use the cp command:
ii. Ex.
cp /home/mamorobotics/front_camera.service /etc/systemd/system/ - Run:
sudo systemctl daemon-reload - Run: "sudo systemctl enable [name of service]"
i. Ex.
sudo systemctl enable front_cameraorsudo systemctl enable lower_camera - The, run: "sudo systemctl start [name of service]"
i. Ex.
sudo systemctl start front_cameraorsudo systemctl start lower_camera - You should be good! You need to re-do these steps every time you change the service file.
- Clone the repo.
- Install the requirements by running
pip install psutil. - Make sure when you run:
vcgencmd, it works (and has a valid output). If it says command not found, then runsudo apt install libraspberrypi-bin. - Make sure the paths in the
rov_logger.serviceare correct. For Python, the monitor.py file, and the logging folder path. - Start the service using the process for autostart above.
- Most of it is automatically configured through either default Pi / linux settings, or through the autostart in the front / lower camera service files.
- Check that persistent logging is setup, run:
ls /var/log/journali. If the folder is empty, it means that persistent logging is not setup. - If needed, setup persistent logging:
sudo mkdir -p /var/log/journal
sudo systemd-tmpfiles --create --prefix /var/log/journal
sudo systemctl restart systemd-journald
There are two types of logs: system / ustreamer logs, accessed through journalctl, and the custom logs we setup using the Python code in this repo. The former logs, can be accessed through journalctl, the latter can be access through the files (should be in /home/mamorobotics/rov_logs or something like that). The path can be found in the source code.
A helpful guide on how to parse through and understand these logs is found in LOGS_GUIDE.md