This guide walks you through setting up the XHC WHB04B wireless MPG pendant (USB ID: 10ce:eb93) to work with LinuxCNC on a Raspberry Pi running Debian Bookworm.
1. Overview
- Device: XHC WHB04B wireless USB MPG Pendant
- Interface: USB HID (not a serial device)
- Tested Environment: LinuxCNC 2.9.x on Raspberry Pi 5, Debian 12 Bookworm
2. Confirm USB Recognition
After plugging in the USB receiver:
lsusb
You should see:
Bus XXX Device XXX: ID 10ce:eb93 Silicon Labs
Check kernel messages:
dmesg | tail -n 20
Look for something like:
hid-generic 0003:10CE:EB93.xxxx: hidraw0: USB HID v1.10 Device [KTURT.LTD]
This confirms it's bound to hid-generic and available via /dev/hidrawX.
3. Set Udev Rules (Fix Permissions)
Create a udev rule file:
sudo nano /etc/udev/rules.d/99-xhc-whb04b.rules
Add this content:
{"ATTR{idVendor}==\"10ce\", ATTR{idProduct}==\"eb93\", MODE=\"0666\", GROUP=\"plugdev\""}
Then reload udev and replug the device:
sudo udevadm control --reload-rules
sudo udevadm trigger
4. Test the Device
Run the driver in test mode:
xhc-whb04b-6 -ue
You should see output when turning the MPG wheel or pressing buttons.
5. Configure LinuxCNC
In your HAL file (e.g. mymachine.hal):
loadusr -W xhc-whb04b-6 -H
In your INI file:
[HAL]
HALFILE = mymachine.hal
HALFILE = pendant.hal
Make sure halui is enabled if you want to bind jog or control buttons:
[HALUI]
HALUI = halui
6. Connect HAL Pins
Use halcmd show pin whb to view available pins. Example connections:
net jog-x-enable whb.axis.x.jog-enable => axis.0.jog-enable
net jog-x-counts whb.axis.x.jog-counts => axis.0.jog-counts
net start-button whb.button.start-pause => halui.program.run
7. Troubleshooting
- If it only works with
sudo, double-check your udev rule and group permissions. - Use
ls -l /dev/hidraw*to confirm device ownership/permissions. - If nothing appears in test mode, check for pairing issues or USB connection problems.
8. Notes
- This device will not appear under
/dev/inputor/dev/ttyUSB. - It uses a vendor-specific HID protocol accessed via
/dev/hidrawX. - Ensure the pendant is on before launching LinuxCNC.
- The
-uemode is helpful for diagnosing without full HAL integration.
Once configured, your WHB04B pendant will provide wireless jog control, DRO feedback, and access to common CNC functions inside LinuxCNC!
{/* Additional Troubleshooting and Configuration Information */}Troubleshooting the XHC WHB04B MPG Pendant on LinuxCNC
1. Required Driver or Kernel Module
Device Type: The WHB04B wireless pendant’s USB receiver is recognized as a USB Human Interface Device (HID). It uses the standard Linux USB HID drivers (the usbhid module with hid-generic) – no special proprietary driver is needed. In other words, the kernel handles it as a generic HID device by default. The device’s vendor is identified as “Silicon Labs” (Vendor ID 10ce) but it does not function as a USB-serial adapter.
Kernel Module: Ensure the HID drivers are available (most standard kernels, including those on Raspberry Pi’s Debian, have usbhid built-in). You can verify this by checking lsmod for usbhid/hid_generic or by reviewing dmesg messages when the receiver is plugged in.
2. Device Appearance: HID vs Input vs Serial
The pendant’s receiver is a custom HID device (with no keyboard/mouse subclass) and will not appear as a /dev/input/event* device. Instead, it is exposed via the raw HID interface (e.g. /dev/hidrawX). This is normal:
It presents as a HID interface (Class 3) with a vendor-specific protocol, so the system doesn’t treat it as a generic input device like a keyboard or joystick. Similarly, you will not see a /dev/ttyUSB* device.
3. LinuxCNC HAL Component Setup
LinuxCNC includes a dedicated HAL user-space driver for the pendant. For the 6-axis version, the component is called xhc-whb04b-6; for the 4-axis version, it’s xhc-whb04b-4. This HAL component communicates via libusb to read/write HID reports.
LinuxCNC Version: Use LinuxCNC 2.9 (or newer), which includes built-in support. Verify availability by running halcmd -k or which xhc-whb04b-6.
Configuration in HAL/INI: In your HAL file, load the component:
loadusr -W xhc-whb04b-6 -H
Then, in your INI file under the [HAL] section, reference your HAL file(s). Finally, map the HAL pins created by the driver to your machine control pins.
4. Verifying USB Device Recognition
To verify the device:
- Plug in the USB receiver and check
dmesgfor confirmation messages. - Run
lsusband look for the entry with ID 10ce:eb93. - List HID raw devices with
ls -l /dev/hidraw*and verify ownership viaudevadm.
5. Udev Rules and Permissions
Out of the box, access to /dev/hidraw* nodes may be restricted. If the LinuxCNC HAL component runs as a normal user, it might fail to open the device.
Solution: Create a udev rule (as shown earlier) setting MODE="0666" or group permissions, and reload udev.
6. Known Issues and Compatibility Notes
- Wireless "Lost Connection": Ensure the pendant is powered on and remains active. Idle periods may cause disconnections.
- Re-pairing: If pairing issues occur, use the manufacturer’s tools (if available) to re-sync the RF link.
- USB Power: Connect the receiver directly to the Pi or use a powered hub to avoid unstable connections.
- LinuxCNC Startup: If the pendant isn’t detected immediately at startup, ensure it’s on before launching LinuxCNC or use a wait option in the driver.
By following these steps – from verifying USB recognition, setting correct udev rules, and configuring your HAL component – you should be able to troubleshoot and achieve full functionality of your XHC WHB04B pendant.
Enjoy your now-portable and convenient machine control, and happy CNCing!
