SmartSDR v4.0.1 and the SmartSDR v4.0.1 Release Notes
SmartSDR v3.10.15 and the SmartSDR v3.10.15 Release Notes
The latest 4O3A Genius Product Software and Firmware
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
- 363 Community Topics
- 2.1K New Ideas
- 624 The Flea Market
- 8.1K Software
- 68 SmartSDR+
- 6.4K SmartSDR for Windows
- 181 SmartSDR for Maestro and M models
- 420 SmartSDR for Mac
- 270 SmartSDR for iOS
- 253 SmartSDR CAT
- 188 DAX
- 379 SmartSDR API
- 9.3K Radios and Accessories
- 30 Aurora
- 233 FLEX-8000 Signature Series
- 7.2K FLEX-6000 Signature Series
- 930 Maestro
- 53 FlexControl
- 863 FLEX Series (Legacy) Radios
- 908 Genius Products
- 460 Power Genius XL Amplifier
- 328 Tuner Genius XL
- 120 Antenna Genius
- 291 Shack Infrastructure
- 204 Networking
- 447 Remote Operation (SmartLink)
- 142 Contesting
- 769 Peripherals & Station Integration
- 139 Amateur Radio Interests
- 988 Third-Party Software
