Two XEM devices under Linux


#1

Hi,

when I try to connect two XEM V2 under Linux I can only see one of the devices under FrontPanel. I have the impression that this is the device I plug in first.
The thing works perfectly under Windows, so it must be a Linux configuration error.
I followed the instruction in README.txt in the Linux distribution.

Thanks, Christian


#2

Hi Christian-

Using two XEMs from within FrontPanel is currently not supported on either platform.


#3

Hi Jake,

well I don’t really need the two devices under FrontPanel. I just thought it was a good starting point. What I really need is to use two devices with the FrontPanel API under Linux. Is that supported? I know that I have to give the ID for the e.g. xem->Open(1) call. That works in my case for the ID 0 xor 1 but not for both. I couldn’t figure out yet in which case which ID works.

Under Windows both devices appear in FrontPanel, so I thought it worked under Windows.

Cheers, Christian


#4

Yes, working with two XEMs at the same time under the API is fine. However, the “ID” passed to the Open() method is not a reliable way to find a XEM.

The best way to find unique XEMs is to use either the serial number or Device ID string. Since GetSerialNumber() is currently broken on the Linux beta API, you would be better off using the device ID string:

  1. Set the strings to something unique: “Board A” and “Board B” for example.
  2. Loop through the number of devices (GetDeviceCount()) and search for the device ID string you’re looking for.

Hope this helps!


#5

Hi,

my hotplug system does not really get two XEMs running at the same time. The question I have:

I don’t really need the hotplugging system, so I want to go without it. You give two scripts to the hotplug system:

  1. the one that changes permission on the device. What is the argument for that scripts, i.e. what is the device file for a USB node, say device number 3?
  2. The usermap: What is this and how do I manually apply it?

Thanks!

Cheers, Christian


#6

All that script does, really, is change the permissions on the device in /proc/bus/usb. You can do this manually, but there is no guaranteed mapping for a USB device to a /proc/bus/usb/ file. So, you have to do a bit of looking each time.

You won’t need the usermap file if you don’t use hotplug.


#7

Hi,

I made it work by changing the permissions ‘semi-manually’. I have a script which uses lsusb to get all the devices with vendor ID 0x151f and changes permission on those:

##########################

begin enableXEMs script

#!/bin/bash

DEVICES=/usr/sbin/lsusb -d 0x151f: | /bin/awk '{print $2 "/" $4;}' | /bin/awk -F: '{print $1;}'

for dev in $DEVICES; do
chmod 666 /proc/bus/usb/$dev
done

end enableXEMs script

##########################

Is the vendor ID 0x151f going to be used constantly for the XEM devices?

Cheers, Christian


#8

Yessir. The VID is assigned by the USB implementers forum to Opal Kelly Incorporated. Any Opal Kelly USB device will have that VID.

So, effectively, your script should work just fine. Do you know why the hotplug isn’t working for two devices? I’m not aware of any specific issues that hotplug would have with that kind of setup.


#9

Hi,

no I don’t know what the problem with hotplug is. It changed permission on one the nodes but not on the other, when I plug them both in within a few second. It seemed to work sometimes, when I waited longer in between (doesn’t sound like Linux).
The coldplug system would only change permission on one of the devices.
I am not an expert on those systems though, so maybe there is something I did wrong.

In your opalkelly script, I think you forgot a before the statement.

Cheers, Christian