Files
webcam-streamer/README.md
2024-02-20 16:29:14 +01:00

89 lines
2.3 KiB
Markdown

# Prepare the system
Make sure you have the Raspbian 12
`lsb_release -a`
```
No LSB modules are available.
Distributor ID: Raspbian
Description: Raspbian GNU/Linux 12 (bookworm)
Release: 12
Codename: bookworm
```
In your home directory clone the repo
`cd ~`
`git clone https://gitea.virtonline.eu/2HoursProject/webcam-streamer.git`
Go into the project directory
`cd webcam-streamer`
Insert a formatted (vfat) drive into USB.
Install the `mnt-usb` systemd mount file
`sudo cp mnt-usb.mount /etc/systemd/system/`
Reload systemd manager configuration
`sudo systemctl daemon-reload`
Mount the USB drive
`sudo systemctl start mnt-usb.mount`
See the status
`sudo systemctl status mnt-usb.mount`
Enable the `/mnt/usb` to mount at boot time
`sudo systemctl enable mnt-usb.mount`
# Install webcam-streamer
Install the `webcam-service` systemd service file
`sudo cp webcam-streamer.service /etc/systemd/system/`
Install the configuration file
`sudo cp webcam-streamer /etc/default/`
Reload systemd manager configuration
`sudo systemctl daemon-reload`
Start the `webcam-service` service
`sudo systemctl start webcam-service`
See the logs of the service (you might want to wait a bit)
`journalctl -fu webcam-service`
Enable the `webcam-service` service to run at boot time
`sudo systemctl enable webcam-service`
Stop the `webcam-service` service
`sudo systemctl stop webcam-service`
Adjust the configration and restart the service
`sudo nano /etc/default/webcam-streamer`
`sudo systemctl restart webcam-service`
# Install webcam-cleanup
If you want to periodically remove older video files
Install the `webcam-cleanup` systemd service file
`sudo cp webcam-cleanup.service /etc/systemd/system/`
Install the `webcam-cleanup` systemd timer file
`sudo cp webcam-cleanup.timer /etc/systemd/system/`
Reload systemd manager configuration
`sudo systemctl daemon-reload`
Adjust the configration (it is the same file as for the `webcam-service`) and start the timer
`sudo nano /etc/default/webcam-streamer`
`sudo systemctl start webcam-cleanup.timer`
List running timers
`systemctl list-timers`
Enable the `webcam-cleanup` timer to run at boot time
`sudo systemctl enable webcam-cleanup.timer`
See the logs of the `webcam-cleanup` service
`journalctl -fu webcam-cleanup`