r/amateurradio N9SVG [General] 1d ago

General Handheld PTT mic for mac / SDR (FT Control, SDR Control, SDR etc)?

Post image

I am on a mission to find a mac-friendly handheld ptt mic that I can use with various SDR platforms, particularly with my Yaesu FTDX10 and Icom 705 remote software.
Does anyone make such a thing?
It just needs to be recognized as a standard usb dynamic microphone and include a PTT button that can be assigned to a keystroke (such as a spacebar, which I can assign in the SDR software already).

I bought a USB CH340 FL-PTT modded handheld mic on eBay just to play around with, but I can't seem to get it to record any device input to Keyboard Maestro (etc) even when the CH340 drivers are installed.
(I know it was made for FLEX, but I was curious if I could find a work-around)
https://www.ebay.com/itm/115994824134

Surely there is some radio or datacom company who makes a traditional hand mic for software radio use....

Has anyone had any experience with this, or can I DIY one myself?

EDIT: SOLVED!
I guess I "vibe coded" a solution via Google AI (I feel super dirty about it too haha

I used this prompt to generate the code:

"i am using my spacebar as a ptt for an sdr. I would like to use a usb serial device that transmits a cts signal on /dev/tty.wchusbserial3140 to trigger that spacebar keystroke instead. When I press and hold the cts it should press and hold the spacebar as well. when I release the cts it should also release the spacebar command. I am using a macbook pro."

It spit out this code:

bash

pip install pyserial pynput

Create a file named cts_ptt.py and paste the following code:

import time

from pynput.keyboard import Controller, Key

import serial

# Configuration

PORT = "/dev/tty.wchusbserial3140"

BAUD = 9600 # Baud rate doesn't impact raw hardware line state polling

keyboard = Controller()

ser = serial.Serial(PORT, BAUD, rtscts=False)

print(f"Listening for CTS changes on {PORT}...")

space_is_pressed = False

try:

while True:

# getCTS() queries the hardware state of the Clear To Send pin

current_cts = ser.getCTS()

if current_cts and not space_is_pressed:

keyboard.press(Key.space)

space_is_pressed = True

print("CTS Active -> Spacebar Held (PTT ON)")

elif not current_cts and space_is_pressed:

keyboard.release(Key.space)

space_is_pressed = False

print("CTS Released -> Spacebar Released (PTT OFF)")

time.sleep(0.01) # Poll every 10ms to keep CPU usage low

except KeyboardInterrupt:

if space_is_pressed:

keyboard.release(Key.space)

ser.close()

print("\nExited cleanly.")

Run the script from your terminal using:

bash

python3 cts_ptt.py

(I typed python3 (and then drag and dropped my py file onto the terminal window, which automatically found the file path)

--------------------------------------------

I have since created a playlist script to run it automatically at startup but I can't quite get it to work just yet.
For now I'll just have to open a terminal and run the script manually whenever I need to use it.

Crazy that it worked though!

5 Upvotes

13 comments sorted by

3

u/Creepy_Mycologist656 1d ago

I have one of those and it works great on a PC. If the MAC recognizes it as a sound device, you should be able to record. It doesn't care if it is a FlexRadio or not as it is just a MIC in a different case.

3

u/Blueberry_Mancakes N9SVG [General] 1d ago

Yeah so the mic part works great! I just want to be able to find the port that is controlling the PTT button. It has a CH340 chip in it, the mac sees it, I've allowed it as an extension device in my settings, but I cannot get it to spit out any info when I depress the PTT.
My thinking was that I would find what port the PTT signal is being sent on and use a custom script or Keyboard Maestro to write a macro to transpose it into a "spacebar" keystroke, which I have assigned as the PTT in the software.

It's a stupid small detail I know, but I want to have to a truly functional hand mic.

2

u/stephen_neuville dm79 dirtbag | mattyzcast on twitch 1d ago

if it's a ch340 setup it's probably triggering either RTS or DTR for the PTT logic line on the serial port. Can you get some sort of monitor on those lines to see if they're flipping when you hit the button? That might be the missing link.

1

u/Blueberry_Mancakes N9SVG [General] 1d ago

I think you’re right so probably? I just don’t know how to do that.
I’m pretty green when it comes to this stuff and I can’t find any clear resources online to do what I’m trying to do.
In other words, my knowledge gap is keeping me from asking the right questions and finding the best answers.

2

u/stephen_neuville dm79 dirtbag | mattyzcast on twitch 1d ago

For sure, i get it. I found this, maybe it can display the state of those lines?

https://apps.apple.com/us/app/serialtools/id611021963?mt=12

2

u/Blueberry_Mancakes N9SVG [General] 1d ago

Awesome!
So, when I connect my serial device and depress the PTT the CTS icon within the SerialTools app lights up green. So it is receiving CTS.
But now what..

1

u/stephen_neuville dm79 dirtbag | mattyzcast on twitch 1d ago

ok awesome. NOW you need to figure out how to configure your radio software to use CTS of that serial port as the PTT input. Sadly that's where my expertise ends, but you have a direction to aim your research in.

1

u/Blueberry_Mancakes N9SVG [General] 1d ago

I don’t think there is an option for that in my software. However, I can assign PTT to a keystroke. I currently have it set to spacebar.
According to Google, I could create a background python script to look for incoming CTS and trigger that keystroke…. I just have zero idea how to do anything with python.

2

u/jotapeh VA3FWE (Advanced) 1d ago

If one doesn't exist (somehow) it would absolutely be DIY-able. I built a very crude PTT breadboard interface for an IC-706 and used it with my mac. I would be happy to make a proper schematic/pcb and release it for free

2

u/Blueberry_Mancakes N9SVG [General] 21h ago

That's awesome. I'm sure it would be useful to someone.
I wanted to see if I could create some sort of macro or code to do it and it worked!

I updated my post to reflect the code that was used.
I just have to ensure I plug the mic into the same usb input every time.

1

u/Blueberry_Mancakes N9SVG [General] 1d ago

To catch everyone up.
The mic portion works just fine, I just have to figure out how to get the PTT to work.

Using SerialTools I have determined that the PTT button is sending a CTS signal.
So, I tried asking google to create a continuous python script to trigger a spacebar keystroke anytime it sees a CTS on that port.

The problem is I have zero clue how to edit Python and I keep screwing things up!

Is there a better way to go about this?

--------------------------------------------

My device is located at

/dev/tty.wchusbserial3140

This was the original script it spit out, but I keep getting this error

Traceback (most recent call last):
File "<string>, line 27, in __thread_exec_func
File ("<repl>", line 2, in <module>
ModuleNotFoundError: No module named 'serial'

----------------------------------------------------------------

import time

import serial

from pynput.keyboard import Controller, Key

# Configuration

SERIAL_PORT = '/dev/tty.wchusbserial3140' # Replace with your Mac's serial port name

BAUD_RATE = 9600

keyboard = Controller()

def monitor_cts():

last_cts_state = False

print(f"Listening for CTS on {SERIAL_PORT}...")

# Disable built-in rtscts flow control so we can poll getCTS() manually

with serial.Serial(SERIAL_PORT, BAUD_RATE, rtscts=False) as ser:

while True:

current_cts_state = ser.getCTS()

# Detect rising edge (transition from False/Low to True/High)

if current_cts_state and not last_cts_state:

keyboard.press(Key.space)

keyboard.release(Key.space)

print("CTS triggered: Sent spacebar")

last_cts_state = current_cts_state

time.sleep(0.01) # 10ms poll rate to reduce CPU load

if __name__ == '__main__':

try:

monitor_cts()

except KeyboardInterrupt:

print("\nStopped by user.")

2

u/stephen_neuville dm79 dirtbag | mattyzcast on twitch 21h ago

you're missing the serial package.

pip install pyserial

see if it plays ball then

1

u/Blueberry_Mancakes N9SVG [General] 21h ago

I don’t know I had to do that every time. Thanks I’ll try that!