Help needed setting up WiFi pendent XHC-WHB04

More
01 Jan 2020 22:52 #153748 by depronman
I have followed the instruction on the WIKI (wiki.linuxcnc.org/cgi-bin/wiki.pl?Using_...Wireless_MPG_Pendant)
but I am stuck after nearly two full days of trying

I am running Linuxcnc 2.9 latest build on a lathe using two parallel ports

everything is working well, but I would like to get the pendent working as well (I bought the pendent for my mill which is currently running Mach3 and the pendent works perfectly)

I have checked that Linux can see the usb dongle OK
I am new to Linux (been a DOS and Windows guy for the last 30 years)

I don't believe that I have the xhc-hb04 driver Where should it be ? and I can check it is present or not ?

I have downloaded the upload:xhc-hb04-V06.tgz and unpacked it to a folder in my download directory

When I run make -f Makefile I get an error stating that libusb is not present

where do I check to see is libusb is present ?
and if it is not present how do I install it ?

I'm running weezey

Thanks
Paul

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

More
03 Jan 2020 00:10 #153843 by satiowadahc
Hi Paul,

Unfortunately the xhc-hb04 driver doesn't work with the WHB04. The main difference is XHC-HB04 has a different USB ID. If your comfortable compiling the linuxcnc from the source code, I have a version that supports most of the features here: github.com/satiowadahc/linuxcnc/blob/2.8...er_comps/xhc-hb04.cc,
swap the file for the one on linuxcnc's master and it should work after compiling

-Chad
The following user(s) said Thank You: Mike_Eitel

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

