Benachrichtigungen
Alles löschen

RTSP camera with Prusa Connect  

  RSS
peto.r_
(@peto-r_)
Active Member
RTSP camera with Prusa Connect

Hi, I wanted to ask, if there is some way co connect my RTSP tapo C200 camera to Prusa connect. When I was searching for it, I only found that there is some way with Docker compose or something like that. But I have really no idea, how something like that can work. Total best would be, if there is some video-instructions. But also, didn't found anything. My case is, that I have the camera in my Lack enclosure and it would be nice, when I have it also in the Prusa Connect interface.

Thanks for any response. And have nice day.

-Peter 

Veröffentlicht : 02/03/2024 8:39 pm
Tojik
(@tojik)
Mitglied Moderator
RE: RTSP camera with Prusa Connect

I get your use case, there should be open source projects that try to cover this use case. Basically, docker lets you just download a finished piece of software with all the configs done and run it, however installing docker itself can be intimidating even if it's not really a big deal most of the time. I have not used the specific thing you are talking about tho, so I cannot easily give you the steps, sorry. Usually you can ask the creator of the tool you are trying to use and they might be willing to help you. The feeling of somebody trying to use the thing you made is very rewarding, at least for me.

Veröffentlicht : 07/03/2024 10:05 pm
Fallon
(@fallon)
Eminent Member
RE: RTSP camera with Prusa Connect

I went the Docker route. It's just some code that periodically pulls photos off the camera & shoves it to PrusaConnect via a method Prusa supports. You have to learn Docker & either run that on a PC, Pi or something. Learning Docker took me a few hours, but I'm an IT guy & needed to finally learn about it a bit anyway.

Veröffentlicht : 08/03/2024 6:40 pm
Tojik gefällt das
Tojik
(@tojik)
Mitglied Moderator
RE: RTSP camera with Prusa Connect

Yep, I had a big aversion towards it when I first heard about it, now I am in the same "should learn about it anyway" boat 😁

Veröffentlicht : 08/03/2024 6:43 pm
_KaszpiR_
(@_kaszpir_)
Honorable Member
RE: RTSP camera with Prusa Connect

https://github.com/nvtkaszpir/prusa-connect-camera-script I've done script how to do it without docker.

also if you could provide more details how you can reach your camera stream I can provide exact details how to configure it with rstp + ffdshow

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

Veröffentlicht : 08/03/2024 7:45 pm
Tojik gefällt das
peto.r_
(@peto-r_)
Active Member
Themenstarter answered:
RE: RTSP camera with Prusa Connect

For now, the camera stream can be reached only by the phone app. (Called tapo in my case). There is also created some camera profile (name and password.) Iam running the prusalink on rpi zero directly attached to the Einsy board. (Mk3S+). So I cannot reach the rpi with ssh or any other remote control. So, do I have to install some other 3rd party software? Or do everything online. Thanks.

Veröffentlicht : 08/03/2024 8:49 pm
_KaszpiR_
(@_kaszpir_)
Honorable Member
RE:

looking at https://www.tp-link.com/us/support/faq/2680/ it seems that the address to the camera stream would be

rtsp://tapoadmin:[email protected]:554/stream1 

assuming that user/password is tapoadmin/tapoadmin and device address is 192.168.1.157

 

If you have raspberry pi zero (non 'w' model) then you would need to add usb splitter and usb ethernet dongle or some other wireless device access to the rpi, but frankly speaking, getting `rpi zero w` would be just much better option.

If you have rpi zero w, then you would have to reconfigure it to enable SSH access (connect to the display, attach keyboard, log int, and run raspi-config and enable ssh there)

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

Veröffentlicht : 10/03/2024 9:29 am
Tojik
(@tojik)
Mitglied Moderator
RE: RTSP camera with Prusa Connect

If any camera tomfoolery will be taking place, get a please zero 2, not just 1 W. Chances are the Zero will start producing subpar prints ance aditional software is running on the single core CPU

Veröffentlicht : 11/03/2024 11:59 am
Tojik
(@tojik)
Mitglied Moderator
RE:

If you have rpi zero w, then you would have to reconfigure it to enable SSH access (connect to the display, attach keyboard, log int, and run raspi-config and enable ssh there)

