PicoQuant GmbH HydraHarp 400 Software V. 3.0.0.1
8.4. Using the Software under Linux
The HydraHarp software can also be used under Linux (x86 platform only). This requires that Wine is installed
(see http://www.winehq.org). We have successfully tested with Wine 1.7.11. You can run the regular software
setup as explained in section 3.2. Instead of installing a device driver, running under Linux with Wine requires
that you have Libusb 0.1 or better the combination of Libusb 1.0 and Libusb-Compat installed (see
http://libusb.sourceforge.net/).
Libusb Access Permissions
For device access through libusb, your kernel needs support for the USB filesystem (usbfs) and that filesystem
must be mounted. This is done automatically, if /etc/fstab contains a line like this:
usbfs /proc/bus/usb usbfs defaults 0 0
This should routinely be the case if you installed any of the mainstream Linux distributions.
The permissions for the device files used by libusb must be adjusted for user access. Otherwise only root can
use the device(s). The device files are located in /proc/bus/usb/. Any manual change would not be
permanent, however. The permissions will be reset after reboot or replugging the device. The proper way of
setting the suitable permissions is by means of hotplugging scripts or udev. Which mechanism you can use
depends on the Linux distribution you have. Most recent distributions use udev.
Hotplug
For automated setting of the device file permissions with hotplug you have to add an entry to the hotplug
“usermaps”. These files are located in /etc/hotplug/. If the entire hotplug directory does not exist, you
probably don't have the hotplug package installed. This may be because your distribution is rather old (you may
still be able to install hotplug) or it is fairly recent and uses udev instead of hotplug (see section below).
Every line in the hotplug usermap files is for one device, the line starts with a name that will also be used for a
handler script. Since there are two HydraHarp 400 models (USB 2.0 and USB 3.0) the HydraHarp usermap file
has two lines as shown below. Line wraps are due to limited page width.
HydraHarp400 0x0003 0x0e0d 0x0004 0x0000 0x0000
0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
HydraHarp400 0x0003 0x0e0d 0x0009 0x0000 0x0000
0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
The handler script “HydraHarp400” gets started when the device is connected or disconnected. It looks like
this:
#!/bin/bash
if [ "${ACTION}" = "add" ] && [ -f "${DEVICE}" ]
then
chown root "${DEVICE}"
chgrp users "${DEVICE}"
chmod 666 "${DEVICE}"
fi
When the HydraHarp gets switched on or connected, the hotplug system will recognize it and will run the script,
which will then change the permissions on the device file associated with the device to 666, which means that
everybody can both read and write from/to this device. Note that this may be regarded as a security gap. If you
wish tighter access control you can create a dedicated group for HydraHarp users and give access only to that
group.
Both a usermap file HydraHarp400.usermap and the handler script HydraHarp400 are provided in the
folder Linux/hotplug on the distribution media. Copying both of them to /etc/hotplug/usb/ should be
sufficient to set up acces control via hotplugging for your HydraHarp.
Page 70