Controlling pihpsdr with keyboard shortcuts.

432 views
Skip to first unread message

Lukasz Olszewski

unread,
Jan 25, 2025, 6:48:23 PMJan 25
to Hermes-Lite
Has anyone found a working solution to have let's say ctrl-space bar run mox when we're in any application?

Or to have a separate small keyboard with keys controlling pihpsdr regardless of what the main keyboard/mouse is doing?

I can see two possibilities . One is the cat interface. I imagine keystroke dam be logged with gnome to run scripts and these could talk to the cat interface to perform actions. But from past experience I know these actions may take unpredictable amount of time to complete . If one wants to press ptt, the last thing we want is half a second delay.

Pihpsdr has "midi"menu. This is exactly for various controllers (not sure why midi and not normal tcp connection). I imagine maybe there is some midi emulator we can bind with an additional (let's say numeric) keyboard and control the software.

Did anyone manage to do it?

73, Łukasz 

Mike Lewis

unread,
Jan 25, 2025, 7:14:47 PMJan 25
to Lukasz Olszewski, Hermes-Lite

The MIDI controller allows a very diverse set of solutions.  It is easy to program a small CPU to do what you need. 

 

Its main use in PiHPSDR is for “DJ” controllers.  They come in many sizes which provide encoders, sliders, and buttons.  Works in the other MIDI-supporting SDR apps as well.

 

The TeensyKeyer is an audio mixer and CW keyer that uses MIDI for controls and CW events. 

 

There are a lot of MIDI example programs for Arduino so you can build a control ‘pod’ of your liking pretty easily with any controls you prefer.

--
You received this message because you are subscribed to the Google Groups "Hermes-Lite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hermes-lite...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/hermes-lite/CACwB4R6khCPh-vTrXHmo1emV7cwfyNuTgsCvWBfzXD5OtLMAEg%40mail.gmail.com.

Ron Lewkowicz

unread,
Jan 25, 2025, 8:01:52 PMJan 25
to Hermes-Lite
For HID input devices like keyboard and mouse I'm not aware of any way to route a specific device to a specific app regardless of focus.  I expect this would have to be a function of the window manager. Not sure if it's actually even possible.  On my personal version of PiHPSDR I like to remove all the main key bindings and only leave the number pad key bindings as I've accidentally triggered MOX on a few occasions when going to type into a log or messaging app  forgetting that I've locked that into a layer over top of PiHPSDR. 

MIDI controllers work excellent with PiHPSDR.  I have a little DJ controller on my desk to control many functions while having the log in focus.  I believe that you can use more than one at a time and it's very simple to map the controls to actions in PiHPSDR.  It's also trivial to add new actions into PiHPSDR source code.  It seems that it must be a hardware MIDI device as listed by amidi -l   I've not had success getting it to recognize a virtual midi device.

The MIDI CW keyer built into PiHPSDR also, to me at least seems to operate with imperceptible latency on the side tone.  Someone doing 60-70wpm CW will likely disagree.  I do know that Christoph went to great lengths to minimize CW latency in PiHPSDR.

Lukasz Olszewski

unread,
Jan 25, 2025, 8:41:20 PMJan 25
to Mike Lewis, Hermes-Lite
Thanks for answering . No doubt it is a nice option if you want custom physical controls. Knobs and such.

At this stage I just wanted to be able to trigger ptt when I'm in a Web browser, or CQRLOG. No need for custom controls at this time.

Interestingly CAT control does exactly what I need. I wrote this short script to run PTT with left ctrl and space no matter the app I'm in. If anyone is interested and knows python it's on my github ( https://github.com/lukolszewski/keyrigcontrol )

73, Łukasz 

Ron Lewkowicz

unread,
Jan 25, 2025, 10:46:19 PMJan 25
to Hermes-Lite
Ummm, ok well you were asking about MOX before and now you are controlling PTT.   So a foot switch into the front panel jack would be another option.   I actually use VOX quite a bit.  Yes, interesting idea to intercept keystrokes and convert to rigctl.

Lukasz Olszewski

unread,
Jan 26, 2025, 4:34:16 AMJan 26
to Ron Lewkowicz, Hermes-Lite


On Sun, 26 Jan 2025, 04:46 Ron Lewkowicz, <ron.le...@gmail.com> wrote:
Ummm, ok well you were asking about MOX before and now you are controlling PTT.  

Isn't that the same thing? You press MOX button in piHPSDR and it has same function as holding PTT? What is the difference? 


So a foot switch into the front panel jack would be another option.   I actually use VOX quite a bit. 

I think that is pretty useful too, especially if your mic has a mute button. 

Yes, interesting idea to intercept keystrokes and convert to rigctl.
Thanks. 

73, Łukasz 

Ron Lewkowicz

unread,
Jan 26, 2025, 3:04:35 PMJan 26
to Hermes-Lite
Well, just semantics I suppose.  I guess a latching switch wired into the PTT jack would be MOX too.  .  Seriously consider  a MIDI controller though.  I went back and forth on this unsure if it was something I would find useful.  I found one for half price one day and decided to go for it. Surprisingly I really enjoy having it and use it all the time to quickly access many things.  The spinners for VFO is the one thing I rarely access, but all the knobs and buttons are very handy.

"Christoph v. Wüllen"

unread,
Jan 28, 2025, 9:57:16 AMJan 28
to Ron Lewkowicz, herme...@googlegroups.com


> Am 26.01.2025 um 21:04 schrieb Ron Lewkowicz <ron.le...@gmail.com>:
>
> Well, just semantics I suppose. I guess a latching switch wired into the PTT jack would be MOX too. . Seriously consider a MIDI controller though.

"MIDI controller" sounds so expensive, but in fact a $10 ArduinoMicro will do the job.

"Christoph v. Wüllen"

unread,
Jan 28, 2025, 11:52:07 AMJan 28
to Lukasz Olszewski, herme...@googlegroups.com
There are two different commands in piHPSDR that
can be assigned to buttons:

MOX = toggle PTT status upon PRESS, do nothing upon RELEASE

PTT = go TX upon press, go RX upon release

so PTT button that is to be pressed and held should be assigned
to the command PTT and not to MOX. For a toolbar button, PTT
is not practical here MOX is the better choice.

But would strongly recommend to RTMF before discussing such things
on the list.
> --
> You received this message because you are subscribed to the Google Groups "Hermes-Lite" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to hermes-lite...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/hermes-lite/CACwB4R6hPqsFbh%2BeDxY6k1N6HWyCM-9vytG%2BJ9Vwsd51fzsdpw%40mail.gmail.com.

Ron Lewkowicz

unread,
Jan 28, 2025, 12:22:51 PMJan 28
to "Christoph v. Wüllen", herme...@googlegroups.com
You also need things like knobs, buttons, switches etc.  A case to mount it all in.  Those little DJ midi controllers are layed out pretty well. I think I found the one I got marked down to about $50 CDN. That would be more like $30 in Donald Trump dollars.  When you are not on the radio you can take it to play your next Rave party. Works right out of the box with MIXXX.

Ed Grafton

unread,
Jan 28, 2025, 2:24:49 PMJan 28
to Hermes-Lite
A Teensy 4.1 has native MIDI/USB. Great little micro.

Ed

Gary Abercrombie

unread,
Jan 28, 2025, 2:54:25 PMJan 28
to Ed Grafton, Hermes-Lite
I added support in my CQSDR software for MIDI controllers.  I really like the DJ2GO2 for $89 USD as it has two control wheels and four banks of buttons.  Thetis needs some mods to support it however as MIDI events come in on multiple channels.


From: herme...@googlegroups.com <herme...@googlegroups.com> on behalf of Ed Grafton <yankn...@gmail.com>
Sent: Tuesday, January 28, 2025 11:24 AM
To: Hermes-Lite <herme...@googlegroups.com>
Subject: Re: Controlling pihpsdr with keyboard shortcuts.
 
--
You received this message because you are subscribed to the Google Groups "Hermes-Lite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hermes-lite...@googlegroups.com.

Lukasz Olszewski

unread,
Jan 29, 2025, 1:59:29 AMJan 29
to "Christoph v. Wüllen", Hermes-Lite


On Tue, 28 Jan 2025, 17:52 "Christoph v. Wüllen", <DL1...@darc.de> wrote:
There are two different commands in piHPSDR that
can be assigned to buttons:

MOX = toggle PTT status upon PRESS, do nothing upon RELEASE

PTT = go TX upon press, go RX upon release

so PTT button that is  to be pressed and held should be assigned
to the command PTT and not to MOX. For a toolbar button, PTT
is not  practical here  MOX  is the better choice.

But would strongly recommend to RTMF before discussing such things
on the list.

You do realise it us incredibly rude to tell someone to RTFM repeatedly when they fail to remember a small detail from said manual and they state at the very beginning they are just starting with this software. Saying it again and again basically has the same meaning as "you haven't committed the whole thing to memory word for word? STHU/GTFO" Last time I checked this mailing list was called "hermes-light" not pihpsdr. So absolute knowledge of the manual is not a requirement to post.

Regards,
Łukasz 




Lukasz Olszewski

unread,
Jan 30, 2025, 8:10:53 PMJan 30
to Ed Grafton, Hermes-Lite


On Tue, 28 Jan 2025, 20:24 Ed Grafton, <yankn...@gmail.com> wrote:
A Teensy 4.1 has native MIDI/USB. Great little micro.

Thanks, at the moment I bought the device suggested by Ron and while I like how it works in general I'd prefer something a lot smaller. In fact I'm most likely going back to a keyboard that's already on my desk (or a tiny numbers only one).

Regarding midi I wasn't looking to build one if one can be bought.

Does anyone know a midi controller that has only few buttons/knobs and is the rough size of a  mouse? I don't even need a jog wheel. I suppose not, because I haven't found any. I'm not surprised . Unless one really needs a knob/wheel why not use a keyboard/mouse?

To be honest, despite midi triggering my "oh, a cool gadget - look what I can do with it" response, I may just go back to my previous idea of using a standard usb input device like a numeric keyboard or a mouse and a script.

I've assigned all sorts of controls to the midi controller I have (it has two jog wheels, I had vfo freq and pan on them, 3 sliders - I had zoom, agc level and one free, 5 knobs - AF volume, rf gain, mic gain, tx drive, rit/xit, and many buttons for mox, band, filter menu,reset xit/rite, open agc menu, switch to tune and so on). Then I made a drawing with all my controls so I can see all of them and I barely used any except mox, volume and band button. I found I much prefer clicking on the waterfall than moving the vfo with a jog wheel. Unfortunately I have not found a way to assign different step sizes to two jog wheels for the same VFOs (to say a coarse and fine like I had on my kenwood ts-690s).

I found except mox I prefer to just use a mouse to set everything else. Why? Why is mox different ? Because I may want to start/stop transmit while I'm in another window like cqrlog.

Still I'm happy I tried a midi controller . At least I know what it's like and that it's not the best option for me.

73, Łukasz 

Lukasz Olszewski

unread,
Jan 30, 2025, 8:16:22 PMJan 30
to Ed Grafton, Hermes-Lite
By numeric keyboard I mean something like this:

73, Łukasz 

Mike Lewis

unread,
Jan 30, 2025, 8:25:47 PMJan 30
to Lukasz Olszewski, Ed Grafton, Hermes-Lite

The CTR2-MIDI or one of the other version controllers they have might be what you are looking for. 

 

I have the CTR2-MIDI and tried it with piHPSDR but I forget how it worked (or did not).  With Thetis, SparkSDR, Quisk and others SDR apps, they can interpret and assign the MIDI events differently such that this controller (or any controller) does not work well for every function in all apps.    They are all a bit different.  As a result I found I am not using mine like I hoped.  It has 2 MID outputs methods to try.  I got the kit, it was relatively low cost so I gave it a try.  I am sure it will find use later.  1 knob with push switch, 6 buttons surround it.  All can have dual function with push and long push actions.  The knob kicks inn a second set MIDI values and behavior with a push and turn action. 

--

You received this message because you are subscribed to the Google Groups "Hermes-Lite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hermes-lite...@googlegroups.com.

Ron Lewkowicz

unread,
Jan 31, 2025, 1:49:18 PMJan 31
to Hermes-Lite
Of the readily available commercially produced MIDI devices the DJ2GO2 or Starlight DJControl are about as small as I've been able to find.  You can find units with different control configurations like Korg nanoKontrol or Behringer X-Touch but they are roughly the same size.

You have kind of already answered why MIDI.  To provide quick access to controls when the SDR software is not your primary focus.  If you are only using PiHPSDR and have no other thing going then mouse is all you really need.  I wanted to be able to use the number keypad to directly enter frequency so I made a patch and Christoph accepted this idea.  

Originally, I could not see a reason to use MIDI control either, but then I got involved with Net control on a very busy HF net.  PiHPSDR now mostly gets shoved to the back on one of the desktops and things like live streaming, logging, back channel messaging took over.   If I need to adjust something I don't have time to switch back to PiHPSDR, grab my mouse and make the adjustment. 

PiHPSDR does not have many keyboard commands.  Heiko has added more in deskHPSDR however I find any of these can cause problems.  Some times the window you have in focus is not what you think.  Start typing and suddenly PiHPSDR goes into MOX or changes frequency unexpectedly.   Also many things compete for keyboard shortcuts like your desktop manager.  MIDI does not have any issue like this.  In general other than the number keypad I prefer to have a patch to remove all other keyboard control to prevent accidental mayhem.

Heath Petty

unread,
Jan 31, 2025, 2:18:47 PMJan 31
to Hermes-Lite
I bought one of these: https://www.crowdsupply.com/anavi-technology/anavi-macro-pad-10  It uses the RPI2040 microcontroller, which can be programmed to send MIDI commands. Its very much a DIY programming project, and I am far from finished, but its completely possible to roll your own mini midi controller for controlling hermes lite 2 applications.

-Heath

Mike Lewis

unread,
Jan 31, 2025, 2:28:51 PMJan 31
to Heath Petty, Hermes-Lite

Also for DIY pads

 

I use several of the I2CEncoder V2.1 with a Teensy 4 in my Teensy SDR project.  The Teensy supports MIDI and these are daisy-chained on i2C bus with 5 wires (pwr, signal, INT).    They can plug into each other or use cable to separate them.

I2C Devices – DuPPa

 

 

I use the RGB encoders with a variety of their large and small knobs.  I use the color for feedback. Blue during a push action, green when the value is in range, red when the end of range is reached.

 

 

Lukasz Olszewski

unread,
Jan 31, 2025, 4:00:36 PMJan 31
to Ron Lewkowicz, Hermes-Lite
You are of course right pihpsdr doesn't have many keyboard commands, but almost everything can be controlled via Cat (with rigctl/hamlib). I found it works pretty well if one has a script that monitors the keyboard and fires off commands via Cat in response to keystrokes. 

There is no need to switch windows or grab a mouse. That was the point of that script I mentioned in another post. The first iteration toggles MOX when ctrl-space was pressed. Regardless of the active window.

At the moment I have other things to work on (voice keys etc), but I'm likely to be coming back to it. 

I can definitely see both sides here. 

73, Łukasz 

Ron Lewkowicz

unread,
Jan 31, 2025, 4:29:12 PMJan 31
to Hermes-Lite
Yes, there is no wrong answer here. 

Converting key strokes to CAT is a great idea, but the coding for that is well beyond me.  I expect this must be limited to a very specific set of key strokes that won't do anything in any other application or control something in the window manager. 

I made a very simple action for voice keyer that I can assign to a MIDI key.  It simply uses aplay to play back a pre-recorded file.  I just switch on VOX and hit the key.  Once you make the audio connection from aplay to pihpsdr-TX the first time the RaySession manager I use will automatically make that connection henceforth.   So as you can see, pretty limited coding skills.

There is probably a lot more that could be done with MIDI in PiHPSDR if things like Jack MIDI and perhaps Jack audio were implemented, but when you start to get into these things your average Linux user might not have much experience with this.  Pipewire has made a lot of this much more simple.

Gary Abercrombie

unread,
Jan 31, 2025, 4:34:39 PMJan 31
to Ron Lewkowicz, Hermes-Lite
Have to say this was a very interesting way to inject midi keyboard commands to the application software but thuis took thousands of lines of code to accomplish in this manner.

I chose to simply emit signals into my sdr software when certain midi controls were received.  No need for virtual com ports, database functions, latency, etc.

--
You received this message because you are subscribed to the Google Groups "Hermes-Lite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hermes-lite...@googlegroups.com.

Lukasz Olszewski

unread,
Feb 1, 2025, 6:11:59 AMFeb 1
to Gary Abercrombie, Ron Lewkowicz, Hermes-Lite


On Fri, 31 Jan 2025, 22:34 Gary Abercrombie, <gab...@gmail.com> wrote:
Have to say this was a very interesting way to inject midi keyboard commands to the application software but thuis took thousands of lines of code to accomplish in this manner.
I may be misunderstanding, but are you talking about monitoring the keyboard when the software is not in focus?

The only disadvantage is that it has to be run as root (show stopper for some) but it literally took few lines of python to monitor the device. The version on my github is opening the keyboard non-exclusively so the shortcuts used have to be chosen such that they have no meaning to other software used, but I have another unpublished version I use with the tiny numeric keyboard where I intercept the whole thing so the keystrokes never arrive anywhere else. So Enter can be used or any other key. The whole script is about 100 lines. 

Or you may be talking about the midi part (emulating a device). That I know nothing about .



I chose to simply emit signals into my sdr software when certain midi controls were received.  No need for virtual com ports, database functions, latency, etc.

Regarding latency, there is some for sure. I think about 100ms. I have to add it in front of playing the audio (now talking about the voice key stuff rather than cat control on its own). Or when I transmit my call sign the first letter is lost.

I might publish the exclusive keyboard lock script and the voice key script on github later. I hate coming across threads like this a year later thinking "man, I could really use this" and it has something like "contact me for code". No one expects to be contacted for code they mentioned a year ago on the mailing list :-).


73, Łukasz 


DL1YCF

unread,
Feb 1, 2025, 7:00:52 AMFeb 1
to Lukasz Olszewski, Ron Lewkowicz, Gary Abercrombie, herme...@googlegroups.com

Perhaps I should explain something about my view on keyboard control
for piHPSDR:

a) it is *very* easy to add keyboard shortcuts to pihpsdr. BUT, note that
people are already complaining because they un-intentionally started
TX by pressing the space bar

