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 control on USB Cable - No frequency control?

Lynn Hansen
Lynn Hansen Member ✭✭
I'm developing a small radio HMI that is able to control multiple radios. It uses serial comms to cover the widest variety of radios. I had high hopes of adding my Flex 6400 to the list of radios it works with by utilizing the USB CAT interface, but I've run into a major problem.

My HMI features touch-screen tuning among a laundry list of other features, but most importantly (for me at least), it has a dial. Hence the problem. According to the Flex USB cable interface guide, commands FA and ZZFA (the CAT commands that are normally used to get or set the frequency) are read only on this interface. They work as expected in SmartSDR CAT since programs using that interface have no problems changing frequency.

I'm running SmartSDR v2.6.2.

So my question is, is there a workaround to this limitation (i.e. undocumented commands), or are there plans to add this functionality to the USB CAT interface in the (near) future?

BTW, although it's not listed in the USB cable interface guide, the Mode command (MDx;) does work, at least partially. I can use the MD command to switch to most modes. However, if I send 'MD3;' to the 6400 to switch to CW mode the Mode listbox in the Slice window goes blank, like it's switching to an undefined mode. The mode returned in the IF command shows the radio is in USB mode (mode 2). If I send MD7; to switch to CW reversed mode, the radio just stays in USB mode.

There seems to be a few bugs. Has anyone reported them or does anybody care?

Lynn, KU7Q

