Made this for my PRUSA MINI with a Raspberry Pi Zero 2W and a Raspi Cam v1.3
Based on the great instructions from Nunos and Joltcans
- Go to the Cameras section at https://connect.prusa3d.com
- Add a new camera "Add new other camera".
- Copy the generated Token
- Set up your Raspberry Pi with simpe Raspian OS and enable the camera with
raspi-config
. - Create a shell script
prusaconnect_upload_cam.sh
and paste the Token into the file below.
- Save
prusaconnect_upload_cam.sh
from below to/usr/local/bin/prusaconnect_upload_cam.sh
and make it executablechmod +x /usr/local/bin/prusaconnect_upload_cam.sh
. - Start the script with
./usr/local/bin/prusaconnect_upload_cam.sh
If It works you should see the images appearing in Prusa Connect every 10 seconds.
To run the script in the background and start it automatically.
- Create
/etc/systemd/system/prusaconnect_upload_cam.service
and paste the content from below. - Start the service:
sudo systemctl start prusaconnect_upload_cam.service
. - Check if the service is running with
sudo systemctl status prusaconnect_upload_cam.service
. - Enable the service:
sudo systemctl enable prusaconnect_upload_cam.service
.
Thank you for the great instructions. If you install the light version of Pi OS you will need to apt get ffmeg, enable legacy camera support in rasp config, apt install motion (see: https://raspberrytips.com/raspberry-pi-camera-as-webcam/) and then your pi camera will support /dev/video0 as described in the script. Depending on the camera you end up using, you may also need to change the resolution in the script for ffmpeg encoding.
You may also need / want to add the ability to rotate the camera image by adding the following to the front end of the (.sh) python script around line 15 ahead of the first "while" statement:
v4l2-ctl -c rotate=180
or
v412-ctl -c horizontal_flip=1