Is keying possible via the API or CAT/Serial (RTS or DTR)?

  • 1
  • Question
  • Updated 1 month ago
  • Answered
I'm wondering if it is possible to key the 6600 directly via the API (TCP) CAT, or Serial (RTS/DTR) methods.  I know it is possible to send morse characters using cwx or KY, but I am looking to control it more directly.  

It seems that only PTT Is supported via SmartSDR CAT on DTR or RTS, and I tested the Winkeyer implementation and it does not appear to support the tune command. 

So I am thinking that the only way to remotely key the transceiver would be to interface a separate hardware device to the key input connector on the back panel. 

Before I do that I wanted to post this here to double check that I have exhausted all possibilities.

73
Matt NQ6N 
Photo of Matt NQ6N

Matt NQ6N

  • 108 Posts
  • 44 Reply Likes
  • excited to build stuff

Posted 1 year ago

  • 1
Photo of Bob Craig, K8RC

Bob Craig, K8RC

  • 253 Posts
  • 101 Reply Likes
DXLab suite does CW with a Flex 6x000 without intervening hardware of any kind. 

In fact the software's interface can use the TCP/IP interface to the radio so it doesn't require a COM port, virtual or otherwise.

And it's freeware! https://www.dxlabsuite.com/
Photo of Michael Walker

Michael Walker, Technologist

  • 719 Posts
  • 203 Reply Likes
I do a remote PTT keying on DTR or RTS mapping to  a hardware com port. 

I essentially ground either lead to cause the radio to go into TX for a remote foot switch.  This is all done without a hardware connection to the back of the radio.

If you search, several of us published the details.

What is it you are trying to actually do?

Mike va3mw
Photo of Eric - KE5DTO

Eric - KE5DTO, Official Rep

  • 823 Posts
  • 289 Reply Likes
Matt,

There is a keying interface in the API that we use for Maestro.  It requires periodic timing information in addition to the keying information to help sync the keying data with the radio's timing.  This is possible, but not dirt simple.  I can go into more detail if you wish.

Also, out of curiosity, what Winkeyer command were you trying to use that didn't work?  I want to make sure that this is something that we just haven't implemented as opposed to something that is implemented, but isn't working.  Thanks.
Photo of Matt NQ6N

Matt NQ6N

  • 108 Posts
  • 44 Reply Likes
Eric -- The keying API you use for the Maestro sounds like it's along the lines of what I want(ed) to build, so more information about that API would be much appreciated. 

That API may be all I need, but even if it's not it sounds like it will give me plenty of control over keying.  I had been thinking of building an element level API but have not yet reached the point of determining whether sending timing information explicitly was going to be necessary. 

The Winkeyer command I tried was <0B><nn>, "key immediate".  

73,
Matt NQ6N
Photo of Mario - DL3LSM

Mario - DL3LSM

  • 64 Posts
  • 24 Reply Likes
Hi Eric,

I'm definitely interested in details about the keying interface API (NetCWStream I guess).

Thanks and 73
Mario, DL3LSM
Photo of Matt NQ6N

Matt NQ6N

  • 108 Posts
  • 44 Reply Likes
Just keeping this thread alive. 
Photo of Steven Linley

Steven Linley

  • 332 Posts
  • 55 Reply Likes
Can you put it in RTTY mode?
Photo of Eric - KE5DTO

Eric - KE5DTO, Official Rep

  • 823 Posts
  • 289 Reply Likes
Sorry for the delayed response.  Here's the details.

The API uses a "cw ptt" and "cw key" commands.  You can see how we use these in Radio.cs of FlexLib (see the CWPTT and CWKey functions beginning near line 7761).

The timestamp is a 4 digit free-running millisecond counter that simply rolls over at 9999.  

So the commands are:

cw ptt [0 or 1] [4 digit ms timestamp]
cw key [0 or 1] [4 digit ms timestamp]

Note that the timestamps are used to understand the jitter on the connection so as to buffer appropriately int the radio to avoid the effect issues with network jitter would have on the on/off keying.  More jitter means more buffering (higher delays).
(Edited)
Photo of Matt NQ6N

Matt NQ6N

  • 108 Posts
  • 44 Reply Likes
Eric -- Fantastic. That's pretty much exactly how I was thinking of designing it.  It's great that you've already done the work to automatically adjust the buffering based on the jitter inference. 

Do you happen to know if the implementation ever truncates >1 word space into 1 word space if it determines that it can reduce the amount of buffering? 

Also, one other beginner question: Is there a way to connect to the tcp API via an existing SmartLink connection?  Or will I need to manage the remote connection to the 6600's tcp API separately from SmartLink (or initiate a separate SmartLink connection)?   In my case the rig is used 100% via SmartLink for CW.

Thanks again!

73,
Matt NQ6N
(Edited)
Photo of Eric - KE5DTO

Eric - KE5DTO, Official Rep

  • 823 Posts
  • 289 Reply Likes
Matt,

I'm not sure what you mean on the truncating word space.  Help me understand and I'm sure we can come up with the answer.

If you are interacting with the API, you will be making your own connection to the radio.  In other words, there isn't an interface that allows you to share an existing application's process communication to the radio.  You can build on top of FlexLib if you're using .NET on Windows or you can use the ethernet API to go straight to the TCP commands and status to/from the radio.  If you are remote, we would recommend you use SmartLink, though others have used VPN solutions without SmartLink with success.
Photo of Mario - DL3LSM

