Raspberry Pi U12 sporadic LIBUSB_ERROR_NO_DEVICE
Posted 28 February 2013 - 08:09 AM
Posted 28 February 2013 - 02:06 PM
Posted 28 February 2013 - 03:57 PM
Posted 01 March 2013 - 01:09 AM
Posted 01 March 2013 - 05:40 PM
Posted 05 March 2013 - 01:26 AM
Posted 05 March 2013 - 05:43 PM
If you are unsure about the your Raspberry Pi's power supply, consider the ones from the Raspberry Pi order pages. They will provide the proper current needed.
As for the problems I was experiencing, I am not sure how much I can attribute to power issues as opposed to HID issues considering my more power hungry setup of two U3s and a keyboard ran fine.
Posted 06 March 2013 - 01:05 AM
Posted 31 March 2014 - 09:16 AM
I am experiencing the same problem.
I can confirm that it is indeed not related to the PSU quality as the problem occurs even with a rock solid lab PSU and the current isn't actually that lumpy anyway. I have also tried the U12 directly in the Pi and in a powered Hub, no difference, still more flaky than a croissant in a wind tunnel.
I have tried to implement some try/except code in python to catch the problems but it doesn't work well at all, it's retrying continuously once it encounters a problem. Maybe it needs to close and re-open the connection? Not sure, you guys are the experts and I'm asking for some expert advice.
Can you suggest a simple Python try/except example that would solve it, I don't even mind if it caused occasional delays but the thing needs to run gracefully (which it doesn't at all currently).
By the way, I've noticed that it looks like the U12 itself is crashing. My other HID devices work flawlessly before, during and after the U12 crash. The U12 LED flashes its little head off when the crash happens so it appears as the microcontroller in the U12 is re-starting (possibly as a result of the alleged Raspi HID bug but possibly due to something else within the U12??).
Anyway, if you could come up with a teeny python try/except example that works well then I will buy more of these babies. Failing that, can you send me a U3 for free for my troubles?
Posted 31 March 2014 - 03:20 PM
Here's a quick, simple example that displays analog input readings in a loop and performs reading retries if any exception happens during the read. Use Ctrl-C to exit the loop:
import u12 #import time d=u12.U12() i = 0 while 1: #time.sleep(0.5) retries = 0 while 1: try: res = d.eAnalogIn(0) print res, ", retries:", retries break #Got our reading except Exception as e: retries+=1 if retries > 5: #Might be something other than a couple missing #communications, such as a U12 disconnect. #Displaying error and exiting in this example. print e exit(1)
I didn't run into issues with the U12 resetting, crashing or needing reopening, though I only did quick tests. If a reading retry was necessary, typically it took me 1-2 retries. Let us know if implementing a try/except scheme similar to above doesn't help, and provide your code here or by email so we can try to reproduce the problem as the U12 crashing is unexpected. Also, make sure you are using the latest LabJackPython on github.
If you plan on getting more LabJacks to use with the Raspberry Pi, I would recommend the U3-LV/HV over the U12 for USB communication stability reasons.
Posted 02 April 2014 - 08:53 AM
Hi Admin (sorry I don't know your name),
Thank you very much for the suggested code.
Sadly this has the same problem as my try/except code and attempts to retry over and over (until it hits 6 retries) as soon as a problem is encountered.
I've noticed that the problem is much worse if I try and set the output voltage in my loop rather than just reading the ADCs.
Here's my code (based on your example but with the added DAC command):
import u12, time
Posted 02 April 2014 - 03:09 PM
The current LabJack Support person handling your issue is David.
I ran your code and when connected directly to the Raspberry Pi it does look like it causes a reset on the U12 eventually. My guess is a communication problem causes this but I am unsure of why the reset is occurring.
On the other hand, when the U12 is connected to a USB hub, a communication error does not cause the U12 to reset and retry calls can be performed. I ran your code for more than 30 minutes with the hub before I stopped it. I do my tests on a hub, so I didn't see the resets in my original tests.
Try running your code with your U12 connected to a USB hub (it sounds like you have one), and see if the retries work. Also, the 6 tries my code performs is not a well tested number, so you can bump it up if you need to.
Posted 03 April 2014 - 01:56 AM
Hi David, thank you for your replies and assistance.
Yes, your code does run great when the U12 is connected through the hub. I've ran it for around an hour so far and no problems. No U12 crashes or LED flashing.
It's a shame it won't run happily without a hub as we planned to run these Raspberry Pis "headless" and only connected to power and the U12 for our array of test kit, keeping things to the bare minimum is a real attraction (no PCs, no keyboards, no monitors just the Raspi and U12). I suppose the addition of a powered hub isn't a problem, just not quite as nice!
I think we will go for U3's for our further requirements, I'll get in touch.
Thanks again for your support David.
All the best,
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users