XHC-WHB04B-6 LinuxCNC not working

More
12 Oct 2019 07:42 #147727 by pl7i92
it workes great here under stetch 2.9 latest build
you need to be in dialout group to get the access n mashine load

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

More
12 Oct 2019 15:03 #147738 by satiowadahc
Oh yea add a file to /etc/udev/rules.d/99-xhc.rules

SUBSYSTEM=="usb",ATTR{idProduct=="EB93"},ATTR{idVendor=="10CE"}, MODE="666"

Typing on my phone but I think that's it

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

More
12 Oct 2019 15:04 #147739 by satiowadahc
Then run udevadm control --reload
And udevadm trigger
Then unplug and replug your pendant

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

More
16 Oct 2019 00:23 - 16 Oct 2019 00:31 #147958 by randypetersen
Thanks for all the info,

So I got my unit today, I like the look and feel of it.

Spent a few hours trying to get it setup, without success.

Added file:
/etc/udev/rules.d/90-xhc.rules
with the following line:
SUBSYSTEM=="usb",ATTR{idProduct=="EB93"},ATTR{idVendor=="10CE"}, MODE="666"

With your xhc-hb04.cc file I followed the instructions here:
wiki.linuxcnc.org/cgi-bin/wiki.pl?Using_...Wireless_MPG_Pendant

After fighting some dependency issues this is the error I ended up with:
g++ -I/usr/include/linuxcnc -DVERSION=V06 xhc-hb04.cc -o xhc-hb04 -lusb-1.0 -lm -llinuxcnchal -llinuxcncini 
In file included from /usr/include/linuxcnc/hal.h:126:0,
                 from xhc-hb04.cc:35:
/usr/include/linuxcnc/rtapi.h:63:2: error: #error "Please define either RTAPI or ULAPI!"
 #error "Please define either RTAPI or ULAPI!"
  ^~~~~
In file included from xhc-hb04.cc:35:0:
/usr/include/linuxcnc/hal.h:130:2: error: #error HAL needs RTAPI/ULAPI, check makefile and flags
 #error HAL needs RTAPI/ULAPI, check makefile and flags
  ^~~~~
Makefile:8: recipe for target 'xhc-hb04' failed
make: *** [xhc-hb04] Error 1

I changed line 31 to: #include <libusb-1.0/libusb.h> just to get past an error:
xhc-hb04.cc:31:20: fatal error: libusb.h: No such file or directory

added "HALFILE = xhc-hb04.hal" to my ini file

commented out some lines regarding axis3, i am guessing since I don't have an "A" axis.
Also lines:
#net x0 halui.mdi-command-06 xhc-hb04.button-x0
#net y0 halui.mdi-command-07 xhc-hb04.button-y0
#net z0 halui.mdi-command-08 xhc-hb04.button-z0
#net origin halui.mdi-command-09 xhc-hb04.button-goto-zero
#net safe-z halui.mdi-command-10 xhc-hb04.button-safe-z
#net park halui.mdi-command-11 xhc-hb04.button-x2
Guessing since I didn't have those commands set up?
I was able to get LinuxCNC to open again.

Did the:
udevadm control --reload
udevadm trigger
Then unplug and replug your pendant
I had to use "sudo" but still no luck.

Figured since I couldn't get your file to compile it wasn't going to work for me.
I am probably going down the wrong path so I thought I would stop and ask the experts.
Any input would be appreciated.
Is there a good "HOWTO" to follow along to?
Attachments:
Last edit: 16 Oct 2019 00:31 by randypetersen. Reason: added image - for interest? :) & hal/ini files

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

More
16 Oct 2019 18:05 #148024 by satiowadahc
oops guess our internal git wiki is well internal.

install your linuxcnc as normal from the source - I went through the effort to compile the driver for you.

-then replace /usr/bin/xhc-hb04 with the attached file
(you can run it, to verify your drivers and permissions are correct)
(Not available errors are issues with the rules file)

Add this to your ini file:
[XHC-HB04]
BUTTON=01:button-reset
BUTTON=02:button-stop
BUTTON=03:button-start-pause
BUTTON=04:button-feed_up # Macro 1
BUTTON=05:button-feed_down # Macro 2
BUTTON=06:button-spindle_up # Macro 3
BUTTON=07:button-spindle_down # Macro 4
BUTTON=08:button-machine-home # Macro 5
BUTTON=09:button-safe-z #?? # Macro 6
BUTTON=0A:button-work-home # Macro 7
BUTTON=0B:button-spindle # Macro 8
BUTTON=0C:button-fn
BUTTON=0D:button-probe-z # Macro 9
BUTTON=0E:button-continous
BUTTON=0F:button-step
BUTTON=10:button-macro-10
Attachments:

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

More
16 Oct 2019 18:07 #148027 by satiowadahc
Alright need a file extension, remove the extension off this and replace /usr/bin/xhc-hb04
Attachments:

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

More
16 Oct 2019 20:40 - 16 Oct 2019 21:18 #148045 by randypetersen
Awesome!

Getting closer got that xhc-hb04 copied in and now when I run it I get some hex displaying when i do things to on the MPG so the connection has succeeded. I did have to "sudo xhc-hb04" to get it to run.

Checked the USB info looks like the right vendor/product info:
Unknown Device
Manufacturer: KTURT.LTD
Speed: 12Mb/s (full)
USB Version:  1.10
Device Class: 00(>ifc )
Device Subclass: 00
Device Protocol: 00
Maximum Default Endpoint Size: 64
Number of Configurations: 1
Vendor Id: 10ce
Product Id: eb93
Revision Number:  0.00

Config Number: 1
	Number of Interfaces: 1
	Attributes: 80
	MaxPower Needed: 100mA

	Interface Number: 0
		Name: (none)
		Alternate Number: 0
		Class: 03(HID  ) 
		Sub Class: 00
		Protocol: 00
		Number of Endpoints: 1

			Endpoint Address: 81
			Direction: in
			Attribute: 3
			Type: Int.
			Max Packet Size: 64
			Interval: 2ms

Changed this:
loadusr -W xhc-hb04 -I sim-mammoth-rtr.ini -H
to
loadusr -W xhc-hb04 -I xhc-hb04-layout1.ini -H

and put what you said into the xhc-hb04-layout1.ini file.
[XHC-HB04]
BUTTON=01:button-reset
BUTTON=02:button-stop
BUTTON=03:button-start-pause
BUTTON=04:button-feed_up # Macro 1
BUTTON=05:button-feed_down # Macro 2
BUTTON=06:button-spindle_up # Macro 3
BUTTON=07:button-spindle_down # Macro 4
BUTTON=08:button-machine-home # Macro 5
BUTTON=09:button-safe-z #?? # Macro 6
BUTTON=0A:button-work-home # Macro 7
BUTTON=0B:button-spindle # Macro 8
BUTTON=0C:button-fn
BUTTON=0D:button-probe-z # Macro 9
BUTTON=0E:button-continous
BUTTON=0F:button-step
BUTTON=10:button-macro-10

Tried this:
ATTR{idProduct}=="EB93", ATTR{idVendor}=="10ce", MODE="0666", OWNER="root", GROUP="plugdev"
and
SUBSYSTEM=="usb",ATTR{idProduct=="EB93"},ATTR{idVendor=="10CE"}, MODE="666"
in the
/etc/udev/rules.d/99-xhc.rules file

Getting this:
Debug file information:
Note: Using POSIX realtime
libusb: error [_get_usbfs_fd] libusb couldn't open USB device /dev/bus/usb/008/004: Permission denied
libusb: error [_get_usbfs_fd] libusb requires write access to USB device nodes.
./xhc-hb04.hal:91: Pin 'halui.spindle.0.override.increase' does not exist

which leads me to think it's a rules / permission problem?

I did:
sudo chmod o+w /dev/bus/usb/008/004 to see if I can get past that, and am left with:
Debug file information:
Note: Using POSIX realtime
libusb_claim_interface: Device or resource busy
./xhc-hb04.hal:91: Pin 'halui.spindle.0.override.increase' does not exist

Commented the next few lines that gave me errors out, and I am at:
Debug file information:
Note: Using POSIX realtime
libusb_claim_interface: Device or resource busy
./xhc-hb04.hal:35: waitpid failed xhc-hb04 xhc-hb04
./xhc-hb04.hal:35: xhc-hb04 exited without becoming ready
16326
Attachments:
Last edit: 16 Oct 2019 21:18 by randypetersen. Reason: kept working on it... added more info...

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

More
16 Oct 2019 21:50 - 16 Oct 2019 21:50 #148052 by satiowadahc
I had the [XHC-HB04] in my main ini, although the way you have it should work


Ah I see the typo:
SUBSYSTEM=="usb",ATTR{idProduct}=="eb93",ATTR{idVendor}=="10ce", MODE="0666"

If you need sudo the device won't become ready
Last edit: 16 Oct 2019 21:50 by satiowadahc. Reason: Clarity

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

More
16 Oct 2019 22:14 #148054 by randypetersen
Hey I got LinuxCNC to start!!!

The stop button works, but can't seem to get anything else working at the moment, probably cause I kept commenting out lines to get it to start up.

I think I missing something on why it kept saying PIn doensn't exist... For the moment I was just commenting them out to see if I could get anywhere. Any guesses on what I am missing?
Mostly in the XHC-HB04.HAL file...

Do you think I need to move those INI lines you mentioned?
Attachments:

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

More
16 Oct 2019 22:57 #148059 by tommylight
Not my forte but, did you add your user the the dialout group ?
Without it you will not have full access to USB ports. Learned that from using arduinos.

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

Time to create page: 0.135 seconds
Powered by Kunena Forum