2023-05-10 05:35:46 +00:00
|
|
|
# Campcam
|
|
|
|
|
|
|
|
This lets my deranged friend monitor his drunken campground shenanigans from a Telegram bot.
|
|
|
|
|
2024-05-18 03:21:06 +00:00
|
|
|
## Usage
|
|
|
|
|
|
|
|
Add @robbcampbot to your Telegram group.
|
|
|
|
|
|
|
|
Send the `/campcam` command.
|
|
|
|
|
2023-05-10 05:35:46 +00:00
|
|
|
## Installation
|
|
|
|
|
|
|
|
```
|
2024-05-18 03:21:06 +00:00
|
|
|
$ sudo raspi-config # enable the camera
|
|
|
|
$ sudo apt install python3 python3-pip python3-virtualenv
|
2023-05-10 05:35:46 +00:00
|
|
|
$ git clone https://git.tannercollin.com/tanner/campcam.git
|
2024-05-18 03:21:06 +00:00
|
|
|
$ cd campcam/
|
|
|
|
$ virtualenv -p python3 env
|
|
|
|
$ . env/bin/activate
|
|
|
|
(env) $ pip install -r requirements.txt
|
|
|
|
# edit secrets.py.example, save as secrets.py
|
|
|
|
(env) $ python campcam.py
|
|
|
|
```
|
|
|
|
|
|
|
|
## Process Control
|
|
|
|
|
|
|
|
```
|
|
|
|
$ sudo apt install supervisor
|
|
|
|
```
|
|
|
|
|
|
|
|
Append to `/etc/supervisor/supervisor.conf`, replace `tanner` with your Linux username:
|
|
|
|
|
|
|
|
```
|
|
|
|
[program:campcam]
|
|
|
|
user=tanner
|
|
|
|
directory=/home/tanner/campcam
|
|
|
|
command=/home/tanner/campcam/env/bin/python -u campcam.py
|
|
|
|
stopsignal=INT
|
|
|
|
stopasgroup=true
|
|
|
|
killasgroup=true
|
|
|
|
autostart=true
|
|
|
|
autorestart=true
|
|
|
|
stderr_logfile=/var/log/campcam.log
|
|
|
|
stderr_logfile_maxbytes=10MB
|
|
|
|
stdout_logfile=/var/log/campcam.log
|
|
|
|
stdout_logfile_maxbytes=10MB
|
|
|
|
```
|
|
|
|
|
|
|
|
```
|
|
|
|
$ sudo supervisorctl reread; sudo supervisorctl update
|
2023-05-10 05:35:46 +00:00
|
|
|
```
|