More
03 Jan 2020 00:11 #153844 by satiowadahc
To install libusb (which you'll need)

sudo apt install libusb-1.0-0
and
sudo apt install libusb-1.0-0-dev
The following user(s) said Thank You: depronman

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

More
06 Jan 2020 23:00 #154179 by depronman
Hi,
sorry for the lack of response but I went down a slightly different tack - I ordered some weeks ago a pendent from China which arrived a couple of days ago. I have been trying to connect this to Linuxcnc without any success, but I think the fundamental problem is the second parallel port will not work as mainly inputs. If I set it up the same as Parallel port 0 then 5 pins work as inputs, but changing it to 'in' results in none of the pins working as input pins
I have read somewhere that not all parallel port support being set to 'in'. So with only 5 input pins connecting the MPG (2 pins) and the axis selector (2 pins) and the step selector (2 pins) is not possible

So, I'm back to the USB WIFI pendent.

I had not realised that there is a sim available, I have now run this and the pendent updates the writting on the screen perfectly, MPG works, all buttons work, axis selector knob works perfect - so I conclude that I must have the correct 'driver' installed.

My question is what do I need to add to my INI file (and any other files) to make the pendent available when Linuxcnc is running ?

Quite frustrating as I feel I must be nearly there but still missing something

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

More
07 Jan 2020 00:33 #154189 by satiowadahc
The most import thing, at the top of your hal file you'll need:

loadusr -W xhc-hb04 -I xhc-hb04-layout1.ini -H

You can see the pins available from halscope in linuxcnc, the hal file I used is here:
forum.linuxcnc.org/media/kunena/attachme...-hb04_2019-10-20.hal
The following user(s) said Thank You: depronman

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

More
07 Jan 2020 07:06 #154199 by depronman
Thanks will study your Hal file and give it a try tonight
I will report back on progress
Many thanks
Paul

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

More
11 Jan 2020 17:32 #154627 by depronman
Hi,
Made some progress, but getting the error -
HAL: ERROR: thread 'servo-thread' not found
./orac_pendent.hal:40: addf failed
5594
Stopping realtime threads
Unloading hal components

full error msg below

Any one got any pointers for me please ???




Error report created by /usr/lib/tcltk/linuxcnc/show_errors.tcl:
HAL: ERROR: thread 'servo-thread' not found
./orac_pendent.hal:40: addf failed
5594
Stopping realtime threads
Unloading hal components
Print file information:
RUN_IN_PLACE=no
LINUXCNC_DIR=
LINUXCNC_BIN_DIR=/usr/bin
LINUXCNC_TCL_DIR=/usr/lib/tcltk/linuxcnc
LINUXCNC_SCRIPT_DIR=
LINUXCNC_RTLIB_DIR=/usr/realtime-3.4-9-rtai-686-pae/modules/linuxcnc
LINUXCNC_CONFIG_DIR=
LINUXCNC_LANG_DIR=/usr/lib/tcltk/linuxcnc/msgs
INIVAR=inivar
HALCMD=halcmd
LINUXCNC_EMCSH=/usr/bin/wish8.5
LINUXCNC - 2.9.0-pre0-899-g769bc21
Machine configuration directory is '/home/orac/linuxcnc/configs/orac_pendent'
Machine configuration file is 'orac_pendent.ini'
INIFILE=/home/orac/linuxcnc/configs/orac_pendent/orac_pendent.ini
VERSION=1.1
PARAMETER_FILE=linuxcnc.var
TASK=milltask
HALUI=halui
DISPLAY=gmoccapy
COORDINATES=X Z
KINEMATICS=trivkins coordinates=XZ
Starting LinuxCNC...
Starting LinuxCNC server program: linuxcncsvr
Loading Real Time OS, RTAPI, and HAL_LIB modules
Starting LinuxCNC IO program: io
Starting HAL User Interface program: halui
Found file(REL): ./orac_pendent.hal
Shutting down and cleaning up LinuxCNC...
xhc-hb04: waiting for XHC-HB04 device
xhc-hb04: found XHC-HB04 device
xhc-hb04: connection lost, cleaning up
Removing HAL_LIB, RTAPI, and Real Time OS modules
Removing NML shared memory segments

Debug file information:
.
HAL: ERROR: thread 'servo-thread' not found
./orac_pendent.hal:40: addf failed
5594
Stopping realtime threads
Unloading hal components

Kernel message information:
[ 5326.235729] I-pipe: head domain RTAI registered.
[ 5326.235746] RTAI[hal]: compiled with gcc version 4.7.2 (Debian 4.7.2-5) .
[ 5326.235755] RTAI[hal]: mounted (IPIPE-NOTHREADS, IMMEDIATE (INTERNAL IRQs DISPATCHED), ISOL_CPUS_MASK: 0).
[ 5326.235760] SYSINFO: CPUs 1, LINUX APIC IRQ 2312, TIM_FREQ 20864885, CLK_FREQ 2003064000, CPU_FREQ 2003064000
[ 5326.235764] RTAI_APIC_TIMER_IPI: RTAI DEFINED 2314, VECTOR 2314; LINUX_APIC_TIMER_IPI: RTAI DEFINED 2312, VECTOR 2312
[ 5326.235769] TIMER NAME: lapic; VARIOUSLY FOUND APIC FREQs: 20864885, 20864885, 20662250
[ 5326.253677] RTAI[malloc]: global heap size = 2097152 bytes, <BSD>.
[ 5326.253798] , <uses LINUX SYSCALLs>, kstacks pool size = 524288 bytes.
[ 5326.253804] RTAI[sched]: hard timer type/freq = APIC/20864885(Hz); default timing: oneshot; linear timed lists.
[ 5326.253808] RTAI[sched]: Linux timer freq = 250 (Hz), TimeBase freq = 2003064000 hz.
[ 5326.253812] RTAI[sched]: timer setup = 999 ns, resched latency = 2943 ns.
[ 5326.274551] RTAI[math]: loaded.
[ 5329.070542] RTAI[math]: unloaded.
[ 5329.074784] SCHED releases registered named ALIEN PEDV$D
[ 5329.084613] RTAI[malloc]: unloaded.
[ 5329.184021] RTAI[sched]: unloaded (forced hard/soft/hard transitions: traps 0, syscalls 0).
[ 5329.187958] I-pipe: head domain RTAI unregistered.
[ 5329.187978] RTAI[hal]: unmounted.



Info report created by linuxcnc_info:
The file: /tmp/linuxcnc_info.txt
can be posted to a forum or a web site like:
pastebin.com
in order to provide information about the linuxcnc
system and configuration.

Date: Sat Jan 11 17:23:58 GMT 2020
UTC Date: Sat Jan 11 17:23:58 UTC 2020
this program: /usr/bin/linuxcnc_info
uptime: 17:23:58 up 1:29, 0 users, load average: 0.19, 0.15, 0.31
lsb_release -sa: Debian Debian GNU/Linux 7.11 (wheezy) 7.11 wheezy
which linuxcnc: /usr/bin/linuxcnc
pwd: /home/orac/linuxcnc/configs/orac_pendent
USER: orac
LOGNAME: orac
HOME: /home/orac
EDITOR:
VISUAL:
LANGUAGE: en_GB:en
TERM: dumb
COLORTERM:
DISPLAY: :0.0
DESKTOP: lightdm-xsession
display size: 1280x1024 pixels (338x270 millimeters)
PATH: /usr/bin:/home/orac/linuxcnc/configs/orac_pendent/bin:/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games

uname items:
nodename -n: ORAC
kernel-name -s: Linux
kernel-vers -v: #1 SMP PREEMPT Debian 3.4.55-4linuxcnc
machine -m: i686
processor -p: unknown
platform -i: unknown
oper system -o: GNU/Linux

/proc items:
cmdline: BOOT_IMAGE=/boot/vmlinuz-3.4-9-rtai-686-pae root=UUID=08d33a2c-fe14-4d7f-8c97-8ca6bd2a648e ro initrd=/install/gtk/initrd.gz lapic quiet rootdelay=5
model name: AMD Sempron(tm) 2800+
cores:
cpu MHz: 2003.064
parport: 0378-037a : parport0 9000-9002 : parport1 9003-9007 : parport1
serial: 02f8-02ff : serial 03f8-03ff : serial

Versions:
gcc: gcc (Debian 4.7.2-5) 4.7.2
python: Python 2.7.3
git: git version 1.7.10.4
git commit: NA
tcl: 8.5
tk: 8.5
glade: not_in_PATH
glade-gtk2: glade3 3.8.0

linuxcnc_var all:

LINUXCNCVERSION: 2.9.0-pre0-899-g769bc21
LINUXCNC_AUX_GLADEVCP: /usr/share/linuxcnc/aux_gladevcp
LINUXCNC_AUX_EXAMPLES: /usr/share/linuxcnc/aux_examples
REALTIME: /etc/init.d/realtime
RTS: /usr/realtime-3.4-9-rtai-686-pae/bin/rtai-config
HALLIB_DIR: /usr/share/linuxcnc/hallib

dpkg -l '*linuxcnc*':
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-=====================================-==================================-============-==============================================================================
ii linuxcnc 1:2.9.0~pre0.899.g769bc21 i386 motion controller for CNC machines and robots
un linuxcnc-doc <none> (no description available)
ii linuxcnc-doc-en 1:2.8.0~pre1.5366.g904fb10 all motion controller for CNC machines and robots (English documentation)
un linuxcnc-sim <none> (no description available)
un linuxcnc-uspace <none> (no description available)

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

More
12 Jan 2020 05:53 #154663 by satiowadahc
I used servo-thread as my base thread, can you list all the lines in your hal files starting with loadrt
The following user(s) said Thank You: depronman

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

More
12 Jan 2020 17:46 #154698 by depronman
Hi,
Hope this is what you need

orac_pendent.hal

###############################################
#
# Implementing XHC-HB04 Pendant for RMD
# Files needed to be modified to use this
# /etc/udev/rules.d/99-xhc.rules
# xhc-hb04.cc as part of base linuxcnc
#
# Written by Chad Woitas For RMD Engineering
# October 2019
#
##############################################

# Button mapping for reference
# BUTTON=01:button-reset
# BUTTON=02:button-stop
# BUTTON=03:button-start-pause #TEST
# BUTTON=04:button-feed_up # Macro 1 #TEST
# BUTTON=05:button-feed_down # Macro 2 #TEST
# BUTTON=06:button-spindle_up # Macro 3 #Function?
# BUTTON=07:button-spindle_down # Macro 4 #Function?
# 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


# load our driver
# config files are stored in the machine INI
# -H is to run in real time mode
loadusr -W xhc-hb04 -I xhc-hb04-layout1.ini -H


loadrt flipflop names=flipflop_resume,flipflop_pause,flipflop_run,flipflop_icon,flipflop_spindle_start,flipflop_spindle_stop
# pins for start/pause button 3
addf flipflop_resume servo-thread
addf flipflop_pause servo-thread
addf flipflop_run servo-thread

# ???
addf flipflop_icon servo-thread

# pins for spindle start stop
addf flipflop_spindle_start servo-thread
addf flipflop_spindle_stop servo-thread

# SETUP pins
# Clicks declared in button order
loadrt multiclick names=click_reset,click_estop,click_start_pause,click_feed_up,click_feed_dn,click_spindle_up,click_spindle_dn,click_m_home,click_safe_z,click_w_home,click_spindle

loadrt not names=not_spin
addf not_spin servo-thread

# BUTTON=01:button-reset
addf click_reset servo-thread
net xhc-reset xhc-hb04.button-reset => click_reset.in
net estop-reset halui.estop.reset <= click_reset.single-click

# BUTTON=02:button-stop
addf click_estop servo-thread
net estop-xhbutton xhc-hb04.button-stop => click_estop.in
net estop-activated halui.estop.activate <= click_estop.single-click

# BUTTON=03:button-start-pause
addf click_start_pause servo-thread
net xhc-start_pause xhc-hb04.button-start-pause => flipflop_pause.clk flipflop_resume.clk flipflop_run.clk
net is-paused halui.program.is-paused => flipflop_resume.data flipflop_pause.reset
net is-running halui.program.is-running => flipflop_pause.data flipflop_run.reset flipflop_resume.reset
net is-idle halui.program.is-idle => flipflop_run.data
net resume flipflop_resume.out => halui.program.resume
net pause flipflop_pause.out => halui.program.pause
net run flipflop_run.out => halui.mode.auto halui.program.run

# BUTTON=04:button-feed_up # Macro 1
addf click_feed_up servo-thread
net sig_feed_inu xhc-hb04.button-feed_up => click_feed_up.in
net sig_feed_up halui.feed-override.increase <= click_feed_up.single-click

# BUTTON=05:button-feed_down # Macro 2
addf click_feed_dn servo-thread
net sig_feed_ind xhc-hb04.button-feed_down => click_feed_dn.in
net sig_feed_dn halui.feed-override.decrease <= click_feed_dn.single-click

# BUTTON=06:button-spindle_up # Macro 3
addf click_spindle_up servo-thread
net sig_spin_inu xhc-hb04.button-spindle_up => click_spindle_up.in
#net sig_spin_inu halui.spindle-override.increase <= click_spindle_up.single-click

# BUTTON=07:button-spindle_down # Macro 4
addf click_spindle_dn servo-thread
net sig_spin_ind xhc-hb04.button-spindle_down => click_spindle_dn.in
#net sig_spin_ind halui.spindle-override.decrease <= click_spindle_dn.single-click

# BUTTON=08:button-machine-home # Macro 5
addf click_m_home servo-thread
net sig_m_home_in xhc-hb04.button-machine-home => click_m_home.in
#net sig_m_home_in or2.0.in0 <= click_m_home.single-click #or2.0.in0

# BUTTON=09:button-safe-z # Macro 6
addf click_safe_z servo-thread
net sig_safe_z_in xhc-hb04.button-safe-z => click_safe_z.in
# TODO Send this to mdi g53?

# BUTTON=0A:button-work-home # Macro 7
addf click_w_home servo-thread
net sig_w_home_in xhc-hb04.button-work-home => click_w_home.in
#net sig_w_home_in or2.0.in1 <= click_w_home.single-click ##or2.0.in1

# BUTTON=0B:button-spindle # Macro 8
addf click_spindle servo-thread
net sig_spin_in xhc-hb04.button-spindle => flipflop_spindle_start.clk flipflop_spindle_stop.clk
net is-on_spindle halui.spindle.is-on => flipflop_spindle_stop.data flipflop_spindle_start.reset not_spin.in
net is-off_spindle not_spin.out => flipflop_spindle_start.data flipflop_spindle_stop.reset
net start_spindle flipflop_spindle_start.out => halui.spindle.start
#net stop_spindle flipflop_spindle_stop.reset => halui.spindle.stop

# BUTTON=0C:button-fn
# BUTTON=0D:button-probe-z # Macro 9
# BUTTON=0E:button-continous
# BUTTON=0F:button-step
# BUTTON=10:button-macro-10

# LCD
net Xpos => xhc-hb04.x.pos-absolute
net Ypos => xhc-hb04.y.pos-absolute
net Zpos => xhc-hb04.z.pos-absolute
#net spindle-rps spindle-speed-out => xhc-hb04.spindle-rps
net feedrate halui.feed-override.value => xhc-hb04.feed-value

# Jog wheel and axis selection button
net jog-x axis.0.jog-enable <= xhc-hb04.jog.enable-x
net jog-y axis.1.jog-enable <= xhc-hb04.jog.enable-y
net jog-z axis.2.jog-enable <= xhc-hb04.jog.enable-z


net jog-counts xhc-hb04.jog.counts => axis.0.jog-counts axis.1.jog-counts
net jog-counts-neg xhc-hb04.jog.counts-neg => axis.2.jog-counts

# Step Size selector
loadrt mux_generic config=ff256
addf mux-gen.00 servo-thread
setp mux-gen.00.in-float-01 0.005
setp mux-gen.00.in-float-02 0.01
setp mux-gen.00.in-float-04 0.025
setp mux-gen.00.in-float-08 0.05
setp mux-gen.00.in-float-16 0.10
setp mux-gen.00.in-float-32 0.20
setp mux-gen.00.in-float-64 1.00

net step0 mux-gen.00.sel-bit-00 <= xhc-hb04.stepsize0
net step1 mux-gen.00.sel-bit-01 <= xhc-hb04.stepsize1
net step2 mux-gen.00.sel-bit-02 <= xhc-hb04.stepsize2
net step3 mux-gen.00.sel-bit-03 <= xhc-hb04.stepsize3
net step4 mux-gen.00.sel-bit-04 <= xhc-hb04.stepsize4
net step5 mux-gen.00.sel-bit-05 <= xhc-hb04.stepsize5
net step6 mux-gen.00.sel-bit-06 <= xhc-hb04.stepsize6

net step_all mux-gen.00.out-float => axis.0.jog-scale axis.1.jog-scale axis.2.jog-scale



cheers,
Paul

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

More
12 Jan 2020 17:48 #154699 by satiowadahc
Do you have any other .hal files?

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

Time to create page: 0.095 seconds
Powered by Kunena Forum