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.

Android App

2456715

Comments

  • Ken - NM9P
    Ken - NM9P Member ✭✭
    edited December 2016
    This one is really nice.   Everything is clear and the color scheme is good.
    Do the band, mode, etc. buttons color-shift to indicate which ones have been chosen?  

    With a few more indicators, this could almost be made to operate as a stand alone interface without need of a computer at the operating site!
  • Bill -VA3WTB
    Bill -VA3WTB Member ✭✭✭
    edited December 2016
    Is this just another was of working remote, replacing the SSDR. I'm not up on this. But looks slick.
  • W4WHL
    W4WHL Member ✭✭
    edited July 2016
    They will change color when selected. You could operate without a computer, if you could live without a panadapter. I would just need to add one button to start the receiver. I played with this and it works. You just need speakers on the lineout. But what is the point lol I got the flex for the panfall. If I ever figure Out vita pakets. I may try creating a waterfall in android. But far from that.
  • W4WHL
    W4WHL Member ✭✭
    edited July 2016
    Bill, It does not replace smartsdr. It just alows you to control it without shifting focus from your log program. Just an alternative to using a mouse. Aka virtual front panel. William
  • Ken - NM9P
    Ken - NM9P Member ✭✭
    edited December 2016
    It looks like it will run very well in that aspect...sort of an Android version of K6TU's excellent Apple App.  

    But.....If you could figure out the remote audio in/out and do a VPN then you would have a very simple remote op client that wouldn't even need to use Parallels Access.  Granted, no panadapter, but simple SSB remote would be as good as most Legacy rigs...  with a lot less bandwidth than other remoting operations.  Could be neat.
  • W4WHL
    W4WHL Member ✭✭
    edited July 2016
    Ken the remote audio is not really the problem, but its Vita packets.  All data from the radio is encapulated in UDP vita packets.

    You would need to inspect the VITA packet and extract the data.  Since all data is encapsulated, you have to inspect the header and only extract the audio packets.

    Flexlib has an API for this.  But I can't use the API.  I would have to totally rewrite that code in JAVA.  I'm not up to that level yet.  Maybe one day once I can get my hands on some good vita documentation.

    William
  • Walt - KZ1F
    Walt - KZ1F Member ✭✭
    edited November 2016
    William,
        What I do is use Netty. What Netty does is completely remove any networking issues from the developer. It handles providing the callback such that when a packet arrives that method is invoked. Where this, automatically is done outside the presentation thread, any drawing can be done here and the resulting canvas pushed up to the application presentation thread. The goal is you want to keep that thread pretty much idle to be responsive to users.

    Would you elaborate on what you mean by you are doing Native Android not a port. What I am doing actually is a complete port.

    The way you can handle panadapters is to stack them such that the user can swipe between them either left->right->left or reverse. Each slice then is a 'flag' it has some push button and user feedback information as the flag and a flag pole (so to speak) pointing to the freq that slice is on and the bandwidth is a almost transparent canvas that is either left, right, or centered on the 'flag pole' and can be swiped or crushed or expanded. Further, just as the notch filters respond to up/down motion you can use that same swiping up/down motion on the flagpole to increase or decrease the bandwidth. The 'flag' feedback indicator will be kind of small to work the buttons but it will be large enough to provide feedback to the user.

    You can use a ListFragment to present the collection of panadapters and a ViewPager to handle the navigation between panadapter activity fragments.

    Walt - kz1f
  • W4WHL
    W4WHL Member ✭✭
    edited July 2016
    Walt,

    What I meant was;  I was using processing to port a processing sketch to Android.  But processing UI is very limited.  I wanted access to android widgets. I have no issues with the networking portion, I was just explaining that in android, you must seperate the networking from the UI thread.

    This is all a learning experience for me.  I will research netty.

    William
  • Steve - KD8QWT
    edited June 2015
    I'm in the same boat with VITA.  This is the best doc I could find so far.  I haven't had a chance to really dig through it.  The specs are on http://www.vita.com/ , but they want $100 for it.

    http://www.wdv.com/Electronics/Reference/SDROoverWEB-VITA.pdf
  • Walt - KZ1F
    Walt - KZ1F Member ✭✭
    edited November 2016
    I never heard of that prior to you mentioning it.  How do you connect to the radio? Processing is a derivative of Java, is it not?
  • Walt - KZ1F
    Walt - KZ1F Member ✭✭
    edited November 2016
    Steve, and all, there is a draft of Vita-49 standard on the web.
  • Walt - KZ1F
    Walt - KZ1F Member ✭✭
    edited November 2016
    In basically anything you don't want network IO in the main thread. In a synchronous model when you block on IO nothing happens until the IO is complete, like reading data or writing data. What is a little harder to do is have all your IO be asynchronous such that the stack (part of the OS) can handle it while your program does whatever it is your program is supposed to do, presumably not wait on IO. Similarly with transmissions, rather than wait for it to complete, you just, effectively say, here send this. and as space is available in the packet about to be sent, some number of bytes are added, when it needs to span packets, it handles it. Similarly on receive, the callback could say it got 0 bytes, or 5 bytes. And you kind of have to wait until the entire packet arrives before you do anything with it. Ultimately, all IO is synchronous.. You just want to push the waiting for something to happen to another thread.
  • W4WHL
    W4WHL Member ✭✭
    edited July 2016
    Here is a quick demonstration




  • W4WHL
    W4WHL Member ✭✭
    edited July 2016
    I use Asynctask to handle all my networking.  So all that is done in the background, and does not affect the main UI thread.

    I connect to the radio with TCP port 4992.  This is easy, as the header is irrelevant.  But all streaming data uses UDP, so you have to be able to parse IF data, audio data, etc separately.  So I just need to understand the protocol more. 

    Processing is a java derivative yes.

    William

  • Walt - KZ1F
    Walt - KZ1F Member ✭✭
    edited November 2016
    Yes, I know I have the various Vita packets parsed into various object already as they flow through. I meant more like how you handle property event changes, how you communicate a frequency to listen to. For instance, In the discovery process you can register a callback for "HEY! I found a radio" and there is a radio object. Using the Vita discovery packet, after the packet arrives, you have to determine what the packet type is and instantiate the specific object type. Or does that not interact at all with Flexlib and you merely send tcp requests to the radio, like create pan, create slice, set freq, set mode, etc? The most involved task I've run into is having to have rewritten FlexLib. I wasn't sure if you had already accomplished that, never bothered to, or have an interface to the existing C#/.NET one. What I am doing is, essentially, writing SSDR for <everything else>, that'll have more functionality in it.
  • W4WHL
    W4WHL Member ✭✭
    edited July 2016
    I'm just sending tcp request to the radio.  I send "sub slice all" etc oncreate.  Then parse the data  as its received from radio.  All via tcp 4992.  the only udp I do is initial discovery on 4992.  I  convert each packet data to string.  Then parse the string for the data I need.  Sorry  for short response,  I'm using my phone.

    You are leaps and bounds ahead of me.  I'm just a beginner.  I just started back programming after 20 year's  one month ago.  I have tons to learn.

    William
  • W4WHL
    W4WHL Member ✭✭
    edited July 2016
    I'm 90% completed mapping out all the functions.  Just a couple more buttons and dials.  Should be done in a couple days.

    Currently the layout only supports large screens (10").  Anyone with a 10" android tablet that would be interested in beta testing the software?  You will need to be familiar with side loading android apps, and enable developer mode.

    The App works over wifi, so your radio must be connected to your router (not directly connected to pc).

    Let me know!

    William


  • W4WHL
    W4WHL Member ✭✭
    edited April 2020
    Closer still!  I changed available step sizes.  to better suit the touch knob.  Added a bit more to the top information display.  All dials and sliders are working 100%.  Just a few buttons left to map such as lock, +rx, agc, xit/rit clear, then I will be done.

    After this is completed, I'm going to focus on VITA.  That will be a big challenge.  I just need to spend many hours dissecting the flexlib.

    image

    Once I'm done (at some point)  I will make alternate layouts for other screen sizes.  The app is designed to handle 2 slices max.  I will not make it handle more.  As I only have a 6300 to test with.  Plus if you are using more than 2 slices, why would you be using and android anyway.

    So who wants to beta test?

    William
  • W4WHL
    W4WHL Member ✭✭
    edited November 2016
    Steve,

    If you see this post, did you ever forward me the VITA document you mentioned?  If not, could you please.

    Thanks!

    William
  • W4WHL
    W4WHL Member ✭✭
    edited July 2016
    I have made good progress understanding the Vita header and determining the stream ID and class code.  So stripping out the payload for just the waterfall, opus, etc should be easy enough.  However, I can find nada on what format the waterfall data is in and what is required to draw it.  From what I can find in flexlib, it just handles the packets and the communication with the radio.  I now know how to **** out the data, just no idea what to do with it.  Also the vita standard, does not seem to explain this either.  Same with opus!  VITA is just a framework for sending data, but where do I find out how to use the data?

    William
  • Chris DL5NAM
    Chris DL5NAM Member ✭✭✭
    edited December 2016
    Hello William, i will try.
    73 Chris
  • Karl KB2AS
    Karl KB2AS Member ✭✭
    edited April 2015
    I'll try it.

    Karl
    KB2AS
  • DH2ID
    DH2ID Dr.med. Member ✭✭
    edited December 2016
    William, I would like to test it.
    73, Alex DH2ID
  • GI4FZD
    GI4FZD Member
    edited June 2016
    I would also like to try it
    cheers
    Paul
    gi4fzd
  • Walt - KZ1F
    Walt - KZ1F Member ✭✭
    edited November 2016
    That part would be in the piece of SSDR FRS did not open, the GUI. You are correct VITA-49 knows nothing about SSDR. The payload from the waterfall is just a bitmap. If you scan through here for posts from Steve Hicks, I believe you will find one addressing that very issue. I suspect then not opening the WPF piece was not an oversight. You are right though, that is where the value is added and that is what makes SSDR a product.
  • W4WHL
    W4WHL Member ✭✭
    edited July 2016
    I figure the payload was just pixels, but I don't know the format.  It does not appear to be standard bitmap.  What I'm looking for is help in converting the payload to something usable. 

  • Walt - KZ1F
    Walt - KZ1F Member ✭✭
    edited November 2016
    I don't have one in front of me but if you look at it does it seem to be a series of RGB values, you know, 24 bit color or even 8 bit? Look at the source code for Fldigi and see how he does it? You could also look at what processing is done in Waterfall.cs and WaterfallTile,cs. I've converted both but don't recall an 'ah ha' moment. So you sir, are blazing this part of the trail. The following should help:

            private void RunTestData()
            {
                while (_radio != null)
                {
                    WaterfallTile tile = GenerateTestDataTile();
                    OnDataReady(this, tile);
                    Thread.Sleep((int)tile.LineDurationMS);
                }
            }

            private uint test_timecode = 0;
            private Random test_random = new Random();
            private WaterfallTile GenerateTestDataTile()
            {
                WaterfallTile tile = new WaterfallTile();
                tile.Timecode = test_timecode++;
                tile.FirstPixelFreq = 14.0;     // why isn't FreqHz correct?
                tile.BinBandwidth = (0.2 / _size.Width);
                tile.LineDurationMS = 100;
                tile.Width = (ushort)(_size.Width*1.2);
                tile.Height = 1;
                
                tile.Data = new ushort[tile.Width*tile.Height];

                for (int i = 0; i < tile.Width * tile.Height; i++)
                {
                    if (i >= 57 && i <= 60)
                        tile.Data[i] = (ushort)test_random.Next(13000, 50000);
                    else tile.Data[i] = (ushort)test_random.Next(13000, 16000);
                    //tile.Data[i] = (ushort)(i * 35);
                }

                return tile;
            }

    But this will be the most challenging part, that and the spectrum display.
    From what Eric did each tile could be 2 dimensional, with width and height.  Even if the height is greater than one, each tile represents a full width, actually a tad over a full width, that would be a question as well.

    My guess is, as I haven't done this yet, is you should look for a graphic operation such as :

    Draws an image at the given x, y position using the width and height of the given image. Where image can come from a stream.
  • Steve-N5AC
    Steve-N5AC Community Manager admin
    edited February 2017
    Sorry for taking so long to get back to you William.  Here's a link to the VITA-49 Information Class that you will need with the UDP API details.  It does not have waterfall information, so that needs to be added, but it does have the panadapter data.

    VRT Information Class Documentation for FLEX-6000
  • Walt - KZ1F
    Walt - KZ1F Member ✭✭
    edited November 2016
    Here is what I would suggest William. Take that sample snippet, you'll need the WaterfallTile.cs to get the makeup of the data you'll be getting and Just do a standalone test pushing the data to a canvas. Instead of the test for active radio, just say while (true) and rather than the onDataReady, just pass your newly formed 'tile' to a routine to pull out the salient attributes and, in my case, cast the data buffer to a byteInputStream, and issue a draw on it. I suspect you'll get one line per data packet. So
    scroll the window one pixel down
    push each packet out starting at 0,0,
    Doing it in that order you'll always end with a valid line at 0,0

    Hopefully that'll present a moving waterfall for you. After, go find yourself a pint of your finest ale. ;-)
  • W4WHL
    W4WHL Member ✭✭
    edited July 2016
    Great idea, I will give this a try!

    William

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.