Getting a WHB04B-4 working.
- photomankc
- Offline
- Premium Member
- Posts: 96
- Thank you received: 4
I found documentation on the xhc-whb04b-6xhc-whb04b-6 component but the example file in there seems to do nothing for me. After adding it to the [HAL] section of my machine ini, I had to comment each and every single line in the file as it bombed out with errors that there was no such pin. With everything commented out but the loadrt statement I got past the crashes but then I see why it complains. Looking at HAL configuration there are none of the pins mentioned in the sample config for whb.*
So, is there any concise set of instructions to get this sucker working? I've got a stripped out config that works with keyboard and mouse but I really would like to get my pendant back to working. Right now I'd be happy to just see some X/Y/Z coordinates so that I know communication is occurring and I can probably work it out from there.
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
- Posts: 19188
- Thank you received: 6433
So if you get "access denied" in the error messages, search for arduino access denied, the user needs to be added to dialout group.
here you have everything available inside the linuxcnc.org site:
www.google.com/search?source=hp&ei=QDP6X...SRCLkQ4dUDCAY&uact=5
Please Log in or Create an account to join the conversation.
- photomankc
- Offline
- Premium Member
- Posts: 96
- Thank you received: 4
So when looking at that linked page I posted page I interpreted this as the what I needed to do:
Add sample HAL file shown to the configuration directory named as "xhc-whb04b.hal"
Add that file into my mills PM25-MV.ini as an additional HAL file to load:
[HAL]
HALFILE = PM-25MV.hal
HALUI = halui
HALFILE = xhc-whb04b.hal
POSTGUI_HALFILE = custom_postgui.hal
At first it just complained of missing pins on each uncommented line. Then once all lines other than the loadrt were commented out, LinuxCNC would start and bring up Axis but when I looked at HAL configuration from the menu there is no top level whb device and so there can't be any whb,* pins. It seems the load is not working but there is no error message about it.
ETA: Tried loading it on cmdline with halrun, at first just silence but then I added the command "sudo udevadm trigger" and see this:
$ halrun
halcmd: loadusr -W xhc-whb04b-6 -H
failed to claim interface
halcmd: exit
Note: Using POSIX realtime
Please Log in or Create an account to join the conversation.
- photomankc
- Offline
- Premium Member
- Posts: 96
- Thank you received: 4
First check the folder "/etc/udev/rules.d/" is there the files 90-smoothie.rules ?
you can also try sudo nano /etc/udev/rules.d/90-smoothie.rules for check if the files is ok.
I do not have any such file in my directory...
/etc/udev/rules.d$ ls -la
total 8
drwxr-xr-x 2 root root 4096 Jun 13 2018 .
drwxr-xr-x 4 root root 4096 Jun 28 13:54 ..
This was installed via apt-get and the buildbot URIs.
dmesg text when it's inserted:
[90617.632041] usb 7-1: new full-speed USB device number 3 using uhci_hcd
[90617.797072] usb 7-1: New USB device found, idVendor=10ce, idProduct=eb93
[90617.797075] usb 7-1: New USB device strings: Mfr=1, Product=0, SerialNumber=0
[90617.797078] usb 7-1: Manufacturer: KTURT.LTD
[90617.805277] hid-generic 0003:10CE:EB93.0009: hiddev0,hidraw0: USB HID v1.10 Device [KTURT.LTD] on usb-0000:00:1d.2-1/input0
Please Log in or Create an account to join the conversation.
I think something is broken in the 2.8 but i have successfully used 2.9 some time ago.
you need to have a file inside rules.d folder called "99-xhc-whb04b-6.rules" if this file is missing you need to create one !:
sudo nano /etc/udev/rules.d/99-xhc-whb04b-6.rules
# xhc-whb04b-6 mpg pendant
ATTR{idProduct}=="eb93", ATTR{idVendor}=="10ce", MODE="666", OWNER="root", GROUP="plugdev"
You need to reboot computer or
If you add confs to the udev you need to run:
udevadm control -R
to reload the confs and database.
Secondly
open a terminal without starting linuxcnc and type :
halrun
loadusr -W xhc-whb04b-6 -Hsf
and open a second terminal and type :
watch -n0.4 halcmd show pin whb.
If the device and driver work you can see several entry in the second terminal.
ps : you can try reread my post from this link
forum.linuxcnc.org/38-general-linuxcnc-q...king?start=90#164533
Please Log in or Create an account to join the conversation.
- photomankc
- Offline
- Premium Member
- Posts: 96
- Thank you received: 4
The xhc−whb04b−6 executable needs permission for reading the pendant’s USB device. There may be the need for additional udev rules. If so, this file /etc/udev/rules.d/99−xhc−whb04b−6.rules should be created with the single line ATTR{idProduct}=="eb93", ATTR{idVendor}=="10ce", MODE="0666", OWNER="root", GROUP="plugdev".
So based on the fact that I was missing the rules file mentioned in the earlier post and that snip of text I gathered I needed to create it. I did change the group from "plugdev" to "dialout" following the pattern of the other devices but not sure that makes a difference. I tried again and no joy. But I decided to give it a reboot in case something had not picked up on the rules or the device file lingered after unplugging somehow.
After the reboot there was rejoicing:
~$ halrun
halcmd: loadusr -W xhc-whb04b-6 -H
halcmd: show pin
Component Pins:
Owner Type Dir Value Name
4 s32 OUT 0 whb.axis.a.jog-counts
4 bit OUT FALSE whb.axis.a.jog-enable
4 float OUT 0 whb.axis.a.jog-scale
4 bit OUT FALSE whb.axis.a.jog-vel-mode
4 s32 OUT 0 whb.axis.b.jog-counts
4 bit OUT FALSE whb.axis.b.jog-enable
4 float OUT 0 whb.axis.b.jog-scale
4 bit OUT FALSE whb.axis.b.jog-vel-mode
4 s32 OUT 0 whb.axis.c.jog-counts
4 bit OUT FALSE whb.axis.c.jog-enable
4 float OUT 0 whb.axis.c.jog-scale
4 bit OUT FALSE whb.axis.c.jog-vel-mode
4 s32 OUT 0 whb.axis.x.jog-counts
4 bit OUT TRUE whb.axis.x.jog-enable
4 float OUT 0 whb.axis.x.jog-scale
4 bit OUT FALSE whb.axis.x.jog-vel-mode
4 s32 OUT 0 whb.axis.y.jog-counts
4 bit OUT FALSE whb.axis.y.jog-enable
4 float OUT 0 whb.axis.y.jog-scale
4 bit OUT FALSE whb.axis.y.jog-vel-mode
4 s32 OUT 0 whb.axis.z.jog-counts
4 bit OUT FALSE whb.axis.z.jog-enable
4 float OUT 0 whb.axis.z.jog-scale
4 bit OUT FALSE whb.axis.z.jog-vel-mode
4 bit OUT FALSE whb.button.feed-minus
4 bit OUT FALSE whb.button.feed-plus
... snip ...
4 float IN 0 whb.halui.spindle-speed-cmd
4 bit OUT FALSE whb.halui.spindle.decrease
4 bit OUT FALSE whb.halui.spindle.forward
4 bit OUT FALSE whb.halui.spindle.increase
4 bit IN FALSE whb.halui.spindle.is-on
4 bit OUT FALSE whb.halui.spindle.reverse
4 bit OUT FALSE whb.halui.spindle.start
4 bit OUT FALSE whb.halui.spindle.stop
4 bit OUT TRUE whb.pendant.is-connected
4 bit OUT FALSE whb.pendant.is-sleeping
And then testing to see if I was getting data from the device:
~$ /usr/bin/xhc-whb04b-6 -e
pndnt failed to interpret axis code feed axisCode={?}
pndnt axis inactive event axis={code=0x00 text='' altText=''} axisButton={{{key={code=0x11 text='X' altText=''}}} isPermitted=TRUE}
pndnt axis active event axis={code=0x11 text='X' altText=''} axisButton={{{key={code=0x11 text='X' altText=''}}} isPermitted=TRUE}
pndnt wheel total counts {counts=0 activeCounter=0 isLeadActive=0}
pndnt failed to interpret axis code feed axisCode={?}
pndnt button pressed event metaButton={key={code=0x0e text='mode-continuous' altText='macro-15'} modifier={code=0x00 text='' altText=''}}
pndnt wheel total counts {counts=0 activeCounter=0 isLeadActive=0}
pndnt failed to interpret axis code feed axisCode={?}
pndnt button released event metaButton={key={code=0x0e text='mode-continuous' altText='macro-15'} modifier={code=0x00 text='' altText=''}}
pndnt wheel total counts {counts=0 activeCounter=0 isLeadActive=0}
pndnt failed to interpret axis code feed axisCode={?}
pndnt button pressed event metaButton={key={code=0x0f text='mode-step' altText='macro-16'} modifier={code=0x00 text='' altText=''}}
pndnt wheel total counts {counts=0 activeCounter=0 isLeadActive=0}
pndnt failed to interpret axis code feed axisCode={?}
pndnt button released event metaButton={key={code=0x0f text='mode-step' altText='macro-16'} modifier={code=0x00 text='' altText=''}}
pndnt wheel total counts {counts=0 activeCounter=0 isLeadActive=0}
pndnt failed to interpret axis code feed axisCode={?}
pndnt button pressed event metaButton={key={code=0x0e text='mode-continuous' altText='macro-15'} modifier={code=0x00 text='' altText=''}}
pndnt wheel total counts {counts=0 activeCounter=0 isLeadActive=0}
pndnt failed to interpret axis code feed axisCode={?}
pndnt button released event metaButton={key={code=0x0e text='mode-continuous' altText='macro-15'} modifier={code=0x00 text='' altText=''}}
pndnt wheel total counts {counts=0 activeCounter=0 isLeadActive=0}
pndnt failed to interpret axis code feed axisCode={?}
pndnt button pressed event metaButton={key={code=0x01 text='reset' altText='macro-11'} modifier={code=0x00 text='' altText=''}}
pndnt wheel total counts {counts=0 activeCounter=0 isLeadActive=0}
pndnt failed to interpret axis code feed axisCode={?}
pndnt button released event metaButton={key={code=0x01 text='reset' altText='macro-11'} modifier={code=0x00 text='' altText=''}}
pndnt wheel total counts {counts=0 activeCounter=0 isLeadActive=0}
pndnt failed to interpret axis code feed axisCode={?}
pndnt button pressed event metaButton={key={code=0x01 text='reset' altText='macro-11'} modifier={code=0x00 text='' altText=''}}
pndnt wheel total counts {counts=0 activeCounter=0 isLeadActive=0}
pndnt failed to interpret axis code feed axisCode={?}
pndnt button released event metaButton={key={code=0x01 text='reset' altText='macro-11'} modifier={code=0x00 text='' altText=''}}
pndnt wheel total counts {counts=0 activeCounter=0 isLeadActive=0}
pndnt failed to interpret axis code feed axisCode={?}
pndnt button pressed event metaButton={key={code=0x01 text='reset' altText='macro-11'} modifier={code=0x00 text='' altText=''}}
pndnt wheel total counts {counts=0 activeCounter=0 isLeadActive=0}
pndnt failed to interpret axis code feed axisCode={?}
pndnt button released event metaButton={key={code=0x01 text='reset' altText='macro-11'} modifier={code=0x00 text='' altText=''}}
pndnt wheel total counts {counts=0 activeCounter=0 isLeadActive=0}
pndnt failed to interpret axis code feed axisCode={?}
pndnt button pressed event metaButton={key={code=0x01 text='reset' altText='macro-11'} modifier={code=0x00 text='' altText=''}}
pndnt wheel total counts {counts=0 activeCounter=0 isLeadActive=0}
pndnt failed to interpret axis code feed axisCode={?}
pndnt button released event metaButton={key={code=0x01 text='reset' altText='macro-11'} modifier={code=0x00 text='' altText=''}}
pndnt wheel total counts {counts=0 activeCounter=0 isLeadActive=0}
pndnt failed to interpret axis code feed axisCode={?}
pndnt button pressed event metaButton={key={code=0x01 text='reset' altText='macro-11'} modifier={code=0x00 text='' altText=''}}
pndnt wheel total counts {counts=0 activeCounter=0 isLeadActive=0}
pndnt failed to interpret axis code feed axisCode={?}
pndnt button released event metaButton={key={code=0x01 text='reset' altText='macro-11'} modifier={code=0x00 text='' altText=''}}
pndnt wheel total counts {counts=0 activeCounter=0 isLeadActive=0}
pndnt failed to interpret axis code feed axisCode={?}
pndnt button pressed event metaButton={key={code=0x0c text='fn' altText='<unused>'} modifier={code=0x00 text='' altText=''}}
pndnt wheel total counts {counts=0 activeCounter=0 isLeadActive=0}
pndnt failed to interpret axis code feed axisCode={?}
pndnt button released event metaButton={key={code=0x0c text='fn' altText='<unused>'} modifier={code=0x00 text='' altText=''}}
pndnt button pressed event metaButton={key={code=0x01 text='reset' altText='macro-11'} modifier={code=0x0c text='fn' altText='<unused>'}}
pndnt wheel total counts {counts=0 activeCounter=0 isLeadActive=0}
pndnt failed to interpret axis code feed axisCode={?}
pndnt button released event metaButton={key={code=0x01 text='reset' altText='macro-11'} modifier={code=0x0c text='fn' altText='<unused>'}}
pndnt button pressed event metaButton={key={code=0x0c text='fn' altText='<unused>'} modifier={code=0x00 text='' altText=''}}
pndnt wheel total counts {counts=0 activeCounter=0 isLeadActive=0}
pndnt failed to interpret axis code feed axisCode={?}
pndnt button released event metaButton={key={code=0x0c text='fn' altText='<unused>'} modifier={code=0x00 text='' altText=''}}
pndnt wheel total counts {counts=0 activeCounter=0 isLeadActive=0}
pndnt failed to interpret axis code feed axisCode={?}
pndnt axis inactive event axis={code=0x11 text='X' altText=''} axisButton={{{key={code=0x12 text='Y' altText=''}}} isPermitted=TRUE}
pndnt axis active event axis={code=0x12 text='Y' altText=''} axisButton={{{key={code=0x12 text='Y' altText=''}}} isPermitted=TRUE}
pndnt wheel total counts {counts=0 activeCounter=1 isLeadActive=0}
pndnt failed to interpret axis code feed axisCode={?}
pndnt axis inactive event axis={code=0x12 text='Y' altText=''} axisButton={{{key={code=0x13 text='Z' altText=''}}} isPermitted=TRUE}
pndnt axis active event axis={code=0x13 text='Z' altText=''} axisButton={{{key={code=0x13 text='Z' altText=''}}} isPermitted=TRUE}
pndnt wheel total counts {counts=0 activeCounter=2 isLeadActive=0}
pndnt failed to interpret axis code feed axisCode={?}
pndnt axis inactive event axis={code=0x13 text='Z' altText=''} axisButton={{{key={code=0x14 text='A' altText=''}}} isPermitted=TRUE}
pndnt axis active event axis={code=0x14 text='A' altText=''} axisButton={{{key={code=0x14 text='A' altText=''}}} isPermitted=TRUE}
pndnt wheel total counts {counts=0 activeCounter=3 isLeadActive=0}
pndnt failed to interpret axis code feed axisCode={?}
pndnt axis inactive event axis={code=0x14 text='A' altText=''} axisButton={{{key={code=0x13 text='Z' altText=''}}} isPermitted=TRUE}
pndnt axis active event axis={code=0x13 text='Z' altText=''} axisButton={{{key={code=0x13 text='Z' altText=''}}} isPermitted=TRUE}
pndnt wheel total counts {counts=0 activeCounter=2 isLeadActive=0}
pndnt failed to interpret axis code feed axisCode={?}
pndnt axis inactive event axis={code=0x13 text='Z' altText=''} axisButton={{{key={code=0x12 text='Y' altText=''}}} isPermitted=TRUE}
pndnt axis active event axis={code=0x12 text='Y' altText=''} axisButton={{{key={code=0x12 text='Y' altText=''}}} isPermitted=TRUE}
pndnt wheel total counts {counts=0 activeCounter=1 isLeadActive=0}
pndnt failed to interpret axis code feed axisCode={?}
pndnt axis inactive event axis={code=0x12 text='Y' altText=''} axisButton={{{key={code=0x11 text='X' altText=''}}} isPermitted=TRUE}
pndnt axis active event axis={code=0x11 text='X' altText=''} axisButton={{{key={code=0x11 text='X' altText=''}}} isPermitted=TRUE}
pndnt wheel total counts {counts=0 activeCounter=0 isLeadActive=0}
pndnt failed to interpret axis code feed axisCode={?}
pndnt axis inactive event axis={code=0x11 text='X' altText=''} axisButton={{{key={code=0x06 text='OFF' altText=''}}} isPermitted=FALSE}
pndnt axis active event axis={code=0x06 text='OFF' altText=''} axisButton={{{key={code=0x06 text='OFF' altText=''}}} isPermitted=FALSE}
pndnt wheel total counts {counts=NA activeCounter=UNDEFINED isLeadActive=0}
pndnt failed to interpret axis code feed axisCode={?}
pndnt axis inactive event axis={code=0x06 text='OFF' altText=''} axisButton={{{key={code=0x11 text='X' altText=''}}} isPermitted=TRUE}
pndnt axis active event axis={code=0x11 text='X' altText=''} axisButton={{{key={code=0x11 text='X' altText=''}}} isPermitted=TRUE}
pndnt wheel total counts {counts=0 activeCounter=0 isLeadActive=0}
pndnt feed inactive event feed={code=0x00 text='' altText=''} feedButton={{{key={code=0x1b text='10' altText='100%'}}} isPermitted=TRUE stepSize=100 stepMode=0x00}
pndnt feed active event feed={code=0x1b text='10' altText='100%'} feedButton={{{key={code=0x1b text='10' altText='100%'}}} isPermitted=TRUE stepSize=100 stepMode=0x00}
pndnt wheel total counts {counts=0 activeCounter=0 isLeadActive=0}
pndnt feed inactive event feed={code=0x1b text='10' altText='100%'} feedButton={{{key={code=0x1a text='5' altText='60%'}}} isPermitted=TRUE stepSize=60 stepMode=0x00}
pndnt feed active event feed={code=0x1a text='5' altText='60%'} feedButton={{{key={code=0x1a text='5' altText='60%'}}} isPermitted=TRUE stepSize=60 stepMode=0x00}
pndnt wheel total counts {counts=0 activeCounter=0 isLeadActive=0}
pndnt feed inactive event feed={code=0x1a text='5' altText='60%'} feedButton={{{key={code=0x10 text='1' altText='30%'}}} isPermitted=TRUE stepSize=30 stepMode=0x00}
pndnt feed active event feed={code=0x10 text='1' altText='30%'} feedButton={{{key={code=0x10 text='1' altText='30%'}}} isPermitted=TRUE stepSize=30 stepMode=0x00}
pndnt wheel total counts {counts=0 activeCounter=0 isLeadActive=0}
pndnt feed inactive event feed={code=0x10 text='1' altText='30%'} feedButton={{{key={code=0x0f text='0.1' altText='10%'}}} isPermitted=TRUE stepSize=10 stepMode=0x00}
pndnt feed active event feed={code=0x0f text='0.1' altText='10%'} feedButton={{{key={code=0x0f text='0.1' altText='10%'}}} isPermitted=TRUE stepSize=10 stepMode=0x00}
pndnt wheel total counts {counts=0 activeCounter=0 isLeadActive=0}
pndnt feed inactive event feed={code=0x0f text='0.1' altText='10%'} feedButton={{{key={code=0x0e text='0.01' altText='5%'}}} isPermitted=TRUE stepSize=5 stepMode=0x00}
pndnt feed active event feed={code=0x0e text='0.01' altText='5%'} feedButton={{{key={code=0x0e text='0.01' altText='5%'}}} isPermitted=TRUE stepSize=5 stepMode=0x00}
pndnt wheel total counts {counts=0 activeCounter=0 isLeadActive=0}
pndnt feed inactive event feed={code=0x0e text='0.01' altText='5%'} feedButton={{{key={code=0x0d text='0.001' altText='2%'}}} isPermitted=TRUE stepSize=2 stepMode=0x00}
pndnt feed active event feed={code=0x0d text='0.001' altText='2%'} feedButton={{{key={code=0x0d text='0.001' altText='2%'}}} isPermitted=TRUE stepSize=2 stepMode=0x00}
pndnt wheel total counts {counts=0 activeCounter=0 isLeadActive=0}
So, tommylight was right about permissions it just was not immediately obvious that the device file was not going to have the right permissions. In fact, I'm completely lost as to where that device file even really is. But this is good. I think I can get on with loading it and connecting it up now!
Please Log in or Create an account to join the conversation.
- photomankc
- Offline
- Premium Member
- Posts: 96
- Thank you received: 4
Nope, not working. Will not load the module in the live config. No errors, not messages, no 'whb' pins in hal so nothing in that hal file can possibly work.
This is wearing me down.
Please Log in or Create an account to join the conversation.
- photomankc
- Offline
- Premium Member
- Posts: 96
- Thank you received: 4
Best guess is that there is some non-printing character in there that's messing things up.
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
- Posts: 19188
- Thank you received: 6433
Notepad or Notepad++ for windows.
No word processors.
Please Log in or Create an account to join the conversation.
if not exist create rule file with this exact things and reboot after saving
sudo nano /etc/udev/rules.d99-xhc-whb04b-6.rules
# xhc-whb04b-6 mpg pendant
ATTR{idProduct}=="eb93", ATTR{idVendor}=="10ce", MODE="666", OWNER="root", GROUP="plugdev"
So basically you only need to download this file : (untested wget command...)
cd your_config_directory
wget -O xhc-whb04b-6.hal https://github.com/LinuxCNC/linuxcnc/raw/master/src/hal/user_comps/xhc-whb04b-6/example-configuration.md
Edit your "know as working config.ini"
nano your_config.ini
for adding
[HALUI]
MDI_COMMAND=(debug,macro0)
MDI_COMMAND=(debug,macro1)
MDI_COMMAND=(debug,macro2)
MDI_COMMAND=(debug,macro3)
MDI_COMMAND=(debug,macro4)
MDI_COMMAND=(debug,macro4)
MDI_COMMAND=(debug,macro6)
MDI_COMMAND=(debug,macro4)
MDI_COMMAND=(debug,macro8)
MDI_COMMAND=(debug,macro9)
MDI_COMMAND=(debug,macro10)
MDI_COMMAND=(debug,macro11)
MDI_COMMAND=(debug,macro12)
MDI_COMMAND=(debug,macro13)
MDI_COMMAND=(debug,macro14)
MDI_COMMAND=(debug,macro15)
MDI_COMMAND=(debug,macro16)
and add to HAL section (i think before POSTGUI_HALFILE)
HALFILE = xhc-whb04b-6.hal
thats all ! (i hope )
Please Log in or Create an account to join the conversation.