Raspberry pi to Duet3 - connecting camera
-
I use a 3B+ (not controlling the Duet). It handles multiple functions quite well. Some camera software can put a heavy load on the Pi. As a result I created (and just released) this:
https://forum.duet3d.com/topic/23759/videostreamerMay be useful to you.
-
@stuartofmt, very cool, I will give it a try. Thanks!
-
@stuartofmt, could you double check the wget link that is shown in the readme file?
wget https://github.com/stuartofmt/VideoStreamer/raw/master/VideoStreamer.py
It is not working for me.
-
Done - It should have been:
wget https://github.com/stuartofmt/VideoStreamer/blob/master/videostream.py
-
@stuartofmt, I can now do the wget. Note that the documentation also refers to VideoStreamer instead of videostream (note also capitalization) in many places.
When I run videostream.py I get a syntax error on line 7. -
@jens55 said in Raspberry pi to Duet3 - connecting camera:
@stuartofmt, I can now do the wget. Note that the documentation also refers to VideoStreamer instead of videostream (note also capitalization) in many places.
When I run videostream.py I get a syntax error on line 7.Sorry - this was entirely my fault - I was running on auto-pilot.
The original url for downloading was correct ! The changed url is causing the syntax error.
So now the question is why couldn't WE download. It failed for me a while ago but when I just checked again - it worked fine. May have been something at the github end.Try it again - should be all good.
In any case - I have renamed everything (including the github to videostream as I was confusing myself with the two variations on wording :-).
-
@stuartofmt, the original link now works with the changed file name but I still get the error.
Now to be sure, this could be entirely my issue since I did not load any of the dependencies that you mentioned. However, the issue doesn't look like it is caused by dependencies .....!
Screenshot from 2021-06-21 14-29-51.png -
@jens55 said in Raspberry pi to Duet3 - connecting camera:
@stuartofmt, the original link now works with the changed file name but I still get the error.
The error is the same as before - likely you are using the .../blob/... form - which gives the html ....
Make sure you remove the old videostream.py file first or try this explicit download .. . note that the names were changed and the use of ../raw/..
wget https://github.com/stuartofmt/videostream/raw/master/videostream.py -O videostream.py
The dependency errors look very different ,,,,,,
-
@stuartofmt, my bad, the second download added a '.1' instead of overwriting the initial download.
I got further but then ran into dependencies. I attempted to install everything you listed but some dependencies did not load (not found) .
The error is now a dependency error re module 'imutils' -
I found the following to be the simplest guide for getting basic webcam streaming working on the PI running DuetPI.
I just use the example start script in the pi users crontab to start it a boot. Set the URL in DWC.
-
@nurgelrot said in Raspberry pi to Duet3 - connecting camera:
I found the following to be the simplest guide for getting basic webcam streaming working on the PI running DuetPI.
I just use the example start script in the pi users crontab to start it a boot. Set the URL in DWC.
Yes - this is one of the ones I tried and unfortunately (in my case but probably not in all) it used a lot of CPU. The program I have is generally < 2% on a Pi. But I acknowledge that miles-may-vary.
-
@jens55 said in Raspberry pi to Duet3 - connecting camera:
@stuartofmt, my bad, the second download added a '.1' instead of overwriting the initial download.
I got further but then ran into dependencies. I attempted to install everything you listed but some dependencies did not load (not found) .
The error is now a dependency error re module 'imutils'Most of the dependencies can be resolved with:
python3 -m pip install [dependency name]
for example:
python3 -m pip install imutils
-
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu----- r b swpd free buff cache si so bi bo in cs us sy id wa st 0 0 0 7648680 76488 201236 0 0 1 0 103 12 1 5 93 0 0 0 0 0 7648796 76492 201236 0 0 0 2 2565 3624 2 4 94 0 0 1 0 0 7648756 76496 201236 0 0 0 2 2561 4425 2 6 92 0 0 0 0 0 7648632 76496 201236 0 0 0 2 2639 4011 2 6 93 0 0
90+% idle while printing. I don't think al little CPU usage is a big deal. If you're not using the the CPU you may as well not have it.
-
@stuartofmt, thanks - that worked
I will have to set up a camera on my test computer and see how it goes. -
@nurgelrot said in Raspberry pi to Duet3 - connecting camera:
I don't think al little CPU usage is a big deal. If you're not using the the CPU you may as well not have it.
I agree. When I said "a lot" - I was referring to situations where the camera software was consuming > 70% CPU. This, for some mysterious reason(s) that do not affect all users / installs. In my case - I could not track it down
In any case - we have choices. A good thing.
-
@jens55 said in Raspberry pi to Duet3 - connecting camera:
@stuartofmt, thanks - that worked
I will have to set up a camera on my test computer and see how it goes.FYI - I have posted a new version with better detection of available camera capabilities. Just need to download and use the new videostream.py file