Welcome to the new FlexRadio Community! Please review the new Community Rules and other important new Community information on the Message Board.
If you are having a problem, please check the Help Center for known solutions.
Need technical support from FlexRadio? It's as simple as Creating a HelpDesk ticket.

Simple API Program

David Rudow
David Rudow Member
edited March 2020 in New Ideas
Hello everyone,
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

  • James Del Principe
    James Del Principe Member ✭✭
    edited February 2020
    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, Jim
  • David Rudow
    David Rudow Member
    edited February 2020
    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?
  • James Del Principe
    James Del Principe Member ✭✭
    edited February 2020
    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?      Jim
  • David Rudow
    David Rudow Member
    edited February 2020
    The transmit frequency of the ISS is 144.8 MHz and it's my understanding that the 6500 can't receive that frequency. -David
  • James Del Principe
    James Del Principe Member ✭✭
    edited February 2020
    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.    Jim
  • James Whiteway
    edited February 2020
    The 6700 does cover 2 meters. But, with very low output. An amplifier would be needed for any serious use. James WD5GWY
  • James Del Principe
    James Del Principe Member ✭✭
    edited February 2020
    Thank you, James. We learn something every day.
  • John - K3MA
    John - K3MA Member ✭✭
    edited February 2020
    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.
  • John - W3JFK
    John - W3JFK Member
    edited March 2020
    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()
    Creates a UDP socket, listens for new radios on the network, and adds them to the RadioList
    I'm assuming this method will only work when the radio is on the LAN.  Is this correct?

    John
  • James Whiteway
    edited March 2020
    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 WD5GWY
  • John - W3JFK
    John - W3JFK Member
    edited March 2020
    I'm remotely controlling the radio, it's not on my local area network.
  • James Whiteway
    edited March 2020
    That will make a difference. Hopefully, Mark will still have the code from his sample on github. James WD5GWY
  • Jason NR0X
    Jason NR0X Member
    edited March 2020
    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!!
  • David Rudow
    David Rudow Member
    edited March 2020
    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!
  • Jason NR0X
    Jason NR0X Member
    edited March 2020
    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.
  • David Rudow
    David Rudow Member
    edited March 2020
    Thanks for the suggestion, seems like a great fit for the project I'm working on now!

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.