Pokeys

More
28 Jul 2016 19:59 - 21 Mar 2017 17:00 #78105 by fixer
fixer replied the topic: Pokeys
I changed component code in first post. Now it outputs err hal pin on USB disconnection and tries to reconnect.



edit:removed offtopic, will start another thread
Attachments:
Last Edit: 21 Mar 2017 17:00 by fixer. Reason: removed offtopic
More
28 Jul 2016 20:21 #78106 by tommylight
tommylight replied the topic: Pokeys
That took a lot of work! Niceeeeeee.
I wonder.......what about the actual keys? Or you have a stash of nice ideas that you can turn to!
Keep up the good work.
Tom
More
17 Mar 2017 17:19 #89831 by DavidJ
DavidJ replied the topic: Pokeys
I have a PoKeys55. I have LinuxCNC 2.7.8 running my Mill. I have only the most basic knowledge of Linux, but am comfortable setting up control systems, ladder, etc. I have some functionality I'd like to add using the PoKeys to act as input device.

I need a simple 'how to' covering getting PoKeys to work with LinuxCNC and then how to identify signals from the PoKeys. Sorry if I'm being stupid, but previous posts in this thread don't help me at all (they assume more knowledge of Linux than I have - I'm used to Windows where you just run an installer, then use it).

Can anyone get me started ?
More
18 Mar 2017 12:06 - 18 Mar 2017 12:09 #89852 by fixer
fixer replied the topic: Pokeys
-Follow instructions from pokeys manual to install library and set permissions.
-Use commands from my first post to compile hal component.
-use "loadusr" in HAL to load a component
-use "setp pokeys.0.devSerial" to set serial number of your board


check first post for updated code from today.
Last Edit: 18 Mar 2017 12:09 by fixer.
More
18 Mar 2017 12:33 - 18 Mar 2017 12:42 #89855 by DavidJ
DavidJ replied the topic: Pokeys
Thanks - not much clearer though. I'll re-check the PoKeys site for information. (EdIt : that's all rather confusing too - not clear which file or files I need).

When use say 'use' - am I supposed to put that command in a file ? (which one, which directory?).
What is the 'component' that I'm supposed to load?

What do I do with the code from first post?

I'm sure it's obvious once you know, but I'm clearly missing some basic knowledge. This reminds me why I've abandoned Linux several times before - great applications, very tricky to get started from zero base.
Last Edit: 18 Mar 2017 12:42 by DavidJ.
More
18 Mar 2017 17:05 - 18 Mar 2017 17:13 #89861 by fixer
fixer replied the topic: Pokeys
Polabs had the step by step instructions on their blog, but the site is currently dead. I attached pokeys lib compiling procedure in first post.

basically you need to do:
1. install libusb
2. download and compile pokeys library
3. compile my HAL component
4. set "udev" rules for your usb device

after that, you can include pokeys component in your HAL file as IO device.

read that:
linuxcnc.org/lucid/docs/2.6/html/hal/basic_hal.html
linuxcnc.org/docs/html/hal/comp.html
Last Edit: 18 Mar 2017 17:13 by fixer.
More
19 Mar 2017 15:15 #89889 by DavidJ
DavidJ replied the topic: Pokeys
Am beginning to see at least some of what to do. I think I follow the bit about PoKeys library.

The line "sudo halcompile ./pokeys.comp"

Does the file name that I copy your driver code into have to be named to match part of that command ? Is there a preferred location to place your code in, or doesn't it matter?

The multi-line command commencing gcc - does that have to be run from a particular directory ?

Not sure I understand 'set "udev" rules' yet.
More
19 Mar 2017 19:24 #89896 by andypugh
andypugh replied the topic: Pokeys

DavidJ wrote: The line "sudo halcompile ./pokeys.comp"
Does the file name that I copy your driver code into have to be named to match part of that command ?


Yes, the file should be called "pokeys.comp". .comp is a file format that is converted into standard C-code by the LinuxCNC utility "halcompile". Normally halcmompile can also compile and install the .comp file directly, but it seems that this component needs some special compiler options to make it work.
The "./" means "in this directory" so you need to run the halcompile command from the same directory that you saved the pokeys.comp file into.

there a preferred location to place your code in, or doesn't it matter?
The multi-line command commencing gcc - does that have to be run from a particular directory ?

The multi-line command is the step that compiles the HAL component into an executable. It needs to be run from the same directory as the .c file created by the first stage ended up in.

Not sure I understand 'set "udev" rules' yet.

This is the step that gives the new component permission to handle the USB device.
More
21 Mar 2017 08:23 #89985 by DavidJ
DavidJ replied the topic: Pokeys
So the "udev" bit - do I need to be looking for general Linux information to help me with that, or is it LinuxCNC specific?
More
21 Mar 2017 16:41 - 21 Mar 2017 16:42 #90010 by fixer
fixer replied the topic: Pokeys
It is linux thing, on the second page of this topic.
I will add some additional information in first topic, so it will be more clear for begginers.


REEEN wrote: Finally I got it!
I needed to create a new udev rule:
Create a new file in the /etc/udev/rules.d named 90-usb-pokeys.rules with the following contents:
SUBSYSTEM=="usb", ATTRS{idVendor}=="1dc3", ATTRS{idProduct}=="1001", GROUP="plugdev", MODE="664"
Save the file, then execute
udevadm control --reload-rules
That's it!

Last Edit: 21 Mar 2017 16:42 by fixer.
Time to create page: 0.175 seconds
Powered by Kunena Forum