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.
How do I specify to connect to a particular radio on my Network?
I have two Flex 6400s on my LAN. SmartSDR works well with both of these radios.
I'm developing a unique program using C# to assist me in POTA contacts.
The two radios are as follows: #1 6400 for HF only. #2 6400 for VHF via a Transverter.
These are dedicated to these two specific uses.
I want the custom software to Always connect to the HF 6400. The radios are both on and both registered on the LAN within the SmartSDR connection interface so I can select either or Both
to operate.
Issue:
When both radios are on the Custom C# program I'm creating can not determine which radio is the HF 6400. So it crashes.
What I desire is a Radio selector method so I can choose the desired radio. So far the Flex API it seems to query and locates both radios and thus it confuses the Software.
How can I correct this? I'm kinda stuck with this.
Note: If I shut down the VHF Flex 6400 the Software works as I designed it to using the HF flex 6400. So I just need a method to select a single radio.
Many thanks.
Regards,
Brad - N5LZY
Answers
-
Hi Brad, I am away skiing tomorrow, but when I get home I will give you some ideas for connecting by serial number instead of first found rig.
1 -
The discover broadcast packets sent out from the radios contain s/n and IP. Use that to listen for the radio you want (s/n) then connect to that IP.
Dave wo2x
1 -
KD0RC,
Examples would be great. The APIs are difficult to navigate as there is not really a clear users manual
of the functions and there usage. I have been digging thru them but again, with out examples it's hard to
figure out clear usages.
I'd appreciate your help. As I'm very close to having the program working as I desire. But since I have multiple Flex radios it does get confused and fails if both radios are powered on.
Thank you.
Regards,
Brad - N5LZY
Cell phone: 68225669690 -
Brad
Flex is looking for the Non-GUI Client (your application) to send it a bind command. The bind command uses the radio ID. This will be unique for each of your two Flex Radios.
As Dave, WO2X, said, use the discovery packet, plain text UDP on port 4992 to get the radio's connection information, including its Nick Name and IP Address.
When a ratio starts up, it sends out a status message. Point your app to the Flex IP (from the discovery packet) to get this message. Included in the status message is the radio's nickname and ID. Use the nickname to correlate to the discovery packet. You now have all the variables necessary to build a "bind" command.
Alan. WA9WUD
0 -
How are you connecting to just a single radio? You can look at the Flexlib wiki for documentation.
If you are automatically connecting ( to a single radio) you will need to change your code to watch for all broadcasts from more than one radio on your network. You should be able to call up a list of radios on your network. Then, select from the list the radio, including ID and IP address that you want to connect to. Look up the author of FRStack on Github. He has some code listed there for using SmartLink. It has a section for enumerating local network radios as well as others over the internet. You may be able to find what you need in his code. You will have to modify it to work with your setup.
I have not ever tried to create a radio chooser as I have only had one 6000 Series radio in the shack at any given time.
James
WD5GWY
0 -
Brad
From the Flex WiKi, https://github.com/flexradio/smartsdr-api-docs/wiki,
The "Primer from G3WGV is a little dated, but it will explain everything you need to know.
Alan. WA9WUD
1 -
Hi Brad, you mention C# in your original post. Are you using FlexLib (.net) or just straight C# without the Flex .net library?
I am (once again...) locked out of my own Visual Studio on my own computer due to the MIcrosoft login garbage. I will try to sort that out so that I can share what I have done with C# and FlexLib.
2 -
Hi Len, I would be interested in seeing how you are enumerating radios on the Network. I have a general idea how to go about it. But, no way to test since I only have the 6600M. I can easily find it on my network and retrieve the Serial number, model, IP address, user name etc. But,I have not tried to create a radio chooser like SmartSDR uses.
Seeing an example of this would be great.
James
WD5GWY
0 -
Hi James, I also have never built a chooser. Rather than enumerate, what I have done in another project is provide a serial number on an SD card. This makes it easy to dedicate a piece of gear to a specific radio, Like Brad is doing.
In the other project, I use one Teensy board per radio to run antenna disconnectors and band pass filters for a club station. Here is a link to the Github for that.
I have thought about this a lot as well, but until someone donates a Flex 6000 series to me, I won't have two radios to experiment and develop with...
1 -
Hi Brad,
Here is a link to a C# ,net demo program that uses FlexLib. I did this as an exercise to learn C# and to understand FlexLib. I don't pretend that this is great code, but it does work.
I use the Visual Studio 2019 IDE.
The comments with the "**" in them are my comments about grabbing multiple radios.
private void API_RadioAdded(Radio radio) { _thisRadio = radio; // ** This could be an array, grabbing each radio that it finds. // You would need a radio counter to set the index of the array. SerNum = radio.Serial; // ** Also could be an array. // It would use the same radio counter (above) as the index. // 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; radio.PropertyChanged += new PropertyChangedEventHandler(radio_PropertyChanged); radio.SliceAdded += new Radio.SliceAddedEventHandler(radio_SliceAdded); radio.SliceRemoved += new Radio.SliceRemovedEventHandler(radio_SliceRemoved); radio.PanadapterAdded += new Radio.PanadapterAddedEventHandler(radio_PanAdded); radio.SlicePanReferenceChange += new Radio.SlicePanReferenceChangeEventHandler(radio_PanRefChg); radio.VoltsDataReady += new Radio.MeterDataReadyEventHandler(_thisRadio_VoltsDataReady); radio.PATempDataReady += new Radio.MeterDataReadyEventHandler(_thisRadio_PATempDataReady); radio.GUIClientAdded += new Radio.GUIClientAddedEventHandler(_thisRadio_GUIClientAdded); radio.GUIClientUpdated += new Radio.GUIClientUpdatedEventHandler(_thisRadio_GUIClientUpdated); radio.GUIClientRemoved += new Radio.GUIClientRemovedEventHandler(_thisRadio_GUIClientRemoved); radio.MessageReceived += new Radio.MessageReceivedEventHandler(_thisRadio_MessageReceived); radio.Connect(); // ** Add conditional logic here to only connect to the desired radio // based on radio.Serial or radio.IP. Could also have a chooser screen here. form1.txtDebug.Text += "Status: " + radio.Status + NL; form1.txtDebug.Text += _thisRadio.GuiClientHosts + NL; ParseConfig(); }
I hope that this helps. As I have never actually had two Flex 6000 series radios in the same place at the same time, I have never actually enumerated multiple rigs, but I think this is a step in the right direction.
If you are not using FlexLib, I have some C++ examples that I think would translate to C# pretty easily.
Be sure to post back with any progress you make and/or help that you need.
1 -
Hello Len,
Please explain how to connect to a single radio if the are multiple Flex Radios on the LAN.
Your Code:
radio.Connect(); // ** Add conditional logic here to only connect to the desired radio
// based on radio.Serial or radio.IP. Could also have a chooser screen here.
How would I specify an individual radio?
Regards,
Brad - N5LZY0 -
Hi Brad, if there are multiple radios on the LAN, I think each one will cause an API_RadioAdded event. If you don't check for the desired serial number or IP address before doing the radio.Connect(), it will connect to the first radio it finds, then will attempt to connect to the next one it finds. I don't know what happens, but I doubt that it would be the desired result.
So what you could do is something like this. Put the radio.Connect(); statement in the following if statement. You would obviously use the proper serial number.
if(radio.Serial == "720-1014-6400-1234") { radio.Connect(); }
I can't test this, but give it a try and let us know if it works. Can you confirm that you are using C# with FlexLib?
1 -
Brad, have you figured out a workable solution for a radio chooser?
James
WD5GWY
0 -
Hi guys,
Was trying to use the discovery packet on UDP 4992 for my program to connect to the radio but I found out that the radio does not send the discovery message anymore after a client is connected. Which means that if I connect SmartSDR to the radio and my program after then it cannot connect cause it does not get the discovery packet. Is this normal behavior ?!?
I presume there is still a kind of message as launching another client like smartSDR will still the show the radio to connect with Multiflex option on.
Not sure I am clear enough.
Thanks
0 -
The radio continuously sends discovery packets (UDP protocol on port 4992) or you could never have multiple clients.
Here is a WireShark of my system. I have SmartSDR running along with a bunch of non-GUI clients (TeensyMaestro, N3FJP ACLog, SDRMonitor, SliceMaster and a couple of my own homebrew utilities).
The discovery packets are transmitted by the radio approximately once per second.
I hope this gives you the information that you need.
0 -
Hi Len,
Thanks for answer ok I found why my program was not working anymore.
I used a regex to find the discovery packet but the discovery message changes when a client is connected.
Thanks for your help
0 -
Yes, the number of clients, slices,etc changes.
What does your app going to do?
0 -
It is an app written in Golang which does the following:
- Telnet client to connect to any cluster to gather spots
- Telnet Server
The spots are then checked against my logbook (Log4OM) it connects to the SQLite database and check the status of the spot such as:
- New country for me
- New Band
- New Mode
- New band or mode
- Already worked
Then will send to SmartSDR / Maestro the spots with different background/foreground colors (an additional color also if I am the one spotted).
Then it also integrates a GUI with the HTTP server included which gives me live spots / new band - new mode - new band & mode highlighted as well as the "top" spotters and number of spots displayed on the SmartSDR/Maestro Panadapter.
Last but not least as this is what I wanted also in the first place that SliceMaster was doing: when I click on spot on the panadapter of the Flex it will automatically fill the Callsign field in Log4OM.
It works a bit the same way as
but for Log4OM and in Golang
0 -
Wow, what a great project! If you find anything useful in my Flex Repeater Spots code, please feel free to use it. It is out on GitHub under my call, KD0RC and is written in C# for .net using FlexLib.
I don't know Go Language, so I don't know how easily .net code is to port over.
Good luck with your project!
0 -
Nice I will have a look.
Go is a fantastic language especially for concurrency but bad for GUI where C# is very good.
Long time I have been learning go and python so hard to switch to something else.
0 -
Yes, I completely understand. My background is in PL/I, Fortran and COBOL; all on the IBM mainframe.
I finally learned the C based languages when I built my TeensyMaestro a few years ago. I am sure that a good C programmer will spot my PL/I accent right away!
0
Leave a Comment
Categories
- All Categories
- 289 Community Topics
- 2.1K New Ideas
- 534 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
- 230 SmartSDR CAT
- 172 DAX
- 352 SmartSDR API
- 8.8K Radios and Accessories
- 7K FLEX-6000 Signature Series
- 26 FLEX-8000 Signature Series
- 844 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