[Video] Adding a USB Webcam to DWC with a Raspberry Pi
-
https://www.youtube.com/watch?v=JZkytb3yGp0
Works with USB Cameras. Its not tested with Pi Cams.
-
Thanks for that.
-
I've tried a few different packages that present the Pi camera as a web cam. The simplest I have found (and one I currently use) is here:
http://picamera.readthedocs.io/en/latest/recipes2.html#web-streaming
I have used it in the past with DWC but do not normally. I use it daily as a web cam for general monitoring of my printer http://<ip address:port> and as a feed to timelapse software.
Having said that I just tried with DWC. There does seem to be a problem with DWC in the version I have (1.23). It does not "like" the URL. It sometimes even adds irrelevant paths to the url for the camera. For example I put in http://<ip address:port> and it changes it to http://<ip address:port>/Job. So there may be an issue there - or I simply am not doing something right.
EDIT: Solved the issue - entirely my error. Needs to be in an iframe
-
@stuartofmt said in [Video] Adding a USB Webcam to DWC with a Raspberry Pi:
DWC in the version I have (1.23)
That's a quite old version of DWC now as well. Things are a bit different in DWC3.x
-
Sorry - I have DWiFi Server 1.23 and DWC 3.1.1 -- looked but didn't look
-
brilliant, thank you. I never knew how to make it work but that step by step guide is of great help.
I seem to be stuck halfway though; I installed snapd and mjpg streamer and everything seems to be running well (see the snapd process)
pi@duet3:~ $ ps -A PID TTY TIME CMD 1 ? 00:00:06 systemd 2 ? 00:00:00 kthreadd 3 ? 00:00:00 rcu_gp 4 ? 00:00:00 rcu_par_gp 7 ? 00:00:00 kworker/u8:0-events_unbound 8 ? 00:00:00 mm_percpu_wq 9 ? 00:00:00 ksoftirqd/0 10 ? 00:00:00 rcu_sched 11 ? 00:00:00 migration/0 12 ? 00:00:00 cpuhp/0 13 ? 00:00:00 cpuhp/1 14 ? 00:00:00 migration/1 15 ? 00:00:00 ksoftirqd/1 18 ? 00:00:00 cpuhp/2 19 ? 00:00:00 migration/2 20 ? 00:00:00 ksoftirqd/2 23 ? 00:00:00 cpuhp/3 24 ? 00:00:00 migration/3 25 ? 00:00:00 ksoftirqd/3 28 ? 00:00:00 kdevtmpfs 29 ? 00:00:00 netns 30 ? 00:00:00 kworker/0:1-events 32 ? 00:00:00 kauditd 33 ? 00:00:00 khungtaskd 34 ? 00:00:00 oom_reaper 35 ? 00:00:00 writeback 36 ? 00:00:00 kcompactd0 54 ? 00:00:00 kblockd 55 ? 00:00:00 blkcg_punt_bio 56 ? 00:00:00 watchdogd 58 ? 00:00:00 rpciod 59 ? 00:00:00 kworker/u9:0-hci0 60 ? 00:00:00 xprtiod 61 ? 00:00:00 kswapd0 62 ? 00:00:00 nfsiod 64 ? 00:00:00 iscsi_eh 65 ? 00:00:00 dwc_otg 66 ? 00:00:00 DWC Notificatio 67 ? 00:00:00 kworker/1:2-events 68 ? 00:00:00 vchiq-slot/0 69 ? 00:00:00 vchiq-recy/0 70 ? 00:00:00 vchiq-sync/0 71 ? 00:00:00 vchiq-keep/0 72 ? 00:00:00 SMIO 73 ? 00:00:00 kworker/1:3-events_freezable 74 ? 00:00:00 mmc_complete 75 ? 00:00:00 kworker/1:1H-kblockd 76 ? 00:00:00 kworker/0:1H-mmc_complete 77 ? 00:00:00 jbd2/mmcblk0p2- 78 ? 00:00:00 ext4-rsv-conver 79 ? 00:00:00 kworker/0:2H-kblockd 80 ? 00:00:00 ipv6_addrconf 84 ? 00:00:00 kworker/2:1H-kblockd 86 ? 00:00:00 kworker/3:1H-kblockd 101 ? 00:00:00 kworker/1:2H 102 ? 00:00:00 kworker/3:2H-kblockd 108 ? 00:00:00 irq/166-usb-001 111 ? 00:00:00 kworker/2:2H-kblockd 123 ? 00:00:03 systemd-journal 144 ? 00:00:01 kworker/u8:2-events_unbound 148 ? 00:00:01 systemd-udevd 149 ? 00:00:00 loop0 150 ? 00:00:00 loop1 172 ? 00:00:00 SMIO 179 ? 00:00:00 mmal-vchiq 180 ? 00:00:01 spi0 183 ? 00:00:00 mmal-vchiq 186 ? 00:00:00 mmal-vchiq 189 ? 00:00:00 mmal-vchiq 233 ? 00:00:00 cfg80211 241 ? 00:00:00 brcmf_wq/mmc1:0 244 ? 00:00:00 brcmf_wdog/mmc1 321 ? 00:00:00 systemd-timesyn 358 ? 00:00:00 cron 359 ? 00:00:00 rsyslogd 360 ? 00:00:00 dbus-daemon 362 ? 00:01:25 DuetControlServ 363 ? 00:00:00 thd 366 ? 00:00:00 wpa_supplicant 368 ? 00:00:00 rngd 373 ? 00:00:00 avahi-daemon 374 ? 00:00:00 alsactl 377 ? 00:00:00 systemd-logind 397 ? 00:00:02 snapd 425 ? 00:00:00 avahi-daemon 471 ? 00:00:00 wpa_supplicant 479 ? 00:00:00 kworker/3:4-events_power_efficient 534 ? 00:00:02 irq/167-dcs-trp 549 ? 00:00:00 kworker/2:2-events 553 ? 00:00:00 hciattach 555 ? 00:00:00 kworker/u9:1-hci0 557 ? 00:00:00 bluetoothd 558 ? 00:00:00 bluealsa 573 ? 00:00:00 krfcommd 628 ? 00:00:00 dhcpcd 633 ? 00:00:21 DuetWebServer 645 tty1 00:00:00 agetty 654 ? 00:00:00 sshd 666 ? 00:00:00 sshd 795 ? 00:00:00 systemd 796 ? 00:00:00 (sd-pam) 810 ? 00:00:00 sshd 811 pts/0 00:00:00 bash 834 pts/0 00:00:00 sudo 835 pts/0 00:00:00 nano 984 ? 00:00:00 kworker/0:0-events 985 ? 00:00:00 kworker/3:1-cgroup_destroy 988 ? 00:00:00 kworker/2:0-mm_percpu_wq 994 ? 00:00:00 kworker/0:0H 995 ? 00:00:00 kworker/3:0H 996 ? 00:00:00 kworker/1:0-events 1005 ? 00:00:00 kworker/u8:1-events_unbound 1053 ? 00:00:00 kworker/3:0-events_power_efficient 1154 ? 00:00:00 kworker/0:2-events 1157 ? 00:00:00 kworker/2:1-events 1159 pts/0 00:00:00 ps
mjpg is well installed
pi@duet3:~ $ sudo snap install mjpg-streamer snap "mjpg-streamer" is already installed, see 'snap help refresh'
And I've copied exactly the same config file as yours
pi@duet3:~ $ sudo nano /var/snap/mjpg-streamer/current/config GNU nano 3.2 /var/snap/mjpg-streamer/current/config INPUTOPTS="input_uvc.so -y -r 640x480 -d /dev/video0" PORT="-p 8080" DAEMON="true"
And yet when I enter my duet IP :8080, I get no response.
Any hint on what could be the issue?
Using a RPi 3B+ on Duet3
Thanks!
-
Which USB Camera are you using?
-
@PCR well I'm not; I got a raspi cam.
My first attempt was with the line
INPUTOPTS="input_raspi.so"
as described in the guide but that didn't work out either.I thought I would try with your config that seemed to be working as it seems the issue is with the interface not loading; I would assume if the camera was setup wrong the GUI would still load, just show no image.
-
Sorry. Raspi Cam is Not working with the SNAP. Interface will only be loade when camera is working.
I saw on github a new plugin for raspi cams for DWC
Best
-
-
@PCR Thanks, I did manage to get it working just for a few moments before it froze and I can't get it to run again lol (the interface load, not the cam)
But I'll keep trying and keep you posted
-
Installed on rasp pi3 with octoprint and activated on DWC with Logitech C270 webcam. It works.
Now I have to fix the Timelapse. -
@gdefranc with duetlapse easy. But use the snapshot Screen of Mjpg
-
And the DuetAPI from @jay_s_uk
-
You can turn a Pi zero+ cam as a usb webcam, using https://github.com/showmewebcam/showmewebcam
-
I use a PizeroW with the Pi cam module and MotionOS to turn it into a webcam. It works very well with DWC and makes for a very small and very functional cam.