Welcome to the new FlexRadio Community! Please review the new Community Rules and other important new Community information on the Message Board.
If you are having a problem, 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.

CAT commands and Com Port redirecting

I'm trying for my first time to send commands to my radio from a USB connected Teensy 4.1using CAT commands. I want communications from the Teensy only over a single USB-assigned COM port. In my case, COM14. I have virtual port COM5 assigned to the radio via SmartSDR CAT. I obviously have to redirect incoming COM 14 data commands to COM5 in the PC.

I have a Python redirector script that is working fine for me, but I wonder if there's a better, less awkward way? I've looked into com0com and even com2tcp, but I wonder what others may be using?

Fred, K9SO

Comments

  • KD0RC
    KD0RC Member, Super Elmer Moderator

    Hi Fred, I have not tried any CAT commands with the Teensy 4.1, but I have done a lot with it using the TCP API commands. I'm not 100% sure this is the right thing, but wouldn't you use "Existing" to define a hardware port that you are connecting to?

    Out of curiosity, why CAT instead of the API? The CAT commands are very limited in what they can do compared to the API.

  • K9SO
    K9SO Member ✭✭

    Hi Len,

    No, that doesn't work. The Teensy needs COM14 to communicate with the PC. If I set up COM 14 for the Flex communications too, I'm double dipping and SMartSDR won't be able to access that port during setup. For now, I'm going to stick with the Python script for redirection to continue progress on the project … at least until I find something more elegant.

    I want to make a small "FlexControl" on steroids. I have a couple of Maestros, but 99% of the time I use them in SmartControl mode where the display is off. So I don't need a display. Lots of CAT commands.

    Besides, with USB, I can have a single cable connected to the PC that transfers data and provides all the power I need. No extra power supplies, no wall warts, no Ethernet cables. For me at least, simpler.

    73,

    Fred K9SO

  • N5NHJ
    N5NHJ Member ✭✭✭

    Just as a reminder, the Teensy has also a USB host port and 4 serial TTL ports.
    Maybe an internal serial redirector…?

  • K9SO
    K9SO Member ✭✭

    I need to interface to a SmartSDR CAT serial port. That means the COM port redirector must reside in the PC, not in the Teensy. I can't think of another way.

    Fred, K9SO

  • N5NHJ
    N5NHJ Member ✭✭✭

    Teensy ←→ TTL or USB Adapter ←→ SmartSDR on Existing (virtual) port as suggested by Len.

    This way you have 2 serial ports controlled by the Teensy. If the Teensy primary port is busy because the computer is using it (doing what?) you need a second port, this 'should' be true if you use a software redirector as well.

    Or maybe I'm missing something…

    Max

  • David Decoons, wo2x
    David Decoons, wo2x Member, Super Elmer Moderator

    as N5NHJ stated, VSPE allows you to bridge two com ports.

    As Len stated, if the Teensy shows as Com 14 and no software on PC is talking to the Teensy, then in SSDR CAT choose com14 and existing port. Key is no software on PC connected.

    A third thought for operating at radio, if Teensy’s USB connection uses FTDI chipset, you might be able to plug it into the radio’s USB and define in USB cable setup in SmartSDR which to have follow the CAT commands (active slice, TX, A, B, etc). If worried about current draw, use a powered USB 2.0 hub.

    Dave wo2x

  • K9SO
    K9SO Member ✭✭

    Thanks for all the comments.

    My original question about COM port redirecting,

     "I wonder what others may be using?"

    has been answered. Apparently, VSPE is the preferred answer. I have used com0com in the past for this very same application. I'll look at VSPE. For now, I'm using a Python script I wrote that does the same thing.

    This is a remote application so the radio USB port is not an option. The Teensy's primary port is being used for CAT command communications to the controlling PC at all times. This data must somehow be transferred to a SmartSDR CAT port in order to communicate to the radio and to do that, I'm using a redirector script running on the PC to do that.

    Dave and Len, regarding the use of an existing port in SmartSDR CAT setup, I tried to set the same PC port (14) for CAT ( using existing), but it is in constant use by the Teensy to receive the commands. I don't know how to use the same PC port to do two different things (receive commands from Teensy and send to radio).

    If I'm missing something obvious here, please let me know.

    Fred, K9SO

  • David Decoons, wo2x
    David Decoons, wo2x Member, Super Elmer Moderator

    I guess you only have one connection to PC and not two.

    When you plug the Teensy into the PC it is via USB com14? What on PC need to communicate with Teensy except your Python script? Stop Python and try it.

    73 Dave

  • K9SO
    K9SO Member ✭✭

    Thanks for the lead Max,

    I successfully created a COM14==COM5 bridge in VSPE and that seems to be working. I'll use that going forward. Much more intuitive than the other approaches. Press ON !

    Fred, K9SO

  • K9SO
    K9SO Member ✭✭

    After I get everything working, I discover that none of the published VFO B related CAT commands are recognized by the radio. Is there a radio setting I'm missing? All the VFO B settings return '?' even with VFO defined in SmartSDR.

  • David Decoons, wo2x
    David Decoons, wo2x Member, Super Elmer Moderator

    the CAT port can be changed from slice A to other choices such as active slice or TX slice.

    You cannot send slice A and B info through one CAT port. That is why the TCP API is the way to go. No bridge or redirects, and a whole lot more can be done.

    73 Dave wo2x

  • David Decoons, wo2x
    David Decoons, wo2x Member, Super Elmer Moderator

    Part of the reason is the dynamics of the Flex SmartSDR design. Slices are not directly related to VFO A and B on traditional radios. The models that support 4 or 8 slices would not be able to use CAT if it were slaved as Slice A were to be VFO A and slice B were VFO B.

    In a dual SCU radio such as a 6600 or 8600, a slice can use SCU 1 or 2 and the TX port for a slice can be ANT 1 or 2 or any transverter or RX port.

    I use Node Red to communicate to the radio via the API. The Node Red server resides on the radio network.

    Len has done a lot with the API and his Teensy project. Maybe that could help you as far as the API commands?

  • KD0RC
    KD0RC Member, Super Elmer Moderator

    I was hesitant to use the API over TCP at first, but once I got rolling, it became obvious that the API is infinitely better than CAT. My guess is that CAT is there to support third party apps that only have a CAT interface.

    Another advantage of the API to consider is that it can be used remotely. I connect my TeensyMaestro remotely using the SoftEther VPN.

  • K9SO
    K9SO Member ✭✭

    Dave,

    I get that, but I haven't given up yet. How is FlexControl doing it? Is there an API control via USB? USB gives me power and a single cord. No extra cables, no extra power supplies. I don't want to control everything, just A and B frequencies, AF gain, and AGC-t settings. Maybe power level.

    With CAT, apparently you can set up split mode with ZZSW1; command. That starts a second flag (VFO) B that can be controlled by the CAT commands for VFO B. But unless you set up the B flag using ZZSW1, it seems you can't CAT control VFO B functions from any B flag setup using SmartSDR. Surprising.

    Fred, K9SO

  • Mick  W8BE
    Mick W8BE Member ✭✭
    edited January 16

    SmartSDR CAT can be used remotely. If your client can connect remotely to the radio then SmartSDR CAT will control the radio. I use an Arduino Nano Every that sends CAT control for MOX. This allows me to have a remote foot switch PTT.

    https://github.com/w8be/usb-ptt-arduino-nano-every

  • KD0RC
    KD0RC Member, Super Elmer Moderator

    Very true Mick, I forgot about that.

  • N5NHJ
    N5NHJ Member ✭✭✭

    Fred,

    Just because you are mentioning the FlexControl, did you check what is the device sending?

    I don't see any CAT string coming from the FlexControl. It's interaction with the radio is embedded in SmartSDR.

  • Alan
    Alan Member ✭✭✭✭

    K9SO

    I Flex world, every slice is VFO-A.

    However, in Flex CAT, each slice has a unique COM port number, or in my case using TCP, has a unique TCP:port.

    So, if you want slice B to be VFO-B, just send the VFO-A Kenwood command to the CAT port for slice B.

    I my case, I am interfacing with a third part program that uses the VFO-B keen wood commands, so I need to filter these out, change to VFO-A format, and send to the CAT port for slice B.

    Clear as mud.

    Alan. WA9WUD

  • Mick  W8BE
    Mick W8BE Member ✭✭

    Alan ,

    I assume you are referring to the commands below…

    ZZFA Reads / Sets VFO A Frequency (11 digit Hz)

    ZZFB Reads / Sets VFO B Frequency (11 digit Hz)

  • Alan
    Alan Member ✭✭✭✭

    Mick

    Yes.

    In Node-Red, I wrote a function to look for a REGEX "contains", "FB", and translated that to "FA", attach the frequency or what ever, then send to a Flex CAT TCP Slice B Slice.

    Alan. WA9WUD

  • K9SO
    K9SO Member ✭✭

    The CAT commands can act very strangely. For example, the command ZZFA; will read A slices correctly over COM ports set up for slice A, but if using the same slice A COM port, the command ZZFB; will not read slice B unless the slice was specifically set up using the ZZSW1; command. It will not read B slices that were set up using smartSDR. But a B slice set up with ZZSW1; and queried with ZZFA; will read slice B even though the COM port is for slice A.

    So the obvious solution as Alan has said is to set up two PC COM ports, one for each slice. But since my PC is receiving data from a single Teensy port and not from an internal program like Node Red, I had to append a prefix A for A slice commands and a B for B slice commands. Then in my Python script, I **** off the prefixes and bridge to the correct slice port. Then the ZZFA; command on the B slice comport will read slice B! Go figger.

    You also have to be careful with ZZFA; commands. If you ever send ZZFA<11 digits>; the radio will respond with 11 digits for all future inquiries. But if you send ZZFA<8 digits>; , it reverts back to sending responses in 8 digit format.

    Convoluted and often confusing when using CAT, but it is working.

    Fred, K9SO

  • David Decoons, wo2x
    David Decoons, wo2x Member, Super Elmer Moderator

    what about setting SmartSDR CAT port to Active Slice or TX Slice instead of slice A or B? Then whatever slice is active (yellow stripe) will be controlled by CAT commands and will sends that slice’s frequency and mode when sent an FA; or FB;

    Dave wo2x

  • K9SO
    K9SO Member ✭✭

    Hi Dave,

    I don't understand. I don't see that as an option, even in advanced. Only A B C or D. How would I do that?

    Fred, K9SO

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.