b) I *never* use the keyboard to control piHPSDR. When doing a contest for
example, the contest logger window is *always* in the focus since I depend
on that CW is emitted upon pressing a function key, or that a call sign
is input at the proper place the moment I copy it. In a contest there is
no time to click with the mouse into the pihpsdr window, then do some
keyboard work, and then click back into the contest logger program and
hit the tiny call sign input text field.

c) mouse is different, because mouse events are sent to the application that
is „under the mouse“. Thus, I can control the contest logging program with
the keyboard while the mouse is over the piHPSDR and I can change
frequency with the mouse wheel. But beware, I MUST NOT CLICK into the
pihpsdr window else I loose control over the contest logger program.


If you only run pihpsdr on the computer full-screen this is a totally different
situation, but my standard setup is to run pihpsdr alongside with loggers and
digimode programs, and there keyboard control of pihpsdr is not what I want.

And if all this boils down to use a *separate* keyboard for controlling pihpsdr,
you can easily find a USB-connected microcontroller which itself can be connected
to a keyboard and translates keyboard events into something useful, but then
this is just an inferior realisation of a MIDI console.

So in short, keyboard control is not on the top of my priority list.


Lukasz Olszewski

unread,
Feb 1, 2025, 7:11:41 AMFeb 1
to DL1YCF, Ron Lewkowicz, Gary Abercrombie, Hermes-Lite
After I saw what is possible with CAT with piHPSDR I personally don't mind the lack of lots and lots of keyboard shortcuts any more. Although I can write some code to add it if needed.

73, Łukasz 



brhl...@gmail.com

unread,
Feb 1, 2025, 7:48:04 AMFeb 1
to Hermes-Lite
This is an excellent midi controller for pihpsdr.
Its working flawless with me.

ron.ni...@gmail.com

unread,
Feb 1, 2025, 1:51:15 PMFeb 1
to Hermes-Lite
I currently don't have any support for keyboard commands in my iOS SDR app because I almost never have a keyboard connected to my iPhone or iPad.  But if you did have a keyboard connected (via Bluetooth, etc.), what keyboard commands would find important to have?  MOX?  Or ???
Thanks and 73, Ron, n6ywu

Reply all
Reply to author
Forward
0 new messages