01-09-2007 10:47 AM
01-09-2007 10:51 PM
01-10-2007 04:45 PM
01-10-2007 05:32 PM
Can you confirm that you are able to: disable all NI-VISA software (no NI modules loaded, no NI processes running in the background), power up the scope, connect to the scope with your software, and perform a write?
@SMesser wrote:
Good news & bad news today:
1) I finally got my writes to work consistently. Essentially, use the testing.py I posted before, but insert a self.handle.reset() right after the self.dev.open(), and remove the calls to detachKernelInterface() and setConfiguration(). Calling setConfiguration() seems to ruin the connection every time I call it, no matter the context. (I'm using the standard pyusb-0.3.5 here.)
I'm unable to continue work on this problem for the moment, but it looks like you might be getting there.
3) Errors don't always get flagged immediately. setConfiguration(), for example, changes some state so that subsequent calls are much more likely to generate errors. _Usually_ I can recover the happy-oscilloscope state with some combination of reset(), clearHalt(), resetEndpoint(), and releaseInterface() & claimInterface() calls.
Similar, but I still require PyVISA to do something which I couldn't identify or see on the USB monitor.
4) It doesn't seem to make a difference whether I import visa or not - except that sometimes both pyvisa and pyusb try to talk to the scope, and one locks the other out.
If I read your posts right, this is approximately your status as well...
That's the one that I get 20% of the time when it is working.
Tomorrow I plan to dive into the source for libusb to sort out my error messages. My most common error result is "usb.USBError: No error", which I find particularly frustrating and uninformative.
There are several free Windows versions, but since I'm running Windows XP in a vmware session on Ubuntu Linux I prefer to use a Linux based sniffer - usbmon.
What do you use for USB sniffing?
01-12-2007 02:25 PM
01-14-2007 06:09 PM
Can you post your Python test code for this?
I can confirm that I didn't need any of NI-VISA's components to access the scope using pyusb. I used both "lsmod | grep -i ni" and "ps -A | grep -i ni" to scan for NI stuff. I went on to uninstall NI-VISA and reboot.
I'm not suprised, their install scripts didn't really fill me with confidence either.
N.B.: The UNINSTALL script that comes with the Linux version of NI-VISA doesn't get it completely off the system; after reboot, several NI components were loaded, but UNINSTALL did not detect them when I ran it a second time. I used modprobe -r and kill to get rid of them, then deleted /usr/local/natinst to get rid of the files. After that, I had to go into /etc/init.d and its subdirectories to manually delete the dangling soft links pointing to the (deleted) /usr/local/natinst files.
Bug #2, usually manifests as a "could not reset: Is a directory" error: This looks like something low-level inside linux. As far as I can tell, what happens is that one of the boot processes or background daemons grabs the scope and doesn't let go of it. As a result, nothing else can access the scope. This problem seems to be more frequent without the NI-VISA package, although A) I had it occasionally with NI-VISA installed, and B) I don't always have it even with NI-VISA missing.Make sure your scope is set to "Rear USB Port Computer" and not "Auto" in menu "Utility" > "Options". Otherwise, I think, the USBHID driver grabs it.
I had a look at it, not bad, easier to read output than usbmon. You can enable it (as root) like so:
For usb sniffers, you might also look at the module usbcore, which has a boolean flag "usbfs_snoop." Set it to true, and it logs all usbfs traffic. I haven't tried it yet, partly because I'm not sure how to use it and partly because I'm a bit nervous about altering the files in /etc/init.d
01-15-2007 01:49 PM
01-15-2007 06:23 PM
01-16-2007 11:55 AM
01-16-2007 12:31 PM