or take the SD card out, put it into your computer, put a file called "ssh" (no extension, no nothing, just ssh) on the SD card (only the boot partition shows up in windows, if in linux, it will be called bootfs) put the card back, you have SSH enabled.

Veröffentlicht : 11/03/2024 12:01 pm
peto.r_
(@peto-r_)
Active Member
Themenstarter answered:
RE: RTSP camera with Prusa Connect

So, I enable the ssh on the rpi zero 2w. Then there are the commands on that Github page you sent. What is the order, I should write them down? Do I have install Docs and commits first? Or edit the ffmpeg file?  My next question is, from where I can get the fingerprint? On the Prusaconnect page is only the token code. 

Veröffentlicht : 12/03/2024 10:45 pm
_KaszpiR_
(@_kaszpir_)
Honorable Member
RE:

https://nvtkaszpir.github.io/prusa-connect-camera-script/installation/ start here and follow the 'next' steps - I described in detail  what to do such as installing packages and configuring PrusaConnect.

Then when there is an article with the list of the cameras then select the RTSP streaming cams and continue there (create config, test the config, install service and that's should be it).

 

Anything in first readme in the repo about docs and configs or more like a note for me how to update those and  super quick start how to.

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

Veröffentlicht : 13/03/2024 8:09 am
[&] undso.io
(@undso-io)
Mitglied
RE:

Hi _KaszpiR_,

First of all: Thank you so much for providing the instructions and script! I got my Logitech C920 to work with a Raspberry Pi Zero 2!I'm using fswebcam as you suggested in your usb.dist. As I'm pretty new to this, is there any way to get an RTSP stream out of this configuration that I could use in Homebridge (running on a separate Raspberry) to get a video stream into my HomeKit environment? I'm trying to set up ffmpeg but can't get it to work... ;(

Veröffentlicht : 02/05/2024 7:36 pm
_KaszpiR_
(@_kaszpir_)
Honorable Member
RE:

The script I wrote is just for making snapshots.

If you want to make a streaming then I suggest using mediamtx https://github.com/bluenviron/mediamtx , example of running it with USB camera https://nvtkaszpir.github.io/prusa-connect-camera-script/stream.mediamtx/ but that may need additional adjustments depending on the camera capabilities.

Also notice that if that will work then you may need to switch the scripts sending snapshots to consume remote stream with ffmped and not fswebcam, because only one app can use the device at once, so stop sending screenshots before trying to adjust the setup.

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

Veröffentlicht : 03/05/2024 4:29 pm
[&] undso.io
(@undso-io)
Mitglied
RE: RTSP camera with Prusa Connect

Hi, thanks for sending me down this path. Everything is working like a charm. I'm using a Raspberry Pi Zero 2 with a Logitech C920. I've installed Mediamtx and also your Prusa Connect script on the same Pi Zero. On top of that I'm using the RTSP stream to integrate the camera with HomeKit via the Homebridge (which is running on another machine).

In case anyone is struggling with configuring it (it took me a while...), I'm going to share mine with you:

For Mediamtx my mediamtx.yml contains:

paths:
  cam:
    runOnInit: ffmpeg -f v4l2 -i /dev/video0 -pix_fmt yuv420p -video_size 1920x1080 -framerate 30 -preset ultrafast -c:v libx264 -b:v 6000k -f rtsp rtsp://localhost:$RTSP_PORT/$MTX_PATH
    runOnInitRestart: yes

And for the Prusa Connect Camera Script I added this to my .env

PRINTER_ADDRESS=...
PRUSA_CONNECT_CAMERA_TOKEN=...
PRUSA_CONNECT_CAMERA_FINGERPRINT=...
CAMERA_DEVICE=/dev/null
CAMERA_COMMAND=ffmpeg
CAMERA_COMMAND_EXTRA_PARAMS="-loglevel error -y -rtsp_transport udp -i 'rtsp://[rpizero-ip]:8554/cam' -f image2 -vframes 1 -pix_fmt yuv420p "
Veröffentlicht : 05/05/2024 1:50 pm
_KaszpiR_ gefällt das
Teilen: