SmartSDR v3.8.19 and the SmartSDR v3.8.19 Release Notes | SmartSDR v2.12.1 and the SmartSDR v2.12.1 Release Notes
SmartSDR v1.12.1 and the SmartSDR v1.12.1 Release Notes
Power Genius XL Utility v3.8.8 and the Power Genius XL Release Notes v3.8.8
Tuner Genius XL Utility v1.2.11 and the Tuner Genius XL Release Notes v1.2.11
Antenna Genius Utility v4.1.8
Need technical support from FlexRadio? It's as simple as Creating a HelpDesk ticket.
remote software CW keyer with ASIO side tone
Hi folks,
I'm just working on a remote cw keyer for my Flex-6300. The cw key is attached to the PC via USB-RS-232. The side tone is generated via low latency ASIO audio. This already works just fine.
Based on the information given from KE5DTO and NQ6N here
I want to key the radio via network.
I have already download the FlexAPI v3.1.8. I was able to connect to the radio according the example ComPortPTT from the FlexAPI. This is my Forms1.cs:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Flex.Smoothlake.FlexLib;
using Flex.UiWpfFramework.Utils;
namespace Iambic2
{
public partial class Form1 : Form
{
private Radio _radio;
public Form1()
{
InitializeComponent();
WindowPlacement.SetPlacement(this.Handle, Properties.Settings.Default.WindowPlacement);
API.ProgramName = "ComPortPTT";
API.RadioAdded += new API.RadioAddedEventHandler(API_RadioAdded);
API.RadioRemoved += new API.RadioRemovedEventHandler(API_RadioRemoved);
API.Init();
}
void API_RadioAdded(Radio radio)
{
if (_radio == null)
{
_radio = radio;
_radio.Connect();
//UpdateMox();
//_radio.CWPitch = 650;
}
}
void API_RadioRemoved(Radio radio)
{
if (radio == _radio)
_radio = null;
}
public void RadioTriggerOn(double timeStamp)
{
//Console.WriteLine("On - " + ((int)Math.Round(timeStamp)).ToString("X4"));
_radio.CWPTT(true, ((int)Math.Round(timeStamp)).ToString("X4"));
_radio.CWKey(true, ((int)Math.Round(timeStamp)).ToString("X4"));
}
public void RadioTriggerOff(double timeStamp)
{
//Console.WriteLine("Off - " + ((int)Math.Round(timeStamp)).ToString("X4"));
_radio.CWKey(false, ((int)Math.Round(timeStamp)).ToString("X4"));
_radio.CWPTT(false, ((int)Math.Round(timeStamp)).ToString("X4"));
}
}
}
RadioTriggerOn() / Off() are called at the according time instant of the side tone. timeStamp is counted in milliseconds with rollover at 2^16.
With this programm the radio does not send out any HF. I can see no reaction from the radio except that the normal CW key plugged into the radio itself does no work anymore after I have pressed the RS232 CW key a least one time (no HF is send, side tone works as usual). I have to reboot the radio to bring it back to normal operation.
I have noted that CWKey() is specially designed for the Maestro. So I have changed line 1763 of Radio.cs as follows:
if (true) //(API.ProgramName == "SmartSDR-Maestro")
What changes are necessary to make this program work?
Harald, DL3HM
Answers
-
Update:
When I switch from CWKey() to CWKeyImmediate() in the code above the radio is keyed properly. So there is obviously a problem with the generation of my timestamps.
With Wireshark I can see "ping ms_timestamp" messages on TCP port 4992. My timestamps are not in sync with these timestamps. Moreover the timestamps in CWKey() have a different format (hex integers) than the ping timestamps (decimal numbers).
Is this the cause of my problem? How can I get my timestamps in sync with the timestamps already sent by SmartSDR?
Harald, DL3HM
0 -
Update:
with the following code CWKey() works. Nothing was wrong with the timestamps. Instead the appropriate _guiClientHandle has to be provide to CWKey().
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Threading;
using Flex.Smoothlake.FlexLib;
using Flex.UiWpfFramework.Utils;
namespace Iambic2
{
public partial class Form1 : Form
{
private Radio _radio;
private uint _guiClientHandle = 0;
public Form1()
{
InitializeComponent();
WindowPlacement.SetPlacement(this.Handle, Properties.Settings.Default.WindowPlacement);
API.ProgramName = "ComPortPTT";
API.RadioAdded += new API.RadioAddedEventHandler(API_RadioAdded);
API.RadioRemoved += new API.RadioRemovedEventHandler(API_RadioRemoved);
API.Init();
}
void API_RadioAdded(Radio radio)
{
if (_radio == null)
{
_radio = radio;
_radio.Connect();
_guiClientHandle = _radio.GuiClients[0].ClientHandle;
}
}
void API_RadioRemoved(Radio radio)
{
if (radio == _radio)
_radio = null;
}
public void RadioCWKey(bool state, double timeStamp)
{
if (_radio != null)
{
_radio.CWKey(state, ((int)Math.Round(timeStamp)).ToString("X4"), _guiClientHandle);
//_radio.CWKeyImmediate(state);
}
}
}
}
Harald, DL3HM
0
Leave a Comment
Categories
- All Categories
- 289 Community Topics
- 2.1K New Ideas
- 535 The Flea Market
- 7.5K Software
- 6K SmartSDR for Windows
- 146 SmartSDR for Maestro and M models
- 360 SmartSDR for Mac
- 249 SmartSDR for iOS
- 231 SmartSDR CAT
- 172 DAX
- 352 SmartSDR API
- 8.8K Radios and Accessories
- 7K FLEX-6000 Signature Series
- 26 FLEX-8000 Signature Series
- 850 Maestro
- 44 FlexControl
- 847 FLEX Series (Legacy) Radios
- 796 Genius Products
- 416 Power Genius XL Amplifier
- 277 Tuner Genius XL
- 103 Antenna Genius
- 243 Shack Infrastructure
- 166 Networking
- 404 Remote Operation (SmartLink)
- 130 Contesting
- 631 Peripherals & Station Integration
- 125 Amateur Radio Interests
- 870 Third-Party Software