Question about keyboard for cnc build

More
16 Feb 2020 22:01 #157524 by bymccoy

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 :D

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

More
16 Feb 2020 22:40 #157525 by BeagleBrainz
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.

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

More
17 Feb 2020 03:20 #157556 by rodw

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.

More
27 Feb 2020 13:25 #158633 by andypugh
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.

More
12 Mar 2021 13:11 #201957 by robertspark
I've got one of these denford desktop / desk-top tutor keyboards too.



Attachments:

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

More
12 Mar 2021 13:28 #201960 by andypugh

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.

More
12 Mar 2021 13:30 - 12 Mar 2021 13:31 #201961 by robertspark
8 x 14 matrix (112 buttons available)

as can be seen there is a 22 pin I/O interface (8x14 matrix??) from the keyboard to the microcontroller.

I will see if I can get the ASCII codes for each of the buttons in the matrix.


Attachments:
Last edit: 12 Mar 2021 13:31 by robertspark.

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

More
12 Mar 2021 13:34 #201965 by robertspark
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}

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

More
12 Mar 2021 13:48 #201966 by andypugh

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.

More
12 Mar 2021 15:13 #201980 by robertspark
Attachments:

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

Time to create page: 0.242 seconds
Powered by Kunena Forum