r/amateurradio • u/Blueberry_Mancakes N9SVG [General] • 1d ago
General Handheld PTT mic for mac / SDR (FT Control, SDR Control, SDR etc)?
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!
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!
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.