Skip to content

areaDetector/ADUVC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ADUVC

An EPICS Driver for USB Video Class (UVC) devices

Author: Jakub Wlodek
Corresponding Author: Kazimierz Gofron
Created: July 19, 2018
Last Updated: October 29, 2020
Copyright (c): 2018-2020 Brookhaven National Laboratory

Release versions of this driver are available on Github. Release notes are available here. Please report any problems or feature requests on the issues page here.

Installation

Note - ADUVC has only been tested on linux

Prior to installing the ADUVC install the required dependencies via your package manager:

sudo apt install libusb-dev libusub-1.0-0-dev

As of release R1-6, the libuvc helper library is built by default using the EPICS build system. As a result, it will link against the libjpeg library included in ADSupport, and building ADUVC should only require running make in the root directory.

In the event that you wish to build libuvc yourself, you may use the supplied helper script for building libuvc, or you may build from source yourself. Documentation for the library can be found here

IOC Setup

Start by identifying connected cameras to your system, using the provided cameraDetector program in uvcSupport. (You must first build libuvc by running make in the uvcSupport directory):

cd  uvcSupport/cameraDetector
make
./uvc_locater

You will get output similar to the following:

UVC initialized successfully
-------------------------------------------------------------
Serial Number:      1275BB10
Vendor ID:          1133
ProductID:          2085
Manufacturer:       (null)
Product:            (null)
UVC Compliance:     0

You may need to run the program as root if camera serial number is locked behind root access.

Next, in the st.cmd file in the iocs/uvcIOC/iocBoot/iocUVC directory, locate the ADUVCConfig function call. There are three options for this function, one where the serial number is used, one where the product ID is used, and one where the UVC device index is used. Simply uncomment the way you wish to connect to the device, and pass the appropriate values in for the serial, productID, and deviceIndex parameters. If available, the serial number connection mode is recommended, since it guarantees unique access to the device. The product ID mode is the second best option, with deviceIndex only being a recommended operating mode if you have identical devices with no serial numbers running on the same machine (in which case the product IDs wouldn't be unique). From here the driver IOC is ready to be started with:

./st.cmd

Again, note that if usb devices are locked behind root privelages you may need to run the IOC as root, or adjust udev permissions/rules. To simplify this process, there is a python3 script in the support directory - it will run the uvc_locater command, and then use the output vendor/product IDs to generate udev rules for each camera. This file will then be installed under /etc/udev/rules.d/###-usbcams.rules.

Further documentation, including CSS screenshots and usage information, is available at the driver's website.

Advantages

There are a few advantages the UVC cameras have over traditional industrial cameras:

  • Price - Cameras can range from 20 to 500 dollars
  • Ubiquity - Almost every consumer usb camera supports the UVC protocol, as well as many enterprise cameras
  • PTZ - Built in Pan/Tilt/Zoom control makes certain devices easy all-in-one monitoring cameras
  • Form Factor - Huge variety in camera types, including pencil cameras, board cameras, and traditional industrial cameras.

Example Devices

Below are some devices and specifications that have been deployed using ADUVC. If you have used a different camera with ADUVC, please feel free to add it to the list below.

Device Max Resolution Max Framerate PTZ Price ($)
E-Con See3Cam_CU55 2248x2048 60 No 120
Logitech HD Pro C920 1920x1080 60 No 129
Logitech BCC950 1920x1080 30 Yes 299
Opti-Tekscope microscope 1280x720 30 No 89
Fantronics Mobile Snake Cam 1280x720 30 No 20
USBFHD06H-SFV 1920x1080 30 No 75