Need info on programatically implementing Remote operation in c# ...

  • 1
  • Question
  • Updated 2 years ago
  • Answered
I have written a "dumb" client (C# with FlexLib .NET API) for my Flex 6300.  It is set to be the main client - not a helper app. I call it a dumb client because it does NOT have panadapter - because I want to make it so that it has much less LAN or WLAN traffic. And my client takes up very little screen space.

My client uses the Flexlib .NET API.

It works real well if it is connected by lan cable to the same network as my Flex 6300.  But I need to implement a "Remote" button to get it to work as well - when it is on my laptop over wi-fi.

SmartSDR on the my laptop works perfectly over wii when I use the REMOTE button it has.  My client works real well also over wi-fi - except for having the audio ON the laptop - I still hear it on the desktop computer.

I need to implement a "remote" button in my client but can't figure out exactly what I need to do in the button code (and/or elsewhere) to add this functionality for remote operation.  I think I need to implement an OpusStream but not sure what exactly to do with it or what else it needs.

If anyone could give me a "road map" on what steps I need to take to effect this, sudo code, or real code - I would really appreciate it.   Any help would be appreciated.

---Gary
Photo of Gary L. Robinson

Gary L. Robinson

  • 218 Posts
  • 42 Reply Likes

Posted 2 years ago

  • 1
Photo of Eric - KE5DTO

Eric - KE5DTO, Official Rep

  • 661 Posts
  • 203 Reply Likes
Gary,

First, congrats on getting the client this far.  In general, there are a couple of things you can do to try to figure out how things work in the client.  You can wireshark it, search the wiki docs (wiki.flexradio.com), and ask here on the community.

If you're not familiar with wireshark (www.wireshark.org), it is an awesome tool for debugging and understanding what is going on with network traffic.  At some point we will have to put out a tutorial on how this works as it is hard to live without once you have used it.  With wireshark running, activate the option in SmartSDR that you want to understand the commands for and then explore the commands that were sent in the TCP stream to the radio.

If you are using FlexLib (.NET API), you can then go search for the command keywords you find.  In this case, it would be "remote_audio rx_on 1".  This is indeed found in the RemoteRxOn property in the OpusStream class in FlexLib.

Once you have this running, the OpusStream will provide you with audio samples at a regular interval.  It will be up to you to get those into an audio stream of some sort.  Buffering is a good idea to keep the audio from sputtering, but be careful as buffering comes at a cost of latency.  I would recommend looking at Portaudio (or PortaudioSharp -- https://github.com/atsushieno/portaudio-sharp) as the sound card library interface.  Feel free to ask additional questions on how that works as you get further down that road.

Good luck and have fun!
Photo of Gary L. Robinson

Gary L. Robinson

  • 218 Posts
  • 42 Reply Likes
Thanks Eric, will check out wireshark and start playing with it.  I have a feeling it will take me a while to get where I want to go BUT that is part of the fun.  And what I lack in knowledge and skill I often make up for by persistence hihi  I don't give up easily.
Photo of Kevin K4VD, Elroy

Kevin K4VD, Elroy

  • 775 Posts
  • 171 Reply Likes
Gary... now that an answer is posted, I wonder if you'd consider posting your code or snippets? I'm just learning C# on Visual Studio 2015 and would love to see code samples or even something I could run and experiment with (shoulders of giants kinda thing).

73,
Kev K4VD
Photo of Tim - W4TME

Tim - W4TME, Customer Experience Manager

  • 9052 Posts
  • 3435 Reply Likes
I recommend putting it in a GIT repository (or something similar)
Photo of Ria - N2RJ

Ria - N2RJ, Elmer

  • 2246 Posts
  • 871 Reply Likes
Put it on GitHub, that is if you even want to make your code open source. 
Photo of Gary L. Robinson

Gary L. Robinson

  • 218 Posts
  • 42 Reply Likes
I am not a professional in the same way as Eric and all the great coders at Flex.  My code is addressing only the 6300 with 2 slices since all I have is a 6300.  And I have no plans at all in ever releasing it as a product so I have just made it for myself and another local friend who also has a 6300.  I am sure my code will raise a few eyebrows and can be improved on  :-)
Having said that, I will post the code I have on my web site sometime after the Thanksgiving holiday and if someone wants to download and post it elsewhere or anywhere - that is fine with me.  I have no experience with GitHub and collaborating hihi  I will post an announcement on this forum when I put it on my website at http://www.oliviamode.com/wb8rol_xtra.htm
Photo of Kevin K4VD, Elroy

Kevin K4VD, Elroy

  • 775 Posts
  • 171 Reply Likes
Very big thanks! I know it will help me out a lot.

Kev