Closed anantapalani closed 3 years ago
Ananta,
I'm not familiar with your CLD101LP, but I can imagine that you first should send a query to the device, e.g. echo "*idn?" > /dev/usbtmc0 before you can read a response with cat /dev/usbtmc0. Please look at the example code ttmc.c how you can send/receive messages to a T&M instrument.
Guido
Guido,
I had tried sending data before, the error is basically the same:
[ 1934.930920] usbtmc 1-8:1.0: Unable to send data, error -110
My understanding was the /dev/usbtmc0
was for controlling the driver and that a usbtmc1
device should have been created for talking with the device?
-Ananta
Ananta,
Previous driver versions of Agilent driver were using /dev/usbtmc0 to control the driver. The current Linux driver starts enumeration with 0 and controls your device with /dev/usbtmc0.
Guido
Guido,
Thanks for the info. However, the problem still remains that I cannot write or read to the device using the kernel module, but using pyVISA-py pure python driver with libusb I can. Is there nothing else that can be done to debug the timeout?
-Ananta
Ananta,
After using libusb the usbtmc driver is disabled. You need to reconnect your USB cable to activate the usbtmc driver again. Maybe you want to try my current driver https://github.com/GuidoKiener/linux-usbtmc, then I could better help you.
A udev rule like KERNEL=="usbtmc[0-9]", MODE="0666", GROUP="users" e.g. in /etc/udev/rules.d/50-myrules.rules
helps to to get the I/O access for users. Maybe your device needs a reboot after a lot of experiments, since it is already in an error state.
Regards,
Guido
Guido,
Apologies, using ttmc.c I am able to query *IDN?
and get a response. However, after running ttmc
one to three times, the device starts timing out and i get 'failed to read from scope: Connection timed out' errors from ttmc
. Unplugging/replugging the USB cable is sufficient to get ttmc to work again, so I don't think the device is entering an error state.
-Ananta
Ananta,
Hmm, this is not a very stable connection. Well, on Ubuntu 16.04 there are problems within the USB stack. Which Linux kernel (and distribution) do you use? Of course I'm interested to make a stable usbtmc driver for Linux, but can you also test your device with Windows and a VISA from known vendors?
-Guido
Guido,
We're using Kubuntu 17.04 with kernel 4.10.0-42-generic. We've tested the device under Windows using NI-VISA and the connection is very stable. I was mistaken about the one to three times sequentially running ttmc. I've re-tested throughly, and after a single run of ttmc, every following call to ttmc times out. I've stripped down ttmc.c to only:
so there is not much to go wrong. I have the udev rule in place as you suggested.
-Ananta
Ananta,
Ok, the newer kernel should work and I'm curious about the problem you have with this device. If you like we can track down the problem the next days.
Please try my driver and use the test-raw.c (make test-raw) executable and send me the output and dmesg output for analysis. Please use the direct mail address usbtmc@kiener-muenchen.de for this troubleshooting.
-Guido
Guido,
Thank you for your help. I've e-mailed the files.
-Ananta
We have a Thorlabs CLD1010LP laser driver that we want to control over USB. We are able to do so with pyVISA and the pyVISA-py pure python driver (uses pyUSB backed by libusb). However, with the linux usbtmc kernel driver we are getting timeouts. Here is the dmesg log immediately after plugging in the device:
And the log after trying to
cat /dev/usbtmc0
:Do you have any idea where this timeout is occurring or how we can further debug this?
Thanks!