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.
Simple API Program
I recently got the opportunity to work with the FlexRadio API and I just wanted to post what I did to help anyone else trying to use the API.
https://github.com/Duvey314/KM4SWU_FlexRadio_Demo
For this project I had about a week to learn C#, UDP/TCP protocols, Visual Studio, API interface, and the FlexRadio 6500 hardware. If I can do it anyone can.
The steps I took to learn everything and get me to a point where I could get to where I got were:
1. Hook up the radio and read the UDP information using wireshark to make sure you are connected.
2. Learn C# on Visual Studio (this is what FlexRadio uses and supports I believe) through youtube tutorials.
3.Learn the Forms Application on Visual Studio to be able to used a window instead of command line.
4. Download the API files and build each .dll library individually before building the main Flexlib.dll file.
5. Then you should be able to hook up the radio and run the program after adding the flexlib.dll reference to your project.
The project is a simple windows form to communicate to the radio and get information from the radio like serial number, version, and model. The ReadMe file on the GitHub has some of the resources I used and some steps I had to take to get it working. I'll try and answer questions if y'all have them. Hopefully this is helpful to some of y'all.
Also, I would like to add an image of the working program but I don't know how to add a picture, if you'd like to see it just let me know how to do it and I'll add it.
Comments
-
David, you have put a great deal of research time and effort into this project. Obviously, you are light years ahead of me in software. But I must ask you if this information is not already displayed in: Settings / Radio setup / Radio (first tab) gives radio SN, HW version, radio identification: Model (Flex 6500 in my case) and 'nickname'.
In the second tab "Network" is the IP address and mask information. Am I missing something?
OTOH, a program that "automatically tunes to the ISS station when it is overhead" would be awesome!!!
Thanks for your contributions. 73, Jim0 -
Hey James,
You make a good point. I was focused on getting something working in the week I had the hardware so that is as far into the project I was able to get. It is meant to mostly be a starting point for others looking to try out the API.
If I ever get my hands on the 6700 series I would love to write the ISS tracking program. That was the original plan when I started but I had a lot of background work that I had to do to get to where it is. But hey, shoot for the moon and land on the ISS right?0 -
David, my hat is off to you for your ability to write this code. Why does it need to be a 6700? Does it need two SCU's to work the ISS? Maybe one for tracking and one for communications? Jim0
-
The transmit frequency of the ISS is 144.8 MHz and it's my understanding that the 6500 can't receive that frequency. -David0
-
True enough, David. You would need a transverter which are popular, common and mostly, not expensive. But, to my knowledge, the 6700 also does not cover 2 meters. Jim0
-
The 6700 does cover 2 meters. But, with very low output. An amplifier would be needed for any serious use. James WD5GWY1
-
Thank you, James. We learn something every day.1
-
There is a third party program that works to tune in the Sats including ISS. Do a search on the forum or google for FlexSatPC.0
-
David, thanks for the the sample application. I was able to build the solution and get a running application. I don't see any radios on appearing, but is that because I'm remotely connecting to my Flex? I notice that a lot of samples use:
static void Flex.Smoothlake.FlexLib.API.Init()
I'm assuming this method will only work when the radio is on the LAN. Is this correct?
Creates a UDP socket, listens for new radios on the network, and adds them to the RadioList
John0 -
John, If you're on a LAN, either wired or over wifi, David's program should work fine, as long as your radio is on the same LAN. Remotely finding the radio is a bit more complicated. James WD5GWY0
-
I'm remotely controlling the radio, it's not on my local area network.0
-
That will make a difference. Hopefully, Mark will still have the code from his sample on github. James WD5GWY0
-
Seriously Cool, man!! I don't know jack about making a windows app, but I've been doing a lot of similar tinkering with Arduino IDE and ESP32 microcontrollers. Keep it up!!0
-
Hey Jason, Glad you like it. With all this time at home I've pulled out an arduino and started working on a small art project. It's fun stuff!0
-
It's worth your time to check out the ESP32 modules. They're cheap and they have onboarding WiFi/bluetooth, not to mention a much faster processor and more memory.0
-
Thanks for the suggestion, seems like a great fit for the project I'm working on now!
1 -
I managed to get it working!
(Sort of...)
What I haven't figured out is how to subscribe to Slice, Panadapter, etc etc. In the following code snippet, I can see how to get radio and therefore _thisRadio. I don't know what to do to get slice (I didn't see anything like API.RadioAdded, except for slice info). The commented lines at the bottom are some of the things that I have tried based on a post from Eric. Anyone able to help? I included the source at the bottom of this post so that you can see the whole thing.
public partial class frmMain : Form
{
private Radio _thisRadio;
private Slice _thisSlice;
public string NL = Environment.NewLine;
public frmMain()
{
InitializeComponent();
API.RadioAdded += API_RadioAdded;
API.RadioRemoved += API_RadioRemoved;
//API.ProgramName = "K1PGV's test Program";
API.ProgramName = "KD0RC test Program";
API.Init();
}
private void frmMain_Load(object sender, EventArgs e)
{
CheckForIllegalCrossThreadCalls = false;
}
private void API_RadioAdded(Radio radio)
{
_thisRadio = radio;
modelTextBox.Text = radio.Model;
serialTextBox.Text += radio.Serial.Substring(0, radio.Serial.Length - 4) + "****";
radioIPAddress.Text += radio.IP;
// The properties, such as Nickname and Callsign, can't be read
// successfully until you've received a PropertyChanged event
// for that property... this is done after connect.
//
radio.PropertyChanged += radio_PropertyChanged;
_thisRadio.Connect();
//_thisSlice = radio.TransmitSlice;
//radio.SliceAdded += new Radio.SliceAddedEventHandler(radio_SliceAdded);
//slice.PropertyChanged += new PropertyChangedEventHandler(slice_PropertyChanged);
}
0 -
Len
It looks like you are seeing the Flex Discovery Packet.
The command to subscribe to a slice is: C<xx>|sub slice all
where <xx> is a command number you assign so you can associate the response to the command.
Alan. WA9WUD
0 -
Hi Alan, Yep, that is what I did in C++ in my TeensyMaestro, and it works great. In this case, I am trying to use C# with FlexLib and am struggling with understanding both (I grew up on PL/I, Fortran and COBOL, so C constructs don't come easily).
Do you know how I would do the subscriptions in C# using FlexLib?
I think that if I can get the Slice event handler established and working, I will be all set, but maybe there is more to it than that... To that end, I don't understand how to define a slice variable that isn't always null.
0 -
Lets see, I had Fortran 101 in 1971......Then 40 years of linear controls. Now I am strictly Node-Red and a little Javascript.
Stephen has made a great set of Node-Red nodes for talking to, commanding, and getting information from the Flex. You need to take another look.
Alan
0 -
OK, I finally got it... I found another GitHub example that I was able to get a (partial) understanding of, so now I can get slice info.
I am at the "get it to work now, understand why later" stage of C# and the FlexLib.
Being used to the API text commands, this is taking some getting used to... In any event, I think I am now able to experiment with what I have working at this point. The large textbox on the right is a debug window to make it easier to see radio data real-time, instead of going to the console window after the fact.
I can only imagine the rookie C# mistakes I am making at this point, but it is fun to see it up and running.
0 -
OK, I think I am getting the hang of FlexLib...
Obviously not ready for prime-time, but here is an interesting (at least to me...) use case:
In multiFlex mode, I can see both stations and who is on each frequency. In a multi-op contest using one radio, this might be useful to see where your fellow op is running. I only have a 6400, so I quick-n-dirty coded it for just two slices. It seems that to make something like this truly useful to the contesting community, it would need to accommodate 8 slices, and dynamically adjust the screen based on the number of available slices (and have a ton more features...).
Note that I give each op the chance to totally mess up his operating partner with the A>B and A<B buttons, so this feature would have to have a way to be disabled. I also need to label the buttons based on the actual slice lettering.
1 -
Len, is the source code available for either of your sample programs that get slice information?
73 Al, WW1RF0 -
Hi Al, I can't remember if I put the source out on GitHub. If I didn't, I will put it out there this evening and post the link here.
1 -
Hi Al, here is a link to the sampler:
Use the version with today's date.
2
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