Python script for controlling relays using SDRAngel reverse API


James Dallas
 

Hi everyone:

Here is my first stab at a script for controlling USB relay control boards using the SDRAngel reverse API.


I have only tested it on Linux (Ubuntu 18.04).

So far, I have been able to control both a single-channel CH341 "LCUS-1" device as well as a four-channel FTDI FT245R "1982-USB4CH" device (eg. Sainsmart).

It seems to switch within a few milliseconds of hitting "play."

Here are some things that I think ought to be done/ added in the future, and which I will work on in my spare time:

1. Actually testing this in Windows. I have read that the ftd2xx module for Python does work on Windows, but I didn't actually try it.

2. Refactor the code a bit so that it is a little more universal, rather than tied to the two boards I tried it on. For example, I think there are multi-channel CH340 devices out there.

3. Maybe add some sort of delay so that, for example, a transmit amplifier doesn't kick on until an antenna switch has had a few milliseconds to switch. This is a pretty important safety feature that ought to be implemented.

4. Better documentation. I wrote this up quickly and I am not sure all the ideas are well-explained.

73s,
James AD5NL

Join sdrangel@groups.io to automatically receive all group messages.