Mario - DL3LSM

  • 64 Posts
  • 24 Reply Likes
Hi Eric,

thanks for this info..

One question: what is reason for sending the "cw key" and "cw ptt" commands 4 times via VITA/UDP (every 5 ms) and once via TCP in FlexLib? How is this handled in the radio?

Thanks and 73
Mario, DL3LSM
Photo of Eric - KE5DTO

Eric - KE5DTO, Official Rep

  • 823 Posts
  • 289 Reply Likes
I didn't see anything in the code that would explain that.  Is this something you have observed?  If so, in what context?
Photo of Mario - DL3LSM

Mario - DL3LSM

  • 64 Posts
  • 24 Reply Likes
C# is not my programming language but that's how I interpret the code in Radio.cs:

        public void CWKey(bool state, string timestamp)
        {
            if (_netCWStream != null)
            {
                string cmd = "cw key " + Convert.ToByte(state) + " time=0x" + timestamp + " index=" + _netCWStream.GetNextIndex();
                //SendCommand("cw key " + Convert.ToByte(state) + " time=0x" + timestamp
                _netCWStream.AddTXData(cmd);
                Task.Factory.StartNew(() =>
                {
                    Thread.Sleep(5);
                    _netCWStream.AddTXData(cmd);
                });

                Task.Factory.StartNew(() =>
                {
                    Thread.Sleep(10);
                    _netCWStream.AddTXData(cmd);
                });

                Task.Factory.StartNew(() =>
                {
                    Thread.Sleep(15);
                    _netCWStream.AddTXData(cmd);
                });
                SendCommand(cmd);
            }
        }

73, Mario DL3LSM
Photo of Matt NQ6N

Matt NQ6N

  • 108 Posts
  • 44 Reply Likes
Maybe in case a UDP packet gets dropped?  The radio could ignore duplicate messages? 
Photo of Eric - KE5DTO

Eric - KE5DTO, Official Rep

  • 823 Posts
  • 289 Reply Likes
Ahhh yes.  Sorry.  I didn't realize this is to what you were referring.  I believe this is simply to help with dropped packets.  We did testing with automated random packet drops and this helps to harden the interface so that the keying still goes through even if something weird is going on in the network.  On the radio side, the first TCP packet to make it through gets processed and the others are ignored.
Photo of Mario - DL3LSM

Mario - DL3LSM

  • 64 Posts
  • 24 Reply Likes
Just for clarification: the TCP packet will make it allways through but the question is when.. So the first packet (command string) from the 4 UDP packets and the 1 TCP will be used and the others will be ignored..

Thanks and 73
Mario, DL3LSM

P.S. Looks like a new area to play around.. :-) 
Photo of Matt NQ6N

Matt NQ6N

  • 108 Posts
  • 44 Reply Likes
Eric -- I thought about it and realized that my question about word space doesn't make sense.  I have noticed the network quality updates coming over the API so I can test the scenario I was wondering about if it turns out to be relevant. 
Photo of Wayne

Wayne

  • 614 Posts
  • 88 Reply Likes
So how does Smartsdr for windows do the PTT in the lower right of the screen? I would think that is being done by API or tcp since thats how its working.
Photo of Eric - KE5DTO

Eric - KE5DTO, Official Rep

  • 823 Posts
  • 289 Reply Likes
There are status messages coming over TCP that the radio sends that updates the GUI.
Photo of Matt NQ6N

Matt NQ6N

  • 108 Posts
  • 44 Reply Likes
Eric -- Quick question regarding the cw key command.  Is the timestamp supposed to be the rolling integer milliseconds modulo 10000, represented as hexadecimal? 

I am running into an issue where it works perfectly until the timestamp loops around.  The next command that is sent once the timestamp has looped around fails. 

Not sure if there is any additional step needed... the following results in the radio staying keyed after the last command gets sent. 

CD42|cw key 1 time=0x26A5 index=2
CD43|cw key 0 time=0x26D1 index=3
CD44|cw key 1 time=0x26FD index=4
CD45|cw key 0 time=0x19 index=5

Any suggestions would be much appreciated.  

73,
Matt NQ6N
Photo of Eric - KE5DTO

Eric - KE5DTO, Official Rep

  • 823 Posts
  • 289 Reply Likes
It looks like the values are expected to be hex formatted as 0xnnnn where n is [0-9A-F].  So it would roll over after FFFF (2^16-1).  Sorry for the confusion.
Photo of Matt NQ6N

Matt NQ6N

  • 108 Posts
  • 44 Reply Likes
Perfect, works very nicely now!  
Photo of Matt NQ6N

Matt NQ6N

  • 108 Posts
  • 44 Reply Likes
I've written a small program to connect a Winkeyer (key and PTT output) to the computer via serial port and allow remote sidetone and paddle usage without needing a Maestro.  If anyone following this thread is interested in being an alpha tester of this program I am happy to share a download link. 

I've had a few short rag chews using the paddles and it seems to work nicely. Currently it works only via VPN remote, not via Smartlink. I'll add Smartlink support once I figure out how to trigger the login/discovery process.
Photo of Chris

Chris

  • 12 Posts
  • 3 Reply Likes
Matt I just found this thread. If you're still working on the project I'd be interested in giving it a whirl.

Edit:
I found your Groups.io page for this. Thanks I'll give it a try
(Edited)