XHC-HB04 wireless MPG pendant HAL module

More
11 May 2014 04:54 #46807 by cncbasher
easyest way is to type in terminal

sudo apt-get install <filename>
so
sudo apt-get install libc6-dev

libusb-1.0-0-dev

you dont say which version of linuxcnc and os you are using , as the latest version has the wireless pendant already included
and their are some example configs already included in sim and easier to follow readme

it's not too difficult to copy and paste the required lines into your ini file and copy the files required into your config directory
but if you are real stuck , compress your working config into a tar zip and attach and i'll assist in the alterations

the main point to remember is the rules file in the udev rules,d
but we can cross that point easily , but follow the readme for the pendant in the sim configs and you should be up and running
easily

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

More
11 May 2014 07:28 - 11 May 2014 11:26 #46809 by Muzzer
Sorry, that was a basic omission. I've got version 2.5.0 and Ubunto 10.04.

Thanks for the help. I've managed to install those libraries now. I'm going to have to figure out where the ini file is kept and where the configs directory is. Things are organised quite differently to DOS and Windows. I've got one of those "dummy" level books to get me started - I'm afraid that's the level I'm starting from.

There's a lot of stuff to read and in the meantime I'll be stumbling about half blind....

What do you mean by the "latest version" - is that 2.5.4? If I need that, do I need to do a complete reinstall to change from 2.5.0 to 2.5.4? The buildbot page says "put one of these stanzas in your /etc/apt/sources.list.d/linuxcnc-buildbot.list:....then say "sudo apt-get update" and "sudo apt-get install linuxcnc" or "sudo apt-get install linuxcnc-sim"." My sources.list.d folder is empty, so it doesn't look as if that is going to work immediately.

I also had enormous fun trying to add the file /etc/udev/rules.d/90-xhc.rules. I created the file easily enough by saving that readme file with the right name and deleting everything but the required content. But then I couldn't move or copy it from the folder on my desktop to the rules.d folder - I didn't have permission and when I try to use su to allow it, the cp command doesn't recognize the path. Hopefully the update will avoid the need for me to bottom this out for now.

Murray
Last edit: 11 May 2014 11:26 by Muzzer. Reason: What is latest version

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

More
11 May 2014 13:51 #46810 by ArcEye

The buildbot page says "put one of these stanzas in your /etc/apt/sources.list.d/linuxcnc-buildbot.list:....then say "sudo apt-get update" and "sudo apt-get install linuxcnc" or "sudo apt-get install linuxcnc-sim"." My sources.list.d folder is empty, so it doesn't look as if that is going to work immediately.


You have to make it, it does not exist by default.

From a terminal

sudo touch /etc/apt/sources.list.d/linuxcnc-buildbot.list
sudo gedit /etc/apt/sources.list.d/linuxcnc-buildbot.list


then type in the deb line, carraige return and save it and quit gedit.

Now in the terminal

sudo apt-get update
sudo apt-get install linuxcnc


regards

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

More
12 May 2014 02:06 #46823 by Muzzer
That was very quick and easy, copying and pasting from your email - thanks!! I now have 2.5.4 running and I created the rules file ok too.

When I start LinuxCNC, under "My Configurations", I have "sim" and under that I have 3 ngcgui and the 2 xhc configs. That's a start!

I extracted the files from wiki.linuxcnc.org/uploads/xhc-hb04-V06.tgz to a folder on my desktop and tried to run the make command but it got upset as it can't find the hal.h header file or the inifile.hh The makefile and source code are there but I assumed it would find the other files in those lib files I just installed.

muzzer@muzzer-ubuntu:~/Desktop/src$ make
g++ -I/usr/include/linuxcnc -DVERSION=V06 xhc-hb04.cc -o xhc-hb04 -lusb-1.0 -lm -llinuxcnchal -llinuxcncini
xhc-hb04.cc:36:26: error: linuxcnc/hal.h: No such file or directory
xhc-hb04.cc:37:22: error: inifile.hh: No such file or directory
xhc-hb04.cc:63: error: ISO C++ forbids declaration of ‘hal_float_t’ with no type
....etc


