Bug : frequent LJME_RECONNECT_FAILED in python with usb 3 enabled | LabJack
 
Friday May 29th 2020
Support: LabJack engineers available through email and chat.
Shipping: We are processing and shipping all orders.
Stock: 51 of 56 products are in stock. More details.
Supply Chain: Minor impacts. More details.

Bug : frequent LJME_RECONNECT_FAILED in python with usb 3 enabled

8 posts / 0 new
Last post
francoisbiar
francoisbiar's picture
Bug : frequent LJME_RECONNECT_FAILED in python with usb 3 enabled

Hello, it's me again,

I'm not sure if this is the right forum to post this, but I think this bug might be caused by the usb 3 implementation in linux. I use Ubuntu 16.04, and I communicate with my LabJack T7 in Python.

At first I noticed that I sometimes have the LJME_RECONNECT_FAILED error when attempting to open a labjack with ljm.openS('ANY', 'ANY', 'ANY'). If I try again and again, it ends up working, then I can use my labjack. Strange thing is, if I disable the usb 3 (xhci) in my bios settings, I completely get rid of this error.

Find attached the .py file I used to do my testings, and the summary of my tests : they simply show that I no longer have errors when usb 3 is disabled.

Can you confirm this error only occurs with Linux, I only tried ubuntu's (16.04 and 14.04) with different kernel versions (4.4 and 3.16), do you have others ideas that I could investigate to find the culprit.

Thanks in advance

Francois

File Attachment: 
LabJack Support
LabJack Support's picture
Hi Francois. Thanks for

Hi Francois. Thanks for reporting this. We weren't able to reproduce the error yet. Here's a few things you could try:

  • Make sure you have the latest system updates with apt-get
  • Try a different USB 3 port (sounds like you probably already did this between trying both 16.04 and 14.04 if they're on different machines)
  • Try disconnecting all USB devices except for the given LabJack, and disconnect everything from that except for the USB cable

Some questions:

  • How often (approximately) does the LJME_RECONNECT_FAILED error happen during openS? Every other time? Every 100th time?
  • Does `dmesg` give any useful output when LJME_RECONNECT_FAILED happens?
francoisbiar
francoisbiar's picture
I've done all of the above

I've done all of the above you suggested, that didn't solved the problem. I also tried plugging the labjack into an usb 2.0 powered hub, without result.

I get the LJME_RECONNECT_FAILED nearly half of the time, so I'm surprised you couldn't reproduce the error.

Find attached a sample of dmesg command when I execute my python script (first message) : every time a LJME_RECONNECT_FAILED occurs, it seems that the labjack device is disconnected, then re-connected again

File Attachment: 
LabJack Support
LabJack Support's picture
We're looking into this. We

We're looking into this. We'll update this thread as we go.

LabJack Support
LabJack Support's picture
I've fixed the LJME_RECONNECT

I've fixed the LJME_RECONNECT_FAILED error. The fix will be available in the next version of LJM after 1.1404, and I will update this thread when that LJM version is released. However, the problem is not completely solved: instead of failing with LJME_RECONNECT_FAILED, there is a delay (~2.5 seconds with the default send/receive timeout) when the problem occurs.

To mitigate the problem detailed in francoisbiar's original post:

  • Upgrade to the version of LJM after 1.1404 (I'll update this post to reflect the correct version when it's release).
  • Avoid opening and closing the device. For example, if I change francoisbiar's above example to open before the loop starts and close after it ends, there is no issue (no delay or LJME_RECONNECT_FAILED).
  • Use an Ethernet or WiFi connection
  • Disable xhci as francoisbiar mentions. LabJacks has not verified this as of this writing.
francoisbiar
francoisbiar's picture
Thanks for your outstanding

Thanks for your outstanding reactivity (for this, and the other posts I made). I'm looking forward to the next update.

LabJack Support
LabJack Support's picture
The mitigation mentioned

The mitigation mentioned above is in LJM 1.1405, now available here:

https://labjack.com/support/software/installers/ljm

francoisbiar
francoisbiar's picture
Hello,

Hello,

I installed the beta version (2017-01-31), and it looks like what you've done completely fixed the problem. I never had any LJME_RECONNECT_FAILED so far with this version (tested with 3 PC's).

Thanks again