[Nottingham] USB Digital Microscopes

TJ linux at tjworld.net
Mon Apr 19 22:20:32 UTC 2010


On Mon, 2010-04-19 at 20:27 +0000, Ron Wilton wrote:
> Hello
> 
> Does anyone know of a USB Digital Microscope that can be used with
> Ubuntu?

I did a quick test on Lucid (10.04) and found that the Intel Play QX3
works without needing the QtX3 application. I tested it with Cheese.

The kernel cpia driver handles the camera.

[48209.028055] usb 2-1: new full speed USB device using uhci_hcd and address 6
[48209.236283] usb 2-1: configuration #1 chosen from 1 choice
[48209.250761] V4L-Driver for Vision CPiA based cameras v1.2.3
[48209.250767] Since in-kernel colorspace conversion is not allowed, it is disabled by default now. Users should fix the applications in case they don't work without conversion reenabled by setting the 'colorspace_conv' module parameter to 1
[48209.253695] USB driver for Vision CPiA based cameras v1.2.3
[48209.253748] USB CPiA camera found
[48209.999090]   CPiA Version: 1.33 (2.10)
[48209.999096]   CPiA PnP-ID: 0813:0001:0106
[48209.999101]   VP-Version: 1.0 0100
[48209.999163] usbcore: registered new interface driver cpia

The camera is assigned a device number after the existing video devices.
In my case it is video2:

ls -l /dev/video*
crw-rw----+ 1 root video 81, 0 2010-04-19 09:36 /dev/video0
crw-rw----+ 1 root video 81, 1 2010-04-19 09:56 /dev/video1
crw-rw----+ 1 root video 81, 2 2010-04-19 22:58 /dev/video2

Unless you experience problems with applications unable to view the
camera, *IGNORE* instructions to specify the colorspace_conv parameter.

In case an application does need it, here's how:

# unload the driver
sudo modprobe -r cpia_usb
# load the driver with parameter
sudo modprobe cpia colorspace_conv=1

Do it automatically (saved to a module configuration file):

$ echo -e "# Intel Play QX3 Microscope\noptions cpia colorspace_conv=1" | sudo tee /etc/modprobe.d/cpia.conf


I was able to use the camera using Cheese. From  Edit > Preferences I
selected the Webcam Device "CPiA Camera". It uses a maximum resolution
of 352x288 (I understand the QX5 can do 640x480).

The *IMPORTANT* thing to understand is that you must, for now, manually
control the top and bottom lights to see anything worthwhile.

These are accessed via the cpia module's control file in /proc/cpia/. In
this directory will be a device file for the video node. So, for
example, if the camera is listed as /dev/video2:

ls -l /proc/cpia/
total 0
-rw-r--r-- 1 tj root 3925 2010-04-19 23:14 video2

To view all the options:

cat /proc/cpia/video2
read-only
-----------------------
V4L Driver version:       1.2.3
CPIA Version:             1.33 (2.10)
CPIA PnP-ID:              0813:0001:0106
VP-Version:               1.0 0100
...
read-write
-----------------------  current       min       max   default  comment
...
toplight:                    off       off        on       off
bottomlight:                 off       off        on       off


Write values to this control file using echo. These will only take
effect on the camera when an application is using it. To switch on:

echo "toplight:on" | sudo tee /proc/cpia/video2

or

echo "bottomlight:on" | sudo tee /proc/cpia/video2

To switch off:

echo "toplight:off" | sudo tee /proc/cpia/video2

or

echo "bottomlight:off" | sudo tee /proc/cpia/video2





More information about the Nottingham mailing list