I added the extra line "HALFILE = xhc-hb04.hal" in ngcgui_simple.ini but LinuxCNC bombs out unless I comment that line out. There are some steps missing still before that's going to work.

I was expecting to copy the resulting output along with the extracted files into the config area of linuxcnc. Sounds as if I may have the config files where they need to be but the make failure is a bit of a show stopper. I can't help feeling I'm getting very close but still no cigar.

Murray

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

More
12 May 2014 13:51 #46835 by ArcEye
sudo apt-get install linuxcnc-dev

You dont have those headers installed

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

More
13 May 2014 04:41 #46848 by Muzzer
Same problem Poma encountered in #45549 a few posts above. I'm going to compile a list of required additional steps to get my noob / vanilla Ubuntu/LinuxCNC install to work and test it out on the target PC in the garage. The clues are scattered about....

Thanks for the help - will try this when I get back in later.

Murray

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

More
13 May 2014 10:45 #46864 by Muzzer
That seems to have changed something, possibly for the better.

One of the readme's told me to make sure "HALUI = halui is also in the [HAL] section of your .ini file". Not sure which of the ini files it should be, so I put it into the ngcgui_simple.ini file and tried to run that from the configuration selector. I also placed the xhc-hb04-layout1.ini etc files alongside the ngcgui_simple.ini files as that was the best I could think was meant by the instructions in the readme. Doesn't look right though, as now the xhc-hb04-layout1.ini file is shown in the configuration selector yet it has a trivial content compared to what is required. Also, how come my sim area has an ngcgui folder but not an AXIS one?

It still bombs out although it does seem to have noticed the XHC briefly (error messages attached). I've compressed the config area as it currently stands and attached it. Can anyone tell me where the problem lies (apart from my lack of capability)?

Murray
Attachments:

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

More
13 May 2014 19:29 #46874 by andypugh

One of the readme's told me to make sure "HALUI = halui is also in the [HAL] section of your .ini file". Not sure which of the ini files it should be, so I put it into the ngcgui_simple.ini file

There is only one INI file for each config (the INI file defines the config). So HALUI needs to be specified in the INI file that corresponds to the configuration you are running.
A slight confusion is that the XHC component also uses an INI file for its own configuration.

So, your config INI needs to contain both the HALUI=halui entry, plus the MDI_COMMAND entries that define what each button does.
Then your config INI file needs to reference a HAL file which contains the command that loads the XHC driver. You can either add an INI file reference to the sample HAL file, or copy the commands form that HAL file into one of your other HAL files.
The important line is loadusr -W xhc-hb04 -I xhc-hb04-layout1.ini -H which loads the XHC driver and tells the driver which XHC definition INI file to use.

So, the main config INI calls HAL files, and one of the HAL files calls the XHC definition INI file from a "loadusr" line.

as now the xhc-hb04-layout1.ini file is shown in the configuration selector yet it has a trivial content compared to what is required

Yes, that is a different style of INI file.

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

More
13 May 2014 23:41 #46892 by Muzzer
I've created a copy of the ngcgui_simple.ini. In the [HAL] section it already contains the lines
HALFILE = xhc-hb04.hal
HALUI = halui


I haven't altered xhc-hb04.hal either, so the first line is
loadusr -W xhc-hb04 -I xhc-hb04-layout2.ini -H

However, there are no MDI_COMMAND entries in the .ini file, which is presumably where it's all going wrong. I thought the xhc-hb04-layout2.ini took care of defining the button functions. I notice that the xhc-hb04.hal file contains 6 references to halui.mdi-command-06 etc in the net definitions. Unless I've defined the MDI_COMMANDs, presumably they make no sense. I'll try to figure out where those need to come from next.

Thx!

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

More
14 May 2014 00:06 #46897 by andypugh

Unless I've defined the MDI_COMMANDs, presumably they make no sense. I'll try to figure out where those need to come from next.


You can just copy and paste them from the Wiki page.
Unless the config INI file contains the MDI_COMMAND entries then the HAL pins that the pendant hal tries to link to those commands will not exist.

If you want you can just add a lot of blank MDI_COMMAND lines to the [HALUI] section to create HAL pins that do nothing.

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

Time to create page: 0.215 seconds
Powered by Kunena Forum