SmartSDR v4.2.18 | SmartSDR v4.2.18 Release Notes
SmartSDR v3.10.15 | SmartSDR v3.10.15 Release Notes
The latest 4O3A Genius Product Software:
The latest 4O3A Genius Product Software and Firmware
If you are needing assistance with FlexRadio products, please refer to the product documentation or check the Help Center for known solutions. 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
- 393 Community Topics
- 2.2K New Ideas
- 668 The Flea Market
- 8.5K Software
- 174 SmartSDR+
- 6.5K SmartSDR for Windows
- 191 SmartSDR for Maestro and M models
- 450 SmartSDR for Mac
- 276 SmartSDR for iOS
- 266 SmartSDR CAT
- 215 DAX
- 389 SmartSDR API
- 9.5K Radios and Accessories
- 70 Aurora
- 317 FLEX-8000 Signature Series
- 7.2K FLEX-6000 Signature Series
- 981 Maestro
- 58 FlexControl
- 869 FLEX Series (Legacy) Radios
- 952 Genius Products
- 474 Power Genius XL Amplifier
- 349 Tuner Genius XL
- 129 Antenna Genius
- 311 Shack Infrastructure
- 217 Networking
- 474 Remote Operation (SmartLink)
- 143 Contesting
- 833 Peripherals & Station Integration
- 146 Amateur Radio Interests
- 1.1K Third-Party Software
