Pokeys
It compiled fine and I installed the latest comp file which supports encoders. (P10 one does not.)
I ran up an axis sim and edited the axis_mm.ini file to load a new hal file and added the setp for the serial number in there.
AThis refused to load with a pin not found error.
So in V2.9, you can set a pin in halshow. So I set the serial number in there and the alive pin started to flash so it was a win.
I am going to try setting a time delay for a few seconds off motion.enable and use a mux2 to set the serial number.
I am guessing the user environment is not loaded when we try and set the pin later in the load.
Is there any other ways to set a pin after the iserspace is loaded?
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
I recently joined the club of Pokeys users as I want to retrofit a smaller lathe machine. First of all: thank you all for the great work, explanations and support within this thread. What you guys are doing is great! (I think there should be a donate button somewhere).
First I would like to start with my setup and how I installed the libraries:
- Lenovo Think Centre M710q (which I also used for my CNC and which I think are great for that purpose)
- LinuxCNC 2.8.4 Debian 10 Buster PREEMPT-RT
- Pokeys 57CNC V2.0
Everything runs without error, I can start LinuxCNC and the alive bit is blinking while the error bit is false. I can see all the Input and Outputs and numerous other features that were implemented. BUT if an input is triggered on the pokeys board there is no reaction within halshow. I can also set an output or relay by using setp and it goes without error within linux but pokeys is not reacting. The setup of the pins was done in advance in the windows software from pokeys.
The only error I am getting now is when starting gmocappy it tells me HAL: ERROR: duplicate component name 'pokeys' which i cannot figure out how to resolve.
Do you have any suggestions?
I performed following steps for installation as described on page 10:
1.) Install dev
sudo apt install linuxcnc-uspace-dev
2.) Install repositories
sudo apt-get install git build-essential libusb-1.0-0 libusb-1.0-0-dev
git clone https://github.com/zarfld/pokeyslib
cd pokeyslib
sudo make -f Makefile.noqmake install
git clone https://github.com/zarfld/LinuxCnc_PokeysLibComp
cd LinuxCnc_PokeysLibComp
sudo halcompile --install pokeys.comp
5) To enable RW permission for USB device, you also need to set "udev" rules in linux:
Create a new file in the
/etc/udev/rules.d
90-usb-pokeys.rules
SUBSYSTEM=="usb", ATTRS{idVendor}=="1dc3", ATTRS{idProduct}=="1001", GROUP="plugdev", MODE="666"
udevadm control --reload-rules
loadusr pokeys
setp pokeys.0.devSerial 12345
Please Log in or Create an account to join the conversation.
i observed that problem also - usually directly after i compiled that component, or at the first attempt to start after reboot.
I assumed that this was caused by the lot of tries and different versions i tested and compiled on my machine. But as it did not occure on the second try, i did not invest a lot of time to investigate about the real reason.
I'm still not sure if this message means that "there is a second Component registered with the same name", or that theres already a component running somewhere in background.
in your "performed following steps for installation" section i saw that you are using "github.com/zarfld/pokeyslib", pleasew don't use that one. This was just a try to workaround some problems that i had at that time, these issues have been reported to Matevz Bosnak (i think he works for PoLabs) and are solved in the meanwhile already.
i think it is better to use the "bitbucket.org/mbosnak/pokeyslib/src/master/" version, even if the differences may not relevant in the moment.
BR
Dominik
Please Log in or Create an account to join the conversation.
Thank you for the quick response.
Is it okay to use your component github.com/zarfld/LinuxCnc_PokeysLibComp after installing the library from mbosnak?
And is halcompile sufficient for your component or do I need to use the pokeyslib.h file from zarfld / LinuxCnc_PokeysLibComp ?
Your component seems to be quite advanced and to implement all the features of the pokeys board which is why I want to use it.
Or is there any other comp-file which I am missing so far?
Cheers
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Thanks for the clarification. When I use your simple comp file from page 14 it works and I can see the Inputs when 5V is applied on the board.
When I use the comp file from github.com/zarfld/LinuxCnc_PokeysLibComp , which is much more complex I get the blinking alive bit, no error and see all the features of the board but when 5V is applied to the inputs there is nothing happening.
When I had a look to the comp file I found that two lines related to Input and Output are commented. When uncommenting them and re-compiling the inputs are working...
Is this comp file still a working copy or should it work as it is?
line 343: //pin out bit Pins.#.DigitalValueGet [55];
line 347: //pin in bit Pins.#.DigitalValueSet [55];
Please apologize for my lack in understanding. I still try to understand how the pokeys stuff is working. Up to now I only worked with linuxcnc ethercat which is also quite nice once established though much more expensive.
Cheers
Please Log in or Create an account to join the conversation.
no need to apologize.
on these Channels i just changed the naming.
they are now named like
orpokeys.[DevID].digin.[PinID].in bit State of the hardware input
pokeys.[DevID].digin.[PinID].in-not bit Inverted state of the input.
if you just comment the these two lines then only the pins are being createdpokeys.[DevID].digout.[PinID].out
but the bit digitalIn or digital out are not read. (you would need to uncomment the lines 2319 and 2325 to get the digitalinputs updated)pokeys.[DevID].Pins.[PinID].DigitalValueGet
pokeys.[DevID].Pins.[PinID].DigitalValueSet
but i would suggest just to use the newly named digital inputs in your HAL-Fileif (DigitalIOGet = true) { if (dev->Pins.DigitalValueGet == 0) { //Pins_DigitalValueGet(i)=false; digin_in(i) = false; digin_in_not(i) = true; } else { //Pins_DigitalValueGet(i)=true; digin_in(i) = true; digin_in_not(i) = false; } }
(as the COMP was growing and complexity increased i tried to follow linuxcnc.org/docs/2.6/html/hal/canonical..._id_sec_canondigin_a , and hope my interpretation was right so far)
BR
Dominik
Please Log in or Create an account to join the conversation.