Here are the steps I follow to reproduce the issue:
- Download and install linuxcnc on debian as a package in the standard way
- Start linuxcnc and use the xhc-whb04b-6. After a random time, hours perhaps, it stops responding
- I don't have the error message here but I have searched and found that this is the line that triggers the xhc-whb04b-6 module to exit:
assert(0 == r);
line 460 in https://github.com/LinuxCNC/linuxcnc/blob/master/src/hal/user_comps/xhc-whb04b-6/usb.cc
in the function
bool Usb::setupAsyncTransfer()
This is what I expected to happen:
If it was unable to setup async usb transfer, it should do some retrying or so.
This is what happened instead:
The hal module stops. It isn't possible to unload or in any way repair this (afaik).
It worked properly before this:
(If the behavior changed after making a particular change in hardware or
software, describe the change you think is responsible. E.g., "after upgrading
from LinuxCNC 2.7.3 to 2.7.4")
I got a new xhc whb04b-4 the other day, so I have always had this problem with the new pendant.
Information about my hardware and software:
I am running 2.8 from apt archive.
I have also downloaded the developer source code and searched files and recompiled.
The issue is in both those versions.
The solution is simple. Disarm the assert() function with the NDEBUG directive.
Because when this is done, the code does the right thing. It tries to reconnect and re-establish
functionality.
I have gotten an error in setupasynctransfer, the code handles this fine, and re-established functionality.
I am now running a version with NDEBUG and, yes this is how it should be.