Installing Basic Vision With A USB Webcam

294 views
Skip to first unread message

Timothy Litvin

unread,
Oct 4, 2017, 3:10:41 PM10/4/17
to BeagleBoard

Building a custom mobile robotics platform, I’ve been monkeying with Linux, BeagleBone Blue and ArduPlane and Mission Planner for a few months. Communicating via wifi.  It’s been a rutted road, but I’ve gotten that portion to work.  I was greatly relieved to find a well-written beginner’s book dedicated to the BBBlue is now available, the 2nd edition of BeagleBone Robotics Projects.


Nevertheless, I’m stuck on what seems like should be a dirt-simple thing: viewing a webcam (Chapter 5). I’m using a Logitech C920 webcam, powered thru a USB hub (I’ve tried powering it direct-to-BB too). I can SSH in on wifi and I see /dev/video1 ...(not video0):


kimo@beaglebone:~$ cd /dev

kimo@beaglebone:/dev$ ls

apm_bios         media1              spidev1.1  tty29  tty53   ttyS5

autofs           mem                 stderr     tty3   tty54   ubi_ctrl

block            memory_bandwidth    stdin      tty30  tty55   uhid

btrfs-control    mmcblk0             stdout     tty31  tty56   uinput

bus              mmcblk0p1           tty        tty32  tty57   urandom

char             mmcblk1             tty0       tty33  tty58   v4l

console          mmcblk1boot0        tty1       tty34  tty59   vcs

cpu_dma_latency  mmcblk1boot1        tty10      tty35  tty6    vcs1

cuse             mmcblk1p1           tty11      tty36  tty60   vcs2

disk             mqueue              tty12      tty37  tty61   vcs3

dri              net                 tty13      tty38  tty62   vcs4

fd               network_latency     tty14      tty39  tty63   vcs5

full             network_throughput  tty15      tty4   tty7    vcs6

fuse             null                tty16      tty40  tty8    vcsa

hwrng            port                tty17      tty41  tty9    vcsa1

i2c-0            ppp                 tty18      tty42  ttyGS0  vcsa2

i2c-1            psaux               tty19      tty43  ttyO0   vcsa3

i2c-2            ptmx                tty2       tty44  ttyO1   vcsa4

initctl          pts                 tty20      tty45  ttyO2   vcsa5

input            random              tty21      tty46  ttyO3   vcsa6

kmem             rfkill              tty22      tty47  ttyO4   vga_arbiter

kmsg             rtc                 tty23      tty48  ttyO5   video1

lightnvm         rtc0                tty24      tty49  ttyS0   watchdog

log              shm                 tty25      tty5   ttyS1   watchdog0

loop-control     snapshot            tty26      tty50  ttyS2   xconsole

mapper           snd                 tty27      tty51  ttyS3   zero

media0           spidev1.0           tty28      tty52  ttyS4

 

and lsusb reports it:

 

kimo@beaglebone:~$ lsusb

Bus 001 Device 010: ID 046d:082d Logitech, Inc. HD Pro Webcam C920

Bus 001 Device 005: ID 05e3:0610 Genesys Logic, Inc. 4-port hub

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

 

I’ve installed and started vncserver. I’ve installed guvcview, but it won’t start as it seems to be looking for a wrong configuration file in a non-existent directory:


kimo@beaglebone:/dev$ guvcview

GUVCVIEW: couldn't open /home/kimo/.config/guvcview2/video0 for read: No such file or directory

V4L2_CORE: ERROR opening V4L interface: No such file or directory

Unable to init server: Could not connect: Connection refused

GUVCVIEW: (GUI) Gtk3 can't open display

Guvcview error: no video device found


Of course, confirming on my Windows 10 machine, using TightVNC Viewer, ->Applications menu->Multimedia->guvcview, it’s not finding my Logitech C920: “no device found”.

 

Pretty sure I followed the recipe by the book, and have checked it repeatedly. I need to borrow better eyes or a bigger brain.

What did I miss? How do I tweak this? Ultimately I want to run two or more USB cameras through OpenCV.  




Btw, proofreading, there’s a typo and font disparity on pp105 of the BBRP2E book, an executable command instructing us noobs to “make sure you start the server… by typing VNC server via SSH”, i.e., “vncserver”.) 

Dennis Lee Bieber

unread,
Oct 4, 2017, 3:42:11 PM10/4/17
to beagl...@googlegroups.com
On Wed, 4 Oct 2017 12:10:41 -0700 (PDT), Timothy Litvin
<capnt...@gmail.com> declaimed the
following:


>
>I’ve installed and started vncserver. I’ve installed guvcview, but it won’t
>start as it seems to be looking for a wrong configuration file in a
>non-existent directory:
>
>
>kimo@beaglebone:/dev$ guvcview
>
>GUVCVIEW: couldn't open /home/kimo/.config/guvcview2/video0 for read: No
>such file or directory
>
>V4L2_CORE: ERROR opening V4L interface: No such file or directory
>
>Unable to init server: Could not connect: Connection refused
>
>GUVCVIEW: (GUI) Gtk3 can't open display
>
>Guvcview error: no video device found
>
>

Don't know if this part of the documentation is applicable:
http://guvcview.sourceforge.net/Doc.html

"""
Configuration

Guvcview stores all options into a configuration file stored in the user
home directory under .config/guvcview2/video0. The file is opened at start
and it is rewritten at exit. By removing the file the default values will
be loaded, and a new file will be written at exit.

For other devices than the default video0, the configuration file name will
have a device sufix, videoN, where N is the device number, this allows
different configurations for different devices.
Just remember that device numbering depends on the usb port the device is
connected, so if you plug your cameras to different ports each time, you
will end up with the wrong configuration.
"""

Is there any command line option to specify different video devices?
(the web site only says to use "man gucview")

{Okay -- installed in my Debian 9.1 virtual machine...

GUVCVIEW(1) General Commands Manual GUVCVIEW(1)

NAME
guvcview - GTK+ base UVC Viewer

SYNOPSIS
guvcview

DESCRIPTION
Guvcview is a simple GTK+ interface for capturing and viewing
video
from devices supported by the Linux UVC driver. It fully
supports
video4linux2 so it should work with any driver that supports this
API,
including the gspca driver.

USAGE
guvcview [options...]

OPTION
-h, --help Print help
-v, --version Print version
-w, --verbosity=LEVEL Set Verbosity level
(def:
0)
-d, --device=DEVICE Set device name
(def:
/dev/video0)

and many more...

--
Wulfraed Dennis Lee Bieber AF6VN
wlf...@ix.netcom.com HTTP://wlfraed.home.netcom.com/

Reply all
Reply to author
Forward
0 new messages