Notifications
Clear all

Prusa Connect Camera Server Using Viam  

  RSS
Michael Lee
(@michael-lee)
Member
Prusa Connect Camera Server Using Viam

I have transitioned from using OctoPrint to Prusa Connect for all of my printers. Overall I have found the integration better for me as I only have Prusa printers and the Prusa's integration is seamless. One main disadvantage is being able to observe the printers with a camera.

Prusa's out of the box camera support didn't suit my needs. Currently Prusa Connect only supports using a phone as a camera across all their printer models. If you happen to have an older MK model (MK2.5, MK2.5S, MK3, MK3S, MK3S+.) you could use the RaspberryPi that is hosting PrusaLink + Prusa Connect, but you cannot use this method for the XL, Mini, or MK4 models.

So I set out to solve this problem by making a service that runs on Raspberry PI using Viam. Viam has built-in support for various camera types, automatically detects and configures cameras, and supports multiple cameras connected at the same time. If you have ever tried to setup your own camera streaming server on a Raspberry Pi, you know how frustrating this can be, and Viam makes it much easier.

The service I wrote takes snapshots from the camera and uploads the images to the Prusa Connect Camera API. At this time, Prusa Connect does not support video streaming. Their UI auto-refreshes images every 10 seconds which is reasonable enough to monitor and detect print failures.

You can read the full article and how-to on Instructables.

Posted : 22/02/2024 1:30 pm
jeepgod liked
jeepgod
(@jeepgod)
Active Member
RE: Prusa Connect Camera Server Using Viam

Any chance on more detailed instructions on how to add / configure the json files. I am just not getting it.

 

Posted : 02/04/2024 7:37 pm
_KaszpiR_
(@_kaszpir_)
Reputable Member
RE: Prusa Connect Camera Server Using Viam

The article on the instructables talks about registering to viam service.

If you need something that is for free and can run locally then I would suggest https://nvtkaszpir.github.io/prusa-connect-camera-script/   to upload images to Prusa Connect. One of the articles there also shows a bit how to us mediamtx for streaming proxy server specially for local networks.

See my GitHub and printables.com for some 3d stuff that you may like.

Posted : 02/04/2024 10:03 pm
jeepgod
(@jeepgod)
Active Member
RE: Prusa Connect Camera Server Using Viam

Thank you for the reply, I was able to get Viam set up and running on the raspberry Pi. The part I am having trouble with is Step 6 from the instructables  link.. I can create the Prusa Connect module . I am lost on how to configure it with text box. I am not sure what text to add or how to input it. Everything I have tried so far does not work.  My logs keep repeating "Waiting for module to complete startup and registration"

Posted : 02/04/2024 11:51 pm
Mike B
(@mike-b-3)
Eminent Member
RE: Prusa Connect Camera Server Using Viam

 

Posted by: @michael-lee

Currently Prusa Connect only supports using a phone as a camera across all their printer models. If you happen to have an older MK model (MK2.5, MK2.5S, MK3, MK3S, MK3S+.) you could use the RaspberryPi that is hosting PrusaLink + Prusa Connect, but you cannot use this method for the XL, Mini, or MK4 models.

This isn't true - see this post in the MK4 forum: https://forum.prusa3d.com/forum/english-forum-original-prusa-i3-mk4-general-discussion-announcements-and-releases/mk4-rpi-webcam-with-prusa-connect/#post-706000

Prusa MK4 since Jan 2024, Printables: @MikeB_1505898

Posted : 03/04/2024 3:12 am
jeepgod
(@jeepgod)
Active Member
RE: Prusa Connect Camera Server Using Viam

I have been working my way through your great instructions but as a noob I am at a complete loss on how to add the token and fingerprint into the config. I am not sure if I do that through SSH or some other way. Can you please me additional details on how to do that.

Thanks

Posted : 06/04/2024 6:08 pm
_KaszpiR_
(@_kaszpir_)
Reputable Member
RE:

To whom are you addressing that question?

See my GitHub and printables.com for some 3d stuff that you may like.

Posted : 06/04/2024 7:24 pm
jeepgod
(@jeepgod)
Active Member
RE: Prusa Connect Camera Server Using Viam

Sorry I was address the question to KaszpiR_

I like the read the instructions before I do them to make sure I understand. I have been working my through them and didnt make it far. I received this message.

mkdir: cannot create directory ‘/home/pi’: Permission denied

Any ideas?

 

Posted : 07/04/2024 12:14 am
jeepgod
(@jeepgod)
Active Member
RE: Prusa Connect Camera Server Using Viam

_KaszpiR_

I have made some great progress but have 2 questions, I am using ssh

1, I ran the set set -o allexport; source usb.env; set +o allexport./prusa-connect-camera.sh line and got the 204. How do I get out of that with out having to end my session and log back in.

2. I  ran sudo systemctl start [email protected] and sudo systemctl status [email protected] and both gave error

    Failed to start [email protected] - Prusa Connect Camera Script.

I am thinking it might from my 1st question

 

Thanks.

Posted : 07/04/2024 3:12 am
_KaszpiR_
(@_kaszpir_)
Reputable Member
RE: Prusa Connect Camera Server Using Viam

1. The first command is just for thesting that it works. If you get 204 then it's good and then just Ctrl+c to abort it because the script is not intended to run in interactive mode but via syatemd

2. You need to look at systemctl status [email protected]

I suspect you need to rename usb.env to .usbenv and it should work

See my GitHub and printables.com for some 3d stuff that you may like.

Posted : 07/04/2024 7:30 pm
jeepgod
(@jeepgod)
Active Member
RE: Prusa Connect Camera Server Using Viam

I still having the same issue.

I used sudo mv usb.dist .env to copy the file and then eddited it with nano. I changed the IP address, token and fingerprint. and saved it.

Here is the message I am receiving.  Thanks

 

Posted : 08/04/2024 8:12 pm
_KaszpiR_
(@_kaszpir_)
Reputable Member
RE: Prusa Connect Camera Server Using Viam

Try sudo journalctl -f -u [email protected]

Or see syslog logs

See my GitHub and printables.com for some 3d stuff that you may like.

Posted : 08/04/2024 9:42 pm
Share: