xhc-hc04 lost connection

More
31 Mar 2018 16:53 #108178 by islander261
Hello

I am using a xhc-hb04 pendant with my gmoccapy GUI for plasma table control. For the most part it works ok, every now and then I get the dreaded lost connection popup message and then it is dead until I restart Linuxcnc. This Is the hard wired USB version of the pendant. Is there a way to restart the pendant from the GUI or a terminal session? I have read through the pendant script that I believe keeps track of the pendant communications and by my reading it should restart automatically, am I mistaken here? Where do I look for system error messages when this happens? I am a Linux newby don't know most of Linux/Unix management tricks most here take for granted.

John

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

More
01 Apr 2018 01:39 #108198 by dgarrett
Replied by dgarrett on topic xhc-hc04 lost connection

... every now and then I get the dreaded lost connection
popup message and then it is dead until I restart Linuxcnc.


1) You could try other usb ports on the computer.
2) You might get clues (for example disconnects related
to electrical noise caused by other equipment) by tailing
the kernel log file in a separate terminal.
Example (sudo required for some systems):
$ sudo tail -f /var/log/kern.log
3) When using the library helper script ([HAL]HALFILE=LIB:xhc-hb04.tcl),
you can specify: [XHC_HB04_CONFIG]require_pendant=no. This allows a
config to start with no pendant connected and supports disconnects
and reconnects of a pendant.
4) If your config loads (loadusr) the xhc-hb04 driver without using
LIB:xhc-hb04.tcl, you probably need to NOT specify the -x option to
allow reconnects after a disconnect.

README excerpt for LIB:xhc-hb04.tcl usage:

When require_pendant = no, the xhc-hb04 hal pins will be
created even if the pendant is not connected at startup. A new
connection, a disconnect, and a reconnect are supported.

Ref: raw.githubusercontent.com/LinuxCNC/linux...axis/xhc-hb04/README


NOTE: For the master branch, you should update to current commit
to avoid a restart bug introduced by an earlier commit this week:
github.com/LinuxCNC/linuxcnc/commit/9585...f1c4541062784aeb48f2
The following user(s) said Thank You: RacingMat

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

More
01 Apr 2018 09:19 #108202 by rodw
Replied by rodw on topic xhc-hc04 lost connection
I think plasma generates RFI and noise that is very hard on USB connections. When I first started to play in this space, I tried monitoring plasma stuff with an Arduino and I could never get a PC to stay connected to the Arduino after the plasma started.

I settled on a more professional pendant from the same manufacturer that uses 433 mHz wireless communication with a relay box/receiver in the control box which has proven to be very robust. But it did cost around USD $350.

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

More
01 Apr 2018 16:45 #108218 by islander261
Dewey & Rod

Thank you for the replies.

I have a USB pendant because the Windoze based system that I am still using for production work has a USB keypad for a pendant and has been absolutely reliable ( it also uses a USB signal generator for motion control). Unfortunately because of the closed nature of the system I can't test the new pendant on it. It doesn't matter whether the plasma power supply is on or off, this seems to be an equal opportunity event.

I believe that I have the configuration set correctly with the require_pendant = 0.
I am using the eoffsets branch and believe I am using the latest commit.

Please find attached .ini and .hal files to confirm configuration.

I will switch the pendant to a port now used by the keyboard or mouse and see how it work. What I need some guidance on is what pin or signal I need poke to get the pendant to reconnect. I can easily add a button to my GUI for this. I have tried powering down the pendant and then repowering it and that doesn't cause it to reconnect (as it would on a typical Windoze system). I actually don't know if this is happening at the OS level or the user application level. TIA

John
Attachments:

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

More
01 Apr 2018 18:56 #108223 by islander261
Hi

I did a quick test forcing the pendant to disconnect (switched it's power off) and it would not reconnect when power was switched back on.

John

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

More
01 Apr 2018 20:14 #108227 by dgarrett
Replied by dgarrett on topic xhc-hc04 lost connection
1)

Please find attached .ini and .hal files to confirm configuration.

The ini file you attached does not include
a stanza named [XHC_HB04_BUTTONS] which is required
by LIB:xhc-hb04.tcl in order to start so i am not
sure that you attached correct files or if your
LinuxCNC install is what you think it is. Any recent version
of LIB:xhc-hb04.tcl will refuse startup if that stanza
is omitted.

2)

I believe that I have the configuration set correctly
with the require_pendant = 0.

The supported syntax is '[XHC_HB04_CONFIG]=no' (or yes) and
the attached ini file does show this (but see 1) above)

3)

I am using the eoffsets branch and believe I am using the latest commit.

This is *unhelpful* as it gives no indication what commit you use nor
what date it was installed which might have a clue to its last commit.

When using git, the last commit can be found with:
$git log --oneline -5

The branch is rebased today and pushed so you should probably
update to it (last commit is:5acf4d1ec) so i know what commit
you have. Pushes to git for this branch are *forced*, so you
update using:
$ cd your_git_root_dir
$ git fetch
$ git reset --hard origin/dgarr/external_offsets
$ git log --oneline -5
$ cd src
$ make
$ sudo make setuid

4)

what pin or signal I need poke to get the pendant to reconnect.

No activity is required -- when *properly* configured, reconnection is
automatic when the usb plug is removed and reinserted later.

5)

I did a quick test forcing the pendant to disconnect (switched
it's power off) and it would not reconnect when power was switched back on.

I'm not familiar with the *wired* version of the pendant that you use but
the reconnection facility works at disconnect/reconnect at the usb
port. On the wireless version, toggling the power button may
or may not have affect. The pendant can 'time-out' when not connected and
require toggling via its power button.

6) As you report that the loss of connection is not related to your plasma setup,
the simplest test would be to run one of the provided sim configs for
a few hours and try to duplicate the problem. The sim configs do not require
any hardware (other than an xhc-hb04). For example, use:
configs/sim/axis/xhc-hb04/xhc-hb04-layout2.ini
Ref: raw.githubusercontent.com/LinuxCNC/linux...xhc-hb04-layout2.ini

7) Use this procedure to run from a terminal and produce a log file:
$ cd your_git_root_dir/configs/sim/axis/xhc-hb04
$ linuxcnc xhc-hb04-layout2.ini 2>&1 >|x.log

Make sure that the sim config you choose uses
'[XHC_HB04_CONFIG]require_pendant=no'.

Experiment using the pendant under your normal conditions as well as trying
multiple disconnects/reconnects to see if you can duplicate problems.

Attach the file produced by the sim config (x.log)


Reference, the check for [XHC_HB04_BUTTONS] in LIB:xhc-hb04.tcl:
if {[array names ::XHC_HB04_BUTTONS] == ""} {
  err_exit "Missing stanza: \[XHC_HB04_BUTTONS\]"
}
github.com/LinuxCNC/linuxcnc/blob/dgarr/.../hallib/xhc-hb04.tcl

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

More
01 Apr 2018 20:30 #108228 by islander261
Hi

Here is the results of running the tail command while switching the pendant off and back on:

jd@plasma1 ~ $ sudo tail -f /var/log/kern.log
[sudo] password for jd:
Apr 1 11:54:37 plasma1 kernel: [13411.097078] usb 7-2: New USB device found, idVendor=10ce, idProduct=eb70
Apr 1 11:54:37 plasma1 kernel: [13411.097085] usb 7-2: New USB device strings: Mfr=1, Product=0, SerialNumber=0
Apr 1 11:54:37 plasma1 kernel: [13411.097090] usb 7-2: Manufacturer: KTURT.LTD
Apr 1 11:54:37 plasma1 kernel: [13411.105638] hid-generic 0003:10CE:EB70.0008: hiddev0,hidraw0: USB HID v1.10 Device [KTURT.LTD] on usb-0000:00:1d.2-2/input0
Apr 1 11:57:17 plasma1 kernel: [13571.708106] usb 7-2: USB disconnect, device number 4
Apr 1 11:57:22 plasma1 kernel: [13576.332052] usb 7-2: new full-speed USB device number 5 using uhci_hcd
Apr 1 11:57:22 plasma1 kernel: [13576.913091] usb 7-2: New USB device found, idVendor=10ce, idProduct=eb70
Apr 1 11:57:22 plasma1 kernel: [13576.913098] usb 7-2: New USB device strings: Mfr=1, Product=0, SerialNumber=0
Apr 1 11:57:22 plasma1 kernel: [13576.913102] usb 7-2: Manufacturer: KTURT.LTD
Apr 1 11:57:22 plasma1 kernel: [13576.921990] hid-generic 0003:10CE:EB70.0009: hiddev0,hidraw0: USB HID v1.10 Device [KTURT.LTD] on usb-0000:00:1d.2-2/input0
Apr 1 13:23:59 plasma1 kernel: [18773.504076] usb 7-2: USB disconnect, device number 5
Apr 1 13:24:50 plasma1 kernel: [18824.288110] usb 7-2: new full-speed USB device number 6 using uhci_hcd
Apr 1 13:24:50 plasma1 kernel: [18824.446115] usb 7-2: New USB device found, idVendor=10ce, idProduct=eb70
Apr 1 13:24:50 plasma1 kernel: [18824.446122] usb 7-2: New USB device strings: Mfr=1, Product=0, SerialNumber=0
Apr 1 13:24:50 plasma1 kernel: [18824.446126] usb 7-2: Manufacturer: KTURT.LTD
Apr 1 13:24:50 plasma1 kernel: [18824.454963] hid-generic 0003:10CE:EB70.000A: hiddev0,hidraw0: USB HID v1.10 Device [KTURT.LTD] on usb-0000:00:1d.2-2/input0

It looks to me like the operating system is recognizing the reconnection.

John

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

More
02 Apr 2018 17:19 #108264 by islander261
Dewey

Thank you for the help. I installed your latest commit of the external_offsets branch last night following your instructions without any problems. I tested the pendant using the Axis SIM for it this morning and all worked well. I fixed the xhc-hc04.tcl file to connect to my pins. I am running gmoccapy now and the pendant is successfully reconnecting after unplugging and plugging back in and when cycling it's power switch.

John

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

Moderators: newbynobiHansU
Time to create page: 0.103 seconds
Powered by Kunena Forum