| Package import | "zappem.net/pub/net/rpisnap" |
|---|---|
| Documentation | https://pkg.go.dev/zappem.net/pub/net/rpisnap |
| Sources | https://github.com/tinkerator/rpisnap |
This is a client package and small go tool to host a webcam view of the RPi attached camera. Go is used to host the webserver, Python3 is used to interact directly with the camera.
$ sudo apt update
$ sudo apt upgrade
$ sudo apt install python3-picamera2
$ sudo shutdown -r now
$ git clone https://github.com/tinkerator/rpisnap.git
$ cd rpisnap
$ GOARCH=arm64 go build serve/rpisnapper.go
Copy the two programs rpisnapper and py/rpisnap.py to your
RPi. The first time you run the program use the --debug argument:
$ sudo setcap cap_net_bind_service=ep ./rpisnapper
$ ./rpisnapper --debug
Then, point your browser at your pi’s http://piaddress/ to see the camera taking pictures. The accompanying client package can obtain and provide support for manipulating images from the camera in realtime.
As soon as you close your ssh session, this will cause the camera to stop working. To overcome this. Copy another file to your RPi:
$ scp rpisnapper.service pi@yourrpi:
$ ssh pi@yourrpi
$ sudo loginctl enable-linger pi
$ sudo ln -sf /home/pi/rpisnapper.service /etc/systemd/system/
$ sudo -s
# systemctl status rpisnapper.service
# systemctl unmask rpisnapper.service
# systemctl enable rpisnapper.service
# systemctl start rpisnapper.service
# exit
$ systemctl status rpisnapper.service
loginctl enable-linger pi
This will cause the service to start immediately and every time the
RPi boots, and also restart after a few seconds if the service crashes
for some reason.sudo rm /var/run/user/1000/image.jpg and wait a few seconds.ls -l /var/run/user/1000/image.jpg) by pi piThe rpisnap package is distributed with the same BSD 3-clause
license as that used by golang itself.
Use the github rpisnap bug
tracker.