Help with a RS-232 Number pad and Linux

GivenZane

20 Jun 2021, 06:35

Hi everyone!

I recently acquired a Qtronix QX-822R with Aristotle switches with the intent of using it with my laptop. I daily drive linux and I didn't expect it to be as difficult as it has been to get it up and working. I've been working on it all day with only minimal success.

I found this web page from 15+ years ago and it helped somewhat, but I'm currently running into the issue where the C code compiles but it can't access my USB to Serial adapter.

http://www.linuxtoys.org/keypad/keypad.html

I am hoping that someone might be able to help me figure this out.

Thanks in advance!
--Cheers
--Given

Edit: I forgot to attach the pictures.
200528868_183771667087395_1331610269187604246_n.jpg
200528868_183771667087395_1331610269187604246_n.jpg (75.27 KiB) Viewed 287 times
199060814_504307667462374_2925954625813717956_n.jpg
199060814_504307667462374_2925954625813717956_n.jpg (59.95 KiB) Viewed 287 times
131681362_1455402961506896_3480724319831298314_n.jpg
131681362_1455402961506896_3480724319831298314_n.jpg (44.91 KiB) Viewed 287 times

MMcM

20 Jun 2021, 09:18

GivenZane wrote:
20 Jun 2021, 06:35
it can't access my USB to Serial adapter.
Do you get the generic error (no perror, no errno display) that code returns?

Code: Select all

Unable to open tty port specified
Is the logged in user a member of the group that owns the serial port device, usually dialout?

User avatar
maxmalkav
dye hard

20 Jun 2021, 17:39

I hope I am not going to say something too wrong :-)

I have briefly checked the C code, it seems like a proof of concept to manage the device at very low level, it does not look even like a proper driver. While interesting, it may not help you too much to have the serial numpad working, unless you invest considerable coding.

I was thinking that maybe this serial numpad is supported as input device by Xorg without much problem (not even needing you compile drivers, just dropping the right configuration parameters). This link describes a different situation, but I think it shares some interesting similarities: https://quorten.github.io/quorten-blog1 ... org-serkbd

Initially you should be able to use the device associated to your USB/serial converter like a regular serial device (just make sure you are pointing to the right device in /dev/). The most interesting part of the article above is that you may find some device similar enough to your numpad to make this instruction work for you:

Code: Select all

inputattach --baud 2400 --<some_device_that_works_similar_to_your_numpad> /dev/ttyUSB0
My closest experience with something like this was using a serial mouse with NetBSD, but in that case I was using proper RS-232 hardware. In my case it was a matter of finding the proper X11 configuration.
Last edited by maxmalkav on 20 Jun 2021, 17:53, edited 1 time in total.

User avatar
maxmalkav
dye hard

20 Jun 2021, 17:48

As crazy experimentation, maybe you can register the numpad as input device using some of the device models from this list: https://wiki.archlinux.org/title/Serial ... rnel_input

GivenZane

20 Jun 2021, 23:24

MMcM wrote:
20 Jun 2021, 09:18
GivenZane wrote:
20 Jun 2021, 06:35
it can't access my USB to Serial adapter.
Do you get the generic error (no perror, no errno display) that code returns?

Code: Select all

Unable to open tty port specified
Is the logged in user a member of the group that owns the serial port device, usually dialout?
Hi MMcM,
I'm a member of the group and i confirmed this by checking my groups and connecting a microsoft serial mouse. Even when I edited the code to bypass the errors I would just get all of them in a row and then it would just read 0x00. So I did wonder if it's because I'm using a USB Serial adapter? It shows up as a normal tty port so I'm not sure. I'm going to get one of my computers with onboard serial out later tonight and see where that gets me.

Thank You!
--Given
maxmalkav wrote:
20 Jun 2021, 17:39
I hope I am not going to say something too wrong :-)

I have briefly checked the C code, it seems like a proof of concept to manage the device at very low level, it does not look even like a proper driver. While interesting, it may not help you too much to have the serial numpad working, unless you invest considerable coding.

I was thinking that maybe this serial numpad is supported as input device by Xorg without much problem (not even needing you compile drivers, just dropping the right configuration parameters). This link describes a different situation, but I think it shares some interesting similarities: https://quorten.github.io/quorten-blog1 ... org-serkbd

Initially you should be able to use the device associated to your USB/serial converter like a regular serial device (just make sure you are pointing to the right device in /dev/). The most interesting part of the article above is that you may find some device similar enough to your numpad to make this instruction work for you:

Code: Select all

inputattach --baud 2400 --<some_device_that_works_similar_to_your_numpad> /dev/ttyUSB0
My closest experience with something like this was using a serial mouse with NetBSD, but in that case I was using proper RS-232 hardware. In my case it was a matter of finding the proper X11 configuration.
maxmalkav wrote:
20 Jun 2021, 17:48
As crazy experimentation, maybe you can register the numpad as input device using some of the device models from this list: https://wiki.archlinux.org/title/Serial ... rnel_input

Hi Maxmalkav,

The C code is for sure a proof of concept type of driver. Honestly, I thought about it a lot and I think my best course of action will to be modify the InputAttach code to include this. Then compile it and use that. The code looks fairly straightforward and easy to cludge my code onto. I'm quite familiar with coding, just not to much with writing drivers, so it's a good learning experiment if nothing else.

I did try every inputattach device on the list and it sends different scan codes to everything and runs at a different baud rate, so no luck there. I read over everything in that list and couldn't find anything really all that similar that would work. I think this is going to be a custom deal.

Now I had a crazy Idea. There is enough room in the case for a Teensy, so I'm thinking about trying to get it working with one of those and converting it to USB at the same time. I'm thinking I could use the Soarers firmware to help with that, but I haven't done enough research yet to find out for sure.

If all else fails I can always use bodge wires attached to the matrix to bypass the controller and use the teensy as a controller. I would love to avoid that if possible though. I wanted something nice to use with my laptop that wasn't too much work LOL

Thank you!
--Cheers
--Given

Edit:
I did confirm it works using InputAttach -baud 9600 --dump. It dumps the correct hex codes so that's not the issue with the device it's self.

Does anyone know if there's a program like SerialKeys on Linux? It's a program in windows that would probably work for my needs?

Thanks!
--Given

Post Reply

Return to “Workshop”