SmartSDR API question

  • 1
  • Question
  • Updated 3 months ago
I would like to write a simple program to record the S meter value over time.  Is there a way to use the API to ask for this kind of data from the radio?  I want to monitor noise and eventually do things like map the noise (at a particular frequency) as a function of antenna direction.
Photo of Tom Worthington

Tom Worthington

  • 30 Posts
  • 2 Reply Likes
  • puzzled

Posted 3 months ago

  • 1
Photo of Mark - WS7M

Mark - WS7M

  • 1148 Posts
  • 401 Reply Likes
Yes. You should look into the FlexLib API

It can aslo be done via direct TCP comm but more difficult. The FlexLib makes it almost simple
Photo of Ted  VE3TRQ


  • 234 Posts
  • 70 Reply Likes
I wrote a quick-and-dirty C program a while ago that uses the TCP/IP API to discover the radio, connect to the radio, find all slices and dump the S-meter values as they are reported by the radio. I simply output all values to the terminal for all slices. It is not cleaned up, but you are welcome to the code I wrote. It was the prototype to allow comparing the signal levels from two simultaneously connected antennas. I intend to eventually output a csv file for Excel to manipulate and plot when I'm done.

Written for Debian Linux , but should work on any system supporting C and sockets. Written and tested with the latest radio software.
Photo of Doug - K3TZR

Doug - K3TZR

  • 113 Posts
  • 15 Reply Likes

Unfortunately, I'm not aware of any simple "how-to" guide that would tell you what to do. I've spent the last few years learning the API and writing code to use it (but from a Mac, not a Windows PC).

You can download the source code for the API (i.e. FlexLIb) from the Flex web site. With a little programming experience I think you can find what is needed. By calling functions in the API you can make a "non-GUI" connection to the Radio and then send it commands to subscribe to meter data. The API sends commands to the Radio and receives back responses over TCP. Stream data (meters are one type of stream) is sent over UDP in Vita-49 packets. The API provides functions to make all of this happen and creates objects (meters being one type of object) that your code can interact with. 

Take a look at the API source code. If you have specific questions, I would be glad to try to help.

Good luck.
Photo of Ray Andrews, K9DUR

Ray Andrews, K9DUR, Elmer

  • 244 Posts
  • 61 Reply Likes

The SmartSDR client uses the API to communicate with the radio.  Therefore, any function or data, such as S-Meter readings, that is available to the client, is available to any 3rd party software.  As Mark stated, you can communicate with the radio directly with low-level API commands, but using the FlexLib is much easier as long as you are developing using the .NET environment.  All of my programs use FlexLib.

73, Ray, K9DUR
Photo of Tom Worthington

Tom Worthington

  • 30 Posts
  • 2 Reply Likes
Thank you all for your suggestions.  I was hoping it would be simple but evidently I really need to immerse myself in the C# FlexLib...maybe we'll have a have a big snowstorm and I'll be stuck inside for a week...73 and Aloha