SmartSDR v3.9.18 and the SmartSDR v3.9.18 Release Notes
SmartSDR v2.12.1 and the SmartSDR v2.12.1 Release Notes
Power Genius XL Utility v3.8.9 and the Power Genius XL Release Notes v3.8.9
Tuner Genius XL Utility v1.2.11 and the Tuner Genius XL Release Notes v1.2.11
Antenna Genius Utility v4.1.8
Need technical support from FlexRadio? It's as simple as Creating a HelpDesk ticket.
New USB passthough question
I have a sainsmart USB relay board I control via a small python program locally in the shack. I would like to be able to conroling using the new pass through feature as I seem to do most of my operating on my laptop now away ffrom the shack. When I configure the passthough based on the discussion it seems to set up correcty but the program soesn't work. It tells be there are not ftdi devices. My radio can switch the relays without any problem. Any ideas
Answers
-
btw here is the pyhon code that works locally
import customtkinter as ctk
import ftd2xx
import osRELAY_COUNT = 8
LABEL_FILE = "relay_labels.txt"relay_labels = []
relay_states = [False] * RELAY_COUNT
buttons = []
ftdi = Nonedef load_labels():
labels = [f"Relay {i+1}" for i in range(RELAY_COUNT)]
if os.path.exists(LABEL_FILE):
with open(LABEL_FILE, "r") as f:
lines = f.readlines()
for i in range(min(RELAY_COUNT, len(lines))):
clean = lines[i].****()
if clean:
labels[i] = clean
return labelsdef connect_ftdi():
global ftdi
try:
ftdi = ftd2xx.open(0)
ftdi.setBitMode(0xFF, 0x01)
status_label.configure(text="Connected to FTDI relay board")
turn_all_off()
for btn in buttons:
btn.configure(state="normal")
except Exception as e:
status_label.configure(text=f"FTDI connection failed: {e}")
for btn in buttons:
btn.configure(state="disabled")def update_relay_outputs():
if ftdi:
mask = 0x00 # All OFF
for i, state in enumerate(relay_states):
if state:
mask |= (1 << i) # HIGH = ON
else:
mask &= ~(1 << i) # LOW = OFF
ftdi.write(bytes([mask]))def make_toggle(relay_id):
def toggle():
for i in range(RELAY_COUNT):
relay_states[i] = (i == relay_id - 1)
buttons[i].configure(fg_color="green" if relay_states[i] else "gray")
update_relay_outputs()
return toggledef turn_all_off():
for i in range(RELAY_COUNT):
relay_states[i] = False
buttons[i].configure(fg_color="gray")
update_relay_outputs()ctk.set_appearance_mode("dark")
ctk.set_default_color_theme("blue")
app = ctk.CTk()
app.title("Antenna Relay Selector")
app.geometry("400x650")relay_labels = load_labels()
for i in range(RELAY_COUNT):
btn = ctk.CTkButton(
app,
text=relay_labels[i],
fg_color="gray",
state="disabled",
command=make_toggle(i + 1)
)
btn.pack(pady=6, padx=20, fill='x')
buttons.append(btn)status_label = ctk.CTkLabel(app, text="Not connected")
status_label.pack(pady=20)connect_ftdi()
app.mainloop()
if ftdi:
ftdi.write(bytes([0x00])) # All relays OFF
ftdi.close()0 -
Sorry to be the bearer of bad news, but it looks like this script is talking directly to the FTDI drivers (e.g. not via the serial interface). As such, I'm don't think that this is going to work through the passthrough interface as what is exposed on the client side for passthrough cables is just a serial port (as opposed to a full USB device). I suspect this is why the script is complaining that there are no FTDI devices as this is accurate from the local point of view when the Sainsmart device is plugged into the radio.
0 -
it seems the sainsmart cards that look exactly alike come with two different chips sets… one will except serial commands, the one I have onky excepts ftdi links with precludes the pass though…. looking at options
0
Leave a Comment
Categories
- All Categories
- 325 Community Topics
- 2.1K New Ideas
- 590 The Flea Market
- 7.8K Software
- 6.2K SmartSDR for Windows
- 165 SmartSDR for Maestro and M models
- 394 SmartSDR for Mac
- 260 SmartSDR for iOS
- 246 SmartSDR CAT
- 178 DAX
- 368 SmartSDR API
- 9K Radios and Accessories
- 14 Aurora
- 150 FLEX-8000 Signature Series
- 7.1K FLEX-6000 Signature Series
- 906 Maestro
- 50 FlexControl
- 854 FLEX Series (Legacy) Radios
- 865 Genius Products
- 444 Power Genius XL Amplifier
- 307 Tuner Genius XL
- 114 Antenna Genius
- 273 Shack Infrastructure
- 193 Networking
- 437 Remote Operation (SmartLink)
- 135 Contesting
- 715 Peripherals & Station Integration
- 135 Amateur Radio Interests
- 938 Third-Party Software