Answers

  • Lynn Hansen
    Lynn Hansen Member ✭✭
    edited June 2020
    Zoro,

    Thanks for the reply. It looks like I can do everything I need to using the commands to the API over TCP/IP.

    I understand why it was done this way but I'm a little disappointed never the less. I had hoped to control the 6400 just like most other radios, via a serial port, without the need for the additional infrastructure (router, LAN, etc.). I do have WiFi capabilities, but not Ethernet, on the HMI, so I can connect to the radio using TCP/IP through my WiFi network. Not ideal, but workable.

    It's too bad Flex didn't expose the API to the USB port.

    Lynn, KU7Q


  • David Decoons, wo2x
    David Decoons, wo2x Member, Super Elmer Moderator
    edited June 2020
    You can do what you want via the CAT interface. I suggest you take a look at the SmartSDR CAT Reference manual. https://www.flexradio.com/downloads/smartsdr-cat-user-guide-pdf/ You can send the ZZFA command formatted with the frequency information. Dave wo2x
  • Lynn Hansen
    Lynn Hansen Member ✭✭
    edited June 2020
    Thanks for the reply Dave.

    I've tried the FA and ZZFA commands. Both return ?; and the radio does nothing. The manual you're referring to is for the SmartCAT interface for Windows. I'm trying to use the USB cable interface directly to my HMI's serial interface (via an FTDI USB adapter). The adapter works and I can read the frequency from the radio.

    However, from what I can tell, the SmartCAT and USB Cable interfaces are different. The USB Cable Interface Guide page 5 lists the Kenwood CAT commands that are supported and it notes that FA/ZZFA and FB/ZZFB are Get/Read Only. It does not list the Mode command (MDx;) at all.

    The show stopper here is even if I could control the slice frequency from the USB port, it seems to only work when SmartSDR is operational on my PC. I get no rx audio from the radio when SmartDSR is offline. My ultimate goal is to be able to use my 6400 without booting my PC. I just want to connect my HMI to it and run it as a basic radio. Advanced features will no doubt come over time, but not now.

    Today I started working with the control API on IP port 4992. I can access this port using the WiFi station feature in my HMI. When I connect to port 4992 everything works as described as long as SmartSDR is connected to the radio. I can create slices, tune the frequency, adjust the headphone gain, etc.

    But...

    I run into a problem when SmartSDR is off-line. I can still connect to port 4992, get radio info, create a slice, adjust headphone data, but, when I send the tune command, 'c10|slice t 0 7.033', the radio resets. I can only deduce that this is happening because the radio doesn't have a GUI running and it crashes because it doesn't know how to move the frequency on a GUI that doesn't exist. Another oddity when working with the API without SmartSDR running is that the radio doesn't always reply to commands. It always replies to commands when SmartSDR is online.

    I may be doing something wrong in the setup because I'm just starting to use the API. It might be helpful if others could verify this failure mode, or tell me what I'm missing. Here's the commands I send the API after I connect Putty to port 4992 using Raw or Telnet. My commands are bold, radio replies are in italics:

    c0|slice create freq=7.033 ant=ANT2 mode=USB
    SAAE68756|profile mic list=Default^Default FHM-1^Default FHM-1 DX^Default FHM-2^Default FHM-2 DX^Default FHM-2 ESSB^Default FHM-3^Default FHM-3 DX^Default FHM-3 ESSB^Default HM-Pro^Default PR781^Default PR781 ESSB 3_2k^Default ProSet HC6^Inrad M629^Inrad M650^RadioSport DX M207^RadioSport DX M208^RadioSport DX M350-ADJ^RadioSport DX M360/EM56^RadioSport WIDE M207^RadioSport WIDE M208^RadioSport WIDE M350-ADJ^RadioSport WIDE M360/EM56^RTTYDefault^
    SAAE68756|interlock acc_txreq_enable=0 rca_txreq_enable=0 acc_tx_enabled=1 tx1_enabled=1 tx2_enabled=1 tx3_enabled=1 tx_delay=0 acc_tx_delay=0 tx1_delay=0 tx2_delay=0 tx3_delay=0 acc_txreq_polarity=0 rca_txreq_polarity=0 timeout=0
    SAAE68756|interlock acc_txreq_enable=0 rca_txreq_enable=0 acc_tx_enabled=1 tx1_enabled=1 tx2_enabled=1 tx3_enabled=1 tx_delay=0 acc_tx_delay=0 tx1_delay=0 tx2_delay=0 tx3_delay=0 acc_txreq_polarity=0 rca_txreq_polarity=0 timeout=0
    SAAE68756|interlock acc_txreq_enable=0 rca_txreq_enable=0 acc_tx_enabled=1 tx1_enabled=1 tx2_enabled=1 tx3_enabled=1 tx_delay=0 acc_tx_delay=0 tx1_delay=0 tx2_delay=0 tx3_delay=0 acc_txreq_polarity=0 rca_txreq_polarity=0 timeout=0
    SAAE68756|interlock acc_tx_enabled=1 tx1_enabled=1 tx2_enabled=1 tx3_enabled=1 tx_delay=0 acc_tx_delay=0 tx1_delay=0 tx2_delay=0 tx3_delay=0
    SAAE68756|interlock acc_txreq_enable=0 rca_txreq_enable=0 acc_txreq_polarity=0 rca_txreq_polarity=0
    SAAE68756|interlock timeout=0
    SAAE68756|profile tx list=Default^SO2R_TX1^SO2R_TX2^
    SAAE68756|radio slices=1 panadapters=1 lineout_gain=60 lineout_mute=0 headphone_gain=35 headphone_mute=0 remote_on_enabled=1 pll_done=0 freq_error_ppb=-1 cal_freq=15.000000 tnf_enabled=1 snap_tune_enabled=1 nickname=Lynn callsign=KU7Q binaural_rx=0 full_duplex_enabled=0 band_persistence_enabled=1 rtty_mark_default=2125 enforce_private_ip_connections=1 backlight=50 mute_local_audio_when_remote=1 daxiq_capacity=16 daxiq_available=16
    SAAE68756|radio filter_sharpness VOICE level=2 auto_level=1
    SAAE68756|radio filter_sharpness CW level=2 auto_level=1
    SAAE68756|radio filter_sharpness DIGITAL level=2 auto_level=1
    SAAE68756|radio static_net_params ip= gateway= netmask=
    SAAE68756|radio oscillator state=tcxo setting=auto locked=1 ext_present=0 gpsdo_present=0 tcxo_present=1
    SAAE68756|slice 0 in_use=1 RF_frequency=7.033000 client_handle=0x4EAD1E55 index_letter=A rit_on=0 rit_freq=0 xit_on=0 xit_freq=0 rxant=ANT2 mode=USB wide=0 filter_lo=100 filter_hi=2800 step=10 step_list=1,10,50,100,500,1000,2000,3000 agc_mode=med agc_threshold=55 agc_off_level=10 pan=0x00000000 txant=ANT1 loopa=0 loopb=0 qsk=0 dax=0 dax_clients=0 lock=0 tx=1 active=1 audio_level=50 audio_pan=50 audio_mute=0 record=0 play=disabled record_time=0.0 anf=0 anf_level=0 nr=0 nr_level=0 nb=0 nb_level=50 wnb=0 wnb_level=0 apf=0 apf_level=0 squelch=1 squelch_level=20 diversity=0 diversity_parent=0 diversity_child=0 diversity_index=1342177293 ant_list=ANT1,ANT2,RX_A,XVTA mode_list=LSB,USB,AM,CW,DIGL,DIGU,SAM,FM,NFM,DFM,RTTY fm_tone_mode=OFF fm_tone_value=67.0 fm_repeater_offset_freq=0.000000 tx_offset_freq=0.000000 repeater_offset_dir=SIMPLEX fm_tone_burst=0 fm_deviation=5000 dfm_pre_de_emphasis=0 post_demod_low=300 post_demod_high=3300 rtty_mark=2125 rtty_shift=170 digl_offset=2210 digu_offset=1500 post_demod_bypass=0 rfgain=0 tx_ant_list=ANT1,ANT2,XVTA
    R0|0|0

    c1|slice list
    R1|0|0
     
    (it actually took several tried to get the radio to reply to the slice list command)

    c2|slice t 0 7.04 0

    Putty session abruptly ends and radio reboots. Power button on the 6400 starts flashing green and I can't connect with Putty or SmartSDR. After a minute or so (seems like forever) it wakes up and is functional again.

    If I run the exact same commands with SmartSDR connected to the radio, everything works fine. I can create a new slice (#1), change it's frequency, etc.

    Again, the goal is to be able to wake up the 6400 without SmartSDR running, create a slice, change the frequency and other properties with my HMI, and close it down when I'm done. So far, that's not happening.

  • Lynn Hansen
    Lynn Hansen Member ✭✭
    edited June 2020
    I received an update from Eric at Flex. He has verified the radio reboot issue as described above as a bug in v3 and v2.62 SmartSDR firmware and has opened J8057 to track the issue. They'll get it fixed. Hopefully they can clean up some of the other stability issues that happen when you try to create a slice without SmartSDR running.



  • BL7IB
    BL7IB Member ✭✭

    I am also studying the USBus cat interface. I also hope future version firmware allow ZZFA write.

    I plan to code the mcu to interface between my external antenna tuner to do the following:

    1. a remote control unit receive command from mobile app and trigger the external ATU to start tune. the command can either tune at current VFO or QSY to designated calling frequency
    2. the ATU pull PTT line to low logic level in attempt to key the transmitter. if this is connected to special PTT input of same-brand transmitter, the transmitter will switch to CW and 10 watts automatically. Now the mcu intercept the ptt and use CAT command to read the mode, power level, memorise it, then set the Flexradio to 10W, CW mode, put to TX.
    3. The external ATU will tune in 2 or 3 seconds, then release the ptt. The mcu shall put radio back to RX and restore previous mode an power level. In other words, emulate the special PTT input of icom ATU connector.

    The current USBus dog command set should do the job but if i wish to add routine in mcu to QSY several kHZ above the calling frequeny to tune and come back to the calling frequency, I need ZZFA write.

  • KD0RC
    KD0RC Member, Super Elmer Moderator

    Thanks for this update Lynn. I have had the exact same problem with my "MiniMaestro" (Arduino Due project). I just assumed that I was either doing something wrong or that there was a requirement to have SmartSDR running. I normally want to have SSDR running when I operate, even with the MiniMaestro, but I occasionally forget and fire up my project before SSDR is open, causing exactly the behavior you described above, Otherwise, the API is very cool and helps bring back homebrewing to ham radio. I am really enjoying my project. It uses the Arduino library written by Enzo, IW7DMH. If you ever plan on doing something similar, it is a great place to start. I would recommend the Teensy 4.1 over the Arduino Due/Ethernet Shield combo. It is faster (600 MHz vs 84 MHz), cheaper and much smaller.

    73,

    Len, KD0RC

  • Lynn Hansen
    Lynn Hansen Member ✭✭
    @BL7IB - Sounds like an interesting project. Good luck.

    @KD0RC - Len, the update they sent for me to test corrects the API lockup problem I noted above. It should make it into the next maintenance release of SmartSDR. It doesn't correct not being able to control the frequency from the serial port using ZZFA :( Eric said they probably will never allow this because the serial port is a legacy interface and is of limited use in the Flex environment. The biggest problem (I think) occurs if you don't have SmartSDR running. The serial port would need to create a slice in order to have something to work with. That's probably a lot more work than they want to do for a limited application. Too bad.

    Thanks for the suggestion on CPUs. I'm already months down the road on my own version of a Maestro like device called CTR2 (for Control The Radio Too). It's an update to the CTR program/BlueLync interface QST published for me in the February 2007 issue. I'm using the Teensy 4.0 with the PJRC audio board and writing the entire program from scratch, other than the Teensy libraries.

    I have been totally blown away at what the Teensy ecosystem allows me to do, especially on the audio side. I've been able to add DSP processing to the Tx and Rx audio, CW and RTTY encoding and decoding, an audio spectrum analyzer for tuning, logging, and USB audio & control for digital modes. It provides a small (3.5") touch screen user interface with a single mic, headphone, paddle, and PC/Mac/Linux USB (audio and control) interface. It stores profiles for up to 16 different radios. It doesn't require a computer if you're not using digital modes. Oh, and it can also provide a WiFi access point, or connects to your WiFi router as a station.

    My project is not intended solely for the Flex radio. My intent is to create a modern digital interface with touch & encoder tuning and DSP functionality for any radio you own, from a boat anchor to the Flex and anything in between. Obviously tuning and mode control won't be possible on radios that don't support a control protocol.

    The irony is that Flex, being arguably one of the most advanced radios on the market is only compatible with CTR2 via the API on a WiFi connection. I can't just connect a serial connection to the Flex and control it. I have to have the Flex connected to my WiFi network and connect CTR2 to the same network to be able to tune the Flex. If I have to provide all of that infrastructure, I might as well just power up the PC and run SmartSDR too. The only thing CTR2 adds to the Flex experience is a simpler interface, a tuning knob, and remote CW keying.

    Once I get CTR2 fully functional I'll probably release it as an open source project. I'm not sure of the best place to share it. I've thought about another article for QST as a follow up to my 2007 article.

    Too bad this forum doesn't support uploading photos.
    73's, Lynn
  • ka9ees
    ka9ees Member ✭✭✭
  • Lynn Hansen
    Lynn Hansen Member ✭✭

    Thanks! I see the picture button below. Here's a couple of photos of my CTR2 rig controller...

    This is the display tuned to the FT8 20 mtr freq. It's a 3.5" Nextion touch screen. Tuning can be done with by touching the digit you want to change, turning the rotary encoder (changes the selected (red) digit), touching the audio spectrum display, or using the virtual keypad. External mouse and keyboard also supported.

    The Tx buffer is on the top line, Rx buffer for CW and RTTY is next down. The third line displays the selected radio (#3) and the log input buttons. Other controls are self-explanatory, other than the ">0" button. Pressing it will zero out all the digits to the right of the selected tuning digit.

    Right side view of the acrylic case I built for it. Mic and headphones plug into the I and O jacks.

    Left side view. Power switch is off because unit is being powered by the PC's USB port. Next update of the PCB will have the min-USB connector closer to the side. Power, paddle, USB host, and radio connections are on the back. Power can be supplied by the USB from the PC or from a 9 to 36 volt DC supply.

    Still lots of work to do. It's my retirement project :)

    73, Lynn

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

    Nice work Lynn! Looks good.

    Dave wo2x

  • ka9ees
    ka9ees Member ✭✭✭

    I like it!

    Ed KA9EES

  • KD0RC
    KD0RC Member, Super Elmer Moderator

    Thanks for the info Lynn, I have embarked on my latest project scope-creep... I added a 480 x 320 color TFT display. Once the next update comes out with the fix you mentioned, I will have a stand-alone unit. Now I just need to figure out how to connect via SmartLink...

    My display is still pretty bare bones, but I should have it more fleshed out this week. The white box is the Arduino Due/Ethernet Shield based unit and the jumble of wires is the Teensy 4.1. I can control the radio simultaneously with each one.

    73,

    Len

  • Lynn Hansen
    Lynn Hansen Member ✭✭

    Len,

    Looks strangely familiar :) Here's the bread board version of CTR2 from several months ago. Fly wires do strange things to I2S audio. I had noise on line-in that would change as I adjusted one of the ground wires. It was a relief when I finally got it on a PCB and the noise went away. I almost wish the Teensy 4.1 had come out before I started my project since it has so many other useful options (like Ethernet), but I'll stay with the 4.0 for now. It has everything I need, except WiFi, but a cheap ESP01 took care of that. I've been having a ton of fun with their Audio Design library. I'm like a kid in a candy store.


  • BL7IB
    BL7IB Member ✭✭

    Sorry for semi-off-topic.

    Is there any documentation about i2c bus? If a physical RS232 port via USB cannot use CAT command ZZFA to QSY, maybe it is time to explore the i2c bus at the VGA-alike hole.

    In the Flex6000 hardware reference, said that : "Paragraph 7.6.8 Pin 12: SDA I/O This pin is the data signal for an I2C serial communication channel. It is to be used with external equipment. Refer to the SmartSDR documentation for more information."

    but I cannot search anything about i2c in the SmartSDR manual.

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

    Why not use something like Node Red on a Raspberry Pi connected to the network? Node Red can intercept CAT commands and then translate it to TCP via the SmartSDR API.

    I know it would be easier to have the ability to connect direct to the radio but Node Red coupled with FRStack running on a Pi provides so much more functionality.

    Dave wo2x

  • Lynn Hansen
    Lynn Hansen Member ✭✭

    BL7IB - I'm guessing the I2C connection is intended for factory test equipment. I2C would require yet another box to convert serial to I2C, something I'm not will to do with my project. I'm not surprised that it's not documented.

    WO2X - yes that would probably work, but again, it just adds one more layer of complexity. I'm trying to keep it as simple and straightforward as I can. My intent with CTR2 is to make a generic, rig agnostic controller with all the options I want in it (CW/RTTY keyer, CW/RTTY decoder, DSP audio, spectrum display with touch tuning, USB audio interface to PC, simple logging, common and rig specific frequency/mode and Tx buffer memories, etc).

    CTR2 is essentially a radio hub. It integrates all my radios into a single user interface. It allows me to switch to any rig I have with a simple push of a button (and maybe antenna switch).

    This is an early concept drawing. It mentions PSK31, but I ended up not supportting that mode directly. It and any other digital mode is available through CTR2's Digital mode (basically a PC to radio interface utilizing USB audio and internal VOX). In case you're curious, the interface to each radio remote is not Ethernet. I'm just using CAT5 cable because it's easy and cheap. In theory, any number of radios can be controlled by just cascading additional RJ45 switches. I chose to limit it to 16 because that number fit the radio select page :)

    With all this said, I've put Flex on the back burner for now. CTR2 doesn't add significantly to the Flex experience (other than a tuning knob). I'll eventually add the Flex API interface. For now, CTR2 gives me a "Flex-like" experience with my other radios, which was my original goal anyway.



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.