XHC WHB04B development?

More
7 months 3 weeks ago #343977 by rodw
Replied by rodw on topic XHC WHB04B development?
In my case I had a deadman's switch that had to be held down to enable the jog wheel on the pendant so I set teleop mode when that button was pressed.  I don't think you should allow just jogging the wheel to change modes. There are some safety rules around this stuff. And yes having to switch modes to jog on screen or a pendant is frustrating but probably for safety.

Please Log in or Create an account to join the conversation.

More
7 months 3 weeks ago - 7 months 3 weeks ago #343979 by Hakan
Replied by Hakan on topic XHC WHB04B development?
You are right, rodw, and I don't particularly like it. But that's how it is.
That part can be taken out, for sure.

Some news. I think it is now narrowed down to debian 12 and probably gcc 12.2
Hannes, your question on trixie, I thought I was on trixie on my development pc, no I was on 12.13.
And suspicion about va_args.
So I upgraded to trixie and gcc 14.2.0.
Recompiled, and now it doesn't segv anymore.
It continues after a short break, like it should.
The problem is in libusb1.0 when compiled with gcc 12 (if I understand right).
 
Last edit: 7 months 3 weeks ago by Hakan.
The following user(s) said Thank You: rodw

Please Log in or Create an account to join the conversation.

More
7 months 3 weeks ago #343980 by Finngineering
rodw: I tend to agree that jogging should not be possible by accident. However, I would personally keep that kind of behavior change separate from the bugfixes in the PR. I just fear that changing behavior makes the PR more likely to be not be accepted. But I don't really know, and it's Hannes' PR after all.

Hakan: Great if you got rid of that libusb issue. Then unless somebody else experience the same issue, I think not much need to dig deeper.
The following user(s) said Thank You: rodw

Please Log in or Create an account to join the conversation.

More
7 months 3 weeks ago - 7 months 3 weeks ago #343982 by Hannes
Replied by Hannes on topic XHC WHB04B development?
That WHB component is somewhat a rabbit hole... I tried to do proper error handling, can you test it?
github.com/hdiethelm/linuxcnc-fork/tree/...fix-v2-errorhandling
The proper way of testing would be:
1. Get this version to fail reliably: github.com/hdiethelm/linuxcnc-fork/tree/xhc-whb04b-6-fix-v2
2. Now test this version: github.com/hdiethelm/linuxcnc-fork/tree/...fix-v2-errorhandling
Otherwise, you can never be sure the change made any difference. I now that is often not that easy.

Looking at the code, just removing the assert() probably can result in segfaults in libusb as long as the error is not handled properly.

Note that even with my changes, it is not really how you would do it in a nice way but it should work I think. I am not able to reproduce your issue, so I can just guess and try to do better error handling.

@rodw: Jogging in manual mode is fine. My machine can not jog in teleop mode due to I have two Y axis servo motors. The only thing the WHB component does after my PR is:
- Change to teleop mode if not homed (which fails on my machine but on others, it will do that) -> You can jog before homing any special action
- Change to manual mode if homed AND program is idle -> You can jog after homing without any special action
Last edit: 7 months 3 weeks ago by Hannes.

Please Log in or Create an account to join the conversation.

More
7 months 3 weeks ago #343984 by Hannes
Replied by Hannes on topic XHC WHB04B development?
I found an other issue while trying to test the error handling. Please wait with testing.

Please Log in or Create an account to join the conversation.

More
7 months 3 weeks ago - 7 months 3 weeks ago #343987 by Hannes
Replied by Hannes on topic XHC WHB04B development?
So, it should be solved. Ready for testing.
In the case libusb_submit_transfer() returned an error and you remove the assert, the whole xhc-whb04b-6 module would just do nothing any more. I think that's what you observed.
I tested it by pretending an error happens, so not 100% what you have:
Code:
int r; static int i; i++; if(i==30){   r=-1;   i=0; }else{   r = libusb_submit_transfer(inTransfer); }
Last edit: 7 months 3 weeks ago by Hannes.

Please Log in or Create an account to join the conversation.

Time to create page: 0.336 seconds
Powered by Kunena Forum