-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
25 lines (16 loc) · 1006 Bytes
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Script for taking a picture from the Raspberry Pi camera when a switch is
active and then uploading it to a server. Handy for a makerspace web cam.
Start by creating an SSH key with:
ssh-keygen -t rsa -b 2048 -f upload_key.rsa
Don't set a passphrase on this key.
Create a user on your server and give it write access to the specific path on
the webserver for the feed picture. Add the key above to this user's
~/.ssh/authorized_keys file. In this file, you can limit what the key is
allowed to do by setting some comma-delimited options before the key:
no-port-forwarding,no-pty ssh-rsa AAAA...
Fill in the relevant configuration constants in the script for SERVER_USERNAME,
SERVER_HOST, and SERVER_UPLOAD_PATH. You'll also want to set FLIP_IMAGE to 1 if
your camera module is mounted upside-down, and 0 otherwise.
Finally, set the script to run on your Pi by adding it to /etc/rc.local:
/path/to/bodgery_open_cam_daemon.pl &
This will let it run every time your Pi reboots.