Question about keyboard for cnc build
16 Feb 2020 22:01 #157524
by bymccoy
I do have pics, but it's basically a PIC, a serial interface etc. The keyboard is of course a row/col matrix, but the hardware is doing just fine. The serial interface works perfectly - the cable etc is a regular one, and I've got a couple of serial interfaces on the industrial PC's that I use.
The only real question is how I can get the ASCII from the serial interface and into LinuxCNC.
It would seem one option is to somehow get it to appear as a serial keyboard (well, it basically is a traditional serial keyboard!) and then use HAL_input to access the input device. As that seems a bit hokey and going to require building kernel drivers etc (there's got to be something out there already?!), the easiest options are:
a) a standalone python script that uses the linuxcnc module, and listens to the serial interface. It can then be mapped to pins accordingly - I do need to figure out how to interact with the Axis UI (ie flipping between menus), but I can always extend Axis to use pins to determine the menu to show etc.
b) an extension menu/module for Axis using python - pretty much as above, but run as a menu/integral script.
Not a big job really, but it's figuring the most lazy/efficient way of getting the ASCII characters into the right place. Nicely, the keyboard generates both keydown and keyup characters, so I can have modifiers, or have repeats on axis nudging for example (ie keep moving the axis until keyup).
These keyboards are very nice, so if this works well I'll be lining up to get a few more
Replied by bymccoy on topic Question about keyboard for cnc build
Can out get physical access to the row\col of the keyboard matrix ? if so a 7i73 could be the answer if you are going the MESA route of a custom USB solution, Arduino ProMicro or another mcu that has native USB.
Or as per your solution an MCU reading the serial and connecting via USB.
Any pics of the guts of the device ?
I do have pics, but it's basically a PIC, a serial interface etc. The keyboard is of course a row/col matrix, but the hardware is doing just fine. The serial interface works perfectly - the cable etc is a regular one, and I've got a couple of serial interfaces on the industrial PC's that I use.
The only real question is how I can get the ASCII from the serial interface and into LinuxCNC.
It would seem one option is to somehow get it to appear as a serial keyboard (well, it basically is a traditional serial keyboard!) and then use HAL_input to access the input device. As that seems a bit hokey and going to require building kernel drivers etc (there's got to be something out there already?!), the easiest options are:
a) a standalone python script that uses the linuxcnc module, and listens to the serial interface. It can then be mapped to pins accordingly - I do need to figure out how to interact with the Axis UI (ie flipping between menus), but I can always extend Axis to use pins to determine the menu to show etc.
b) an extension menu/module for Axis using python - pretty much as above, but run as a menu/integral script.
Not a big job really, but it's figuring the most lazy/efficient way of getting the ASCII characters into the right place. Nicely, the keyboard generates both keydown and keyup characters, so I can have modifiers, or have repeats on axis nudging for example (ie keep moving the axis until keyup).
These keyboards are very nice, so if this works well I'll be lining up to get a few more
Please Log in or Create an account to join the conversation.
- BeagleBrainz
- Offline
- User is blocked
Less
More
- Posts: 1437
- Thank you received: 570
16 Feb 2020 22:40 #157525
by BeagleBrainz
Replied by BeagleBrainz on topic Question about keyboard for cnc build
What about a custom Hal comp that presents each key or modifier and key as a Hal pin ?
Python should be able to handle that.
Python should be able to handle that.
Please Log in or Create an account to join the conversation.
17 Feb 2020 03:20 #157556
by rodw
I think to do what you want to do it will be a user space (non-real time) compnent written in Python. There are a number of examples of talking to a serial device eg:
github.com/LinuxCNC/linuxcnc/blob/master..._comps/mitsub_vfd.py
but I don't know about a keyboard.
The 7i73 route will be real time and include the ability to manage MPG's and LCD's etc.
Replied by rodw on topic Question about keyboard for cnc build
Can out get physical access to the row\col of the keyboard matrix ? if so a 7i73 could be the answer if you are going the MESA route of a custom USB solution, Arduino ProMicro or another mcu that has native USB.
Or as per your solution an MCU reading the serial and connecting via USB.
Any pics of the guts of the device ?
I do have pics, but it's basically a PIC, a serial interface etc. The keyboard is of course a row/col matrix, but the hardware is doing just fine. The serial interface works perfectly - the cable etc is a regular one, and I've got a couple of serial interfaces on the industrial PC's that I use.
The only real question is how I can get the ASCII from the serial interface and into LinuxCNC.
I think to do what you want to do it will be a user space (non-real time) compnent written in Python. There are a number of examples of talking to a serial device eg:
github.com/LinuxCNC/linuxcnc/blob/master..._comps/mitsub_vfd.py
but I don't know about a keyboard.
The 7i73 route will be real time and include the ability to manage MPG's and LCD's etc.
Please Log in or Create an account to join the conversation.
27 Feb 2020 13:25 #158633
by andypugh
Replied by andypugh on topic Question about keyboard for cnc build
If you can get scan-codes in to LinuxCNC HAL then the matrix_kb component can make them in to HAL pin state changes.
Please Log in or Create an account to join the conversation.
- robertspark
- Offline
- Platinum Member
Less
More
- Posts: 915
- Thank you received: 216
12 Mar 2021 13:11 #201957
by robertspark
Replied by robertspark on topic Question about keyboard for cnc build
Attachments:
Please Log in or Create an account to join the conversation.
12 Mar 2021 13:28 #201960
by andypugh
14 x 8 matrix, so I guess that it might be straight-wired to the 25-pin D-sub.
But if it is, it can't be a parport pinout.
I would think that burying a 7i73 inside would be one answer, but an arduino or similar would be cheaper.
Replied by andypugh on topic Question about keyboard for cnc build
I've got one of these denford desktop / desk-top tutor keyboards too.
14 x 8 matrix, so I guess that it might be straight-wired to the 25-pin D-sub.
But if it is, it can't be a parport pinout.
I would think that burying a 7i73 inside would be one answer, but an arduino or similar would be cheaper.
Please Log in or Create an account to join the conversation.
- robertspark
- Offline
- Platinum Member
Less
More
- Posts: 915
- Thank you received: 216
12 Mar 2021 13:30 - 12 Mar 2021 13:31 #201961
by robertspark
Replied by robertspark on topic Question about keyboard for cnc build
Last edit: 12 Mar 2021 13:31 by robertspark.
Please Log in or Create an account to join the conversation.
- robertspark
- Offline
- Platinum Member
Less
More
- Posts: 915
- Thank you received: 216
12 Mar 2021 13:34 #201965
by robertspark
Replied by robertspark on topic Question about keyboard for cnc build
I have thought about an arduino micro ATmega32u4 as it has a built in keyboard emulator capability..... but that may interfear with keyboard shortcuts?? in LinuxCNC
Pokeys 57U and Teensy are also similar keyboard emulator options.
I'll see if I can get the ASCII codes as I'd like to have a neat solution available as a cnc keyboard for shortcut buttons.
{early days for me + linuccnc, still learning about hal at the moment}
Pokeys 57U and Teensy are also similar keyboard emulator options.
I'll see if I can get the ASCII codes as I'd like to have a neat solution available as a cnc keyboard for shortcut buttons.
{early days for me + linuccnc, still learning about hal at the moment}
Please Log in or Create an account to join the conversation.
12 Mar 2021 13:48 #201966
by andypugh
One reason to like the 7i73 in this application is that the button presses stay in the realtime layer until you deliberately link them to user-space.
There are ways to achieve the same thing with a uC but I think that you would lose that with keyboard emulation..
Replied by andypugh on topic Question about keyboard for cnc build
I have thought about an arduino micro ATmega32u4 as it has a built in keyboard emulator capability..... but that may interfear with keyboard shortcuts?? in LinuxCNC
One reason to like the 7i73 in this application is that the button presses stay in the realtime layer until you deliberately link them to user-space.
There are ways to achieve the same thing with a uC but I think that you would lose that with keyboard emulation..
The following user(s) said Thank You: robertspark
Please Log in or Create an account to join the conversation.
- robertspark
- Offline
- Platinum Member
Less
More
- Posts: 915
- Thank you received: 216
12 Mar 2021 15:13 #201980
by robertspark
Replied by robertspark on topic Question about keyboard for cnc build
Please Log in or Create an account to join the conversation.
Time to create page: 0.242 seconds