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
.
I don't know if there will be problems if you try to access the camera from Octoprint and with this custom script. Maybe there could be some conflicts.
You can check the current directory with
pwd
There are different ways to achive to start a script automatically after booting.
The method here is called "systemd service". You can google it to get better explanations.
cd /etc/systemd/system/
sudo touch prusaconnect_upload_cam.service
sudo systemctl start prusaconnect_upload_cam.service
. Now the script should start. And you an check if it is working in PrusaConnect.sudo systemctl status prusaconnect_upload_cam.service
.sudo systemctl enable prusaconnect_upload_cam.service
. You can check if it works when you restart your raspi withsudo reboot
.I hope this helps a little bit.