Metering class packet

  • 1
  • Question
  • Updated 4 years ago
I'm trying to decode the Metering packet, however i can't find any reference.  Since I do not use the API, do you have any documentation that explains how the payload is arranged?

What I'm looking for is what words in the payload represent SWR etc.

Thanks,

William
Photo of William Hemmingsen

William Hemmingsen

  • 573 Posts
  • 278 Reply Likes

Posted 4 years ago

  • 1
Photo of Stu Phillips - K6TU

Stu Phillips - K6TU, Elmer

  • 642 Posts
  • 256 Reply Likes
William,

There is no documentation that describes what you want.  The meter data is sent with a VITA-49 header and is a stream extension packet.  The payload of the packet contains the meters with each meter sent as a 32 bit word - the top 16 bits is the meter number, the lower 16 bits is the value of the meter.

Depending on the meter type, it has to be scaled in order to get the correct value.

To determine which meter is which, you will need to do a "sub meter all" to get the status messages when meters are added or deleted from the radio.  Alternatively, since the TX meters are fixed, you can send a command "meter list" which will return the meter numbers, scale etc to you.

Meter number 17 is the SWR value on my 6700 - I don't know if the meter numbers are the same across all models.

#17.src=TX-#17.num=3#17.nam=SWR#17.low=1.0#17.hi=999.0#17.desc=RF SWR#17.unit=SWR#17.fps=20
You can download the source code of the FlexLib from the FlexRadio web site at:

http://www.flexradio.com/downloads/flexlib_api_v1-4-11-zip/

The source code is the ultimate documentation source.

Hope this helps.
Stu K6TU
Photo of William Hemmingsen

William Hemmingsen

  • 573 Posts
  • 278 Reply Likes
Stu,

Thanks for the information, but what I need to know is the breakdown of the actual packet payload.  Since I do not use the API, I need to be able to strip the data I need directly out of the UDP packets. 

I looking for a breakdown of the bytes in the payload, and what they are.  I can not find this anywhere in the API code.  But if anyone knows where the meter packets are parsed in the API, that would help

Regards,

William
(Edited)
Photo of Stu Phillips - K6TU

Stu Phillips - K6TU, Elmer

  • 642 Posts
  • 256 Reply Likes
Follow the link I inserted above and download the FlexLib source code.  The files you want are in the FlexLib directory with obvious names.

Look for the file Meter.cs in that directory, then look at VitaPacket.cs in the Vita directory.

Stu K6TU
Photo of Walt - KZ1F

Walt - KZ1F

  • 3040 Posts
  • 644 Reply Likes
Yep, you are correct, I explained it wrong to Enzo. This is from my code.

        int num_meters = payload_bytes / 4;

        ids = new short[num_meters];
        vals = new short[num_meters];

        for (int i = 0; i < num_meters; i++) {
            ids[i] = data.getShort(index);
            index += 2;
            vals[i] = data.getShort(index);
            index += 2;
        }
Photo of William Hemmingsen

William Hemmingsen

  • 573 Posts
  • 278 Reply Likes
Thanks Walt that is helpful
Photo of William Hemmingsen

William Hemmingsen

  • 573 Posts
  • 278 Reply Likes
Thanks Stu!  I found what I needed.

William
Photo of IW7DMH, Enzo

IW7DMH, Enzo

  • 353 Posts
  • 84 Reply Likes
Please, can you "paste" here a sample metering packet so I can test my parser and be sure it works?
I am having troubles with pkt_type, header.c and header.t fields. I can't get the expected value respectively 3, 0 and 0 typical of a metering packet.

Thank you very much
Enzo
Photo of William Hemmingsen

William Hemmingsen

  • 573 Posts
  • 278 Reply Likes
Here is a packet

38DF000A0000070000001C2D534C80020000000000000000000000000001CCB000078300000C00000000003400A100AF00B5009F00A1009C00A000A200A0009500A2009E00A200990098009A009C00AD00A800A2009A009C009200A500A200A30096009A00AB0098009D00AB00A6009B009C00A500AF00AC00BF00A600A400BE00A3009C009F00A1009E00A1009C009A009D00990092009B00A700A600A400A700A100A300A6009A00A000A5009400A000A5009F00A300A700A600AD00A100B700A800A6009C009200A0009D00A300B100930093009D00A500B5009B00940095009900A800BE00AC00A100A9009E009B0097009E00A900A600B900AF009900A700BC00BA00A7009B00A300A700A4009B00B000B300C600C200AE009C00AA00A3009E00A900A5009C009E00AD009C009F00A600B200AF00AD00AB00A2009A00A1009B00A200A9009D00A600A200A70098009B00A800AD00AF00B500B100A600A400A800A5009C009D00A900A100B600AB00A400930095009A009400950095009F00A300A500B700B600B100A6009D009E00B700AE00AD00A1009D00A5009F009B009B009B009C009B00A600B900BB00A40098008F009F0091009D00A7009D00A3009E009B009C009A009700A600A2009600A100A300A9009C009A00970094008E009A009C00A6009F009600AE00A2009C0091009A00A600A300A0009900990092009C00A1009800A200AD00B200A000960099009D00AB00A800A400AB00A6009900AA00AF009E00A000BA0094009800AB00A2009700AD00AD00C700AF00AB00AB00AD00AC00B200AA00B500B400A400A900A0009F00A200AE00970097009D00A100A900A200A200AE00B800BF00A4009A009E00AF00AE00A800AA00AB009C009E00AF00A70099009E00A6009E00A000AB00A600A000A700A800A1009C00A10096009E00A200A500A6009C00C100A900A400A000A600A30097008D0092009A009E00960096009800910099009D009800AB009F00A200AA0099009B00A700B000BE00A400A7009E009900A400AD00AB00A600B600A200B200AD00A7009D00A400B800C200C800AA00AE00A700A500B700AC00A0009B00A000BC00B900A800A500B600AA00B1009E0096009600910095009D009B00AE00B000B000B800A600A600B200A0009800A000A600B900AA00A200AF00AD00B000B000AF00A9009D00A3009E009800A400A700AC00AA00A900AA00A700B400B500A400A500B000AE00A900B000B600A3009F0099009A00AA00AF00B000AF00A100A900A200A200A600B100A800AE00B6009D0080008700A100A800A7009E00A500B200AB00A100A900BA00B7009B009A00AD00A3009D00A9009D00A900BD00B000A400AB00B100A400A200AE00A7009B0094009600A000B100A4009700A6009A00920091009F00AC00B100A50094009E00AE00A9009B009C009A009700A100A4009500A200B900C500A8009900A200AE00A900A9009900910095009B00AA00BC00BA00B100AD00A2009D00A900BE00A900B000AC00AD00A900A100B200AA00AB009F00AA00B300B600AE009F009F009F009900A4009D00970094009600A900A30098009500A400A900AA009E00A300AF00A500A000AA00B700B400AF00A800A300A300A500A600A400AA0098009F00AE00B6009D00A800AC00AE00A600A3009C009900A8008D009200A200A100AA00B700B000A900A100A1009E009A0094009A009F009E00A200A800990094009900A300AA009D009D00AE00BE00B900A900980093009400AD00A700A20096009D00A6009D009C00A700A7009A00910092009D00A1009D00A000AA0096009900A700A700A7009D00A9009E00A500A000A2009E00A200B400960098009A009B00A200AE00B4009D009A00B000B300AC009D009700A500A900AB00A500A1009900A300B000A600AD00A000A200A500A700AE00A100A600B300A200A200A3009900A7009F00A500A300A900AA009B00A1009D009900A400B800AC00A900A1009C009B00AD009E009E00A3009C00A500A500A0009E009A00A900B500A700AF00AA00B100A400AD00B700BC00A400AE00B400B700B600A900A1009C00A0009E00A100AF00B100B900B700A900A100A6009C00A700AC00AA00A900A4009B00A500AA00B000A600A8009A00A000A400A600AD00B200B100BB00AF00B000C000C300C400B900B900A40099009F00A2009500AF00AA00A200A3009A008A008C009E00A6009C009900A300A000A500AE00B500B100A2009A00A800A2009B00A4009F00A20099009600C700BA009C0094009C00AB00A700A700AE00AD00A8009E0098009A0099009D00A900AC00AB00A100A900A700A9009B00A00097009E00A7009B009C00A000A800A2009A00A900C300BC00B700BB00C300C300B900B100B100AF00B700A60094008F009900BC00AF00B000B500AA009B009E00AE00B400B000AC00AA00B900B700A400B500A9009800A300AD00A10098009B009B00A400A200A8009A00A400AA00A600AC0093009F009E009E00A3009D00A100B2009B00A200AA00B100A400A2008E00960096009B00A200A2009D00AB00B700B100AB00BC00B200B700C300B800A300A3009B00910098009700A000A700B500AC00B300AF00AB00A500A200A100A200B400B400AD00AA009F0091008C00A400A700AB00AC00A100A700A700A900A900A000AF00AE009A009A00A200A000A7009D00AB00AE00A700A200A000B000AB00AA00A800AE00C500C000A3009B00B000AD00A6009F00A000A200A5009C00A0008E009900A700AE00A300AB00AA009D009C00A300A700B500B600A6009C00A200A900B4009D009F00A300A70
Photo of IW7DMH, Enzo

IW7DMH, Enzo

  • 353 Posts
  • 84 Reply Likes
Thank you very much
Photo of Walt - KZ1F

Walt - KZ1F

  • 3040 Posts
  • 644 Reply Likes
Enzo, what are you using for a language?
Photo of IW7DMH, Enzo

IW7DMH, Enzo

  • 353 Posts
  • 84 Reply Likes
I am in the Arduino Due microcontroller enviroment. It uses Atmel SAM3X8E ARM Cortex-M3 CPU so I am using plain C for GUI and phisical devices like rotary encoders, pushbuttons and touch screen display. I also use C++ for support libraries. This is not my world as I am a SJCP and I don't like to deal with pointers and explicit memory allocation (and its related memory leaks).
Anyway my challenge is going to end asa I'll complete the metering protocol. I would like to switch to another more powerful hw platform. I like UDOO as it has out of the box WIFI, GigaBit Ethernet port, Bluetooth and has a dedicated 15' capacitive touch screen. It includes also a native connection with a DUE board so I could reuse most of the code I have already written. UDOO can support different OS but I'll point to Android as it offers the best and innovative GUI.
I hope in the mean time the someone :) can realease its libraries so I can go on without having to reinvent the wheel.
Photo of Walt - KZ1F

Walt - KZ1F

  • 3040 Posts
  • 644 Reply Likes
I have not conclusively decided whether to release the source of my library and/or the jar file representing my library. To be sure, it is not fully tested as yet, nor is it fully implemented. However, I am certainly willing to share snippets.

I have made reference to work I did while at Monster.com processing the results of virtually every enter typed at any point in time with blindingly fast execution time. In that effort I became well versed with highly scalable nonblocking network IO. There is a package that does that but, at that time, was not mature enough for me to have used it. However, it is currently quite mature. I use that as the networking piece as I can simply add codex's and retrieve as a call back, a fully contained instance of the Vita-49 object having just arrived. In those, aforementioned, snippets, you'll see references, to getInt(index) and getFloat(index) and getByte(index). In viewing those method invocations you can see where the next item, int, byte, float, etc, is being processed.
For both you and William, if it makes sense to use an object based approach, we can discuss it here or <my call> at arrl dot net. If, you'd rather blaze your own trail, but have questions, I will do my best to provide pointers.
Photo of William Hemmingsen

William Hemmingsen

  • 573 Posts
  • 278 Reply Likes
Walt,

I ran some test using your code snippet.  I dumped the payload from a meter packet into a byte buffer.



                        ByteBuffer tempbuff = ByteBuffer.wrap(tempdata);
                        index=0;
                        int num_meters = tempbuff.capacity() / 4;

                        short [] ids = new short[num_meters];
                        short [] vals = new short[num_meters];

                        for (int i = 0; i < num_meters; i++) {
                            ids[i] = tempbuff.getShort(index);
                            index+=2;
                            vals[i] = tempbuff.getShort(index);
                            index+=2;
                        }


But I am getting non nonsensical data.  I assumed you were using bytebuffer hence the getShort(index).  But now not so sure.   There seems to be a repeating patern (underlined) in the data, but its making zero since to me.  Maybe I just don't understand what I'm looking at.  Any idea?


ids [5080, 5336, 5584, 5840, 6125, 462, 708, 2179, 3072, 5080, 5336, 5584, 5840, 6125, 462, 708, 2179, 3072, 5080, 5336, 5584, 5840, 6125, 462, 708, 2179, 3072, 5080, 5336, etc ect ect

value [-14592, -14592, -20736, -20736, 23040, 16896, 0, 0, 0, -14592, -14592, -20736, -20736, 23040, 16896, 0, 0, 0, -14592, -14592, -20736, -20736, 23040, 16896, 0, 0, 0, -14592, etc etc etc



Regards,

William
Photo of Walt - KZ1F

Walt - KZ1F

  • 3040 Posts
  • 644 Reply Likes
Hmmm, I never said metering was perfect. I was hopeful. So I am looking at a meter packet that just arrived. In it there are the two short arrays for id and value, here is what this packet has:

id    value
1      -12146
2      -15360
4      -32000
5      -32000

etc. Now, these are 16 bit signed fields. The way to convert them to unsigned shorts is to, effectively, cast them to ints by
int foo = meterValue & 0x0000ffff or
int foo = Short.toUnsignedInt(meterValue);

this would render a +55670. I use option 2 Short.toUnsignedInt(). This is likely faster as it is evaluated to a native machine language instruction. I could be wrong as that is an implementation detail.

Yes, and you were correct, these all come from ByteBuf.
(Edited)
Photo of IW7DMH, Enzo

IW7DMH, Enzo

  • 353 Posts
  • 84 Reply Likes
I don't know if I have understood William doubt, but I have also found a repeating pattern.
Below are my notes about a test on my rig. It seems the packet has 48 meters, but they are 12 repeated 4 times.

 
(Edited)
Photo of Walt - KZ1F

Walt - KZ1F

  • 3040 Posts
  • 644 Reply Likes
William and Enzo. While I answered a good question, it was entirely what you had asked William. The meter object gets constructed by two sources. The first is from the VitaMeterPacket, which defines the meter's values. The second, and the cause for your concern is the meterstatus message:
status    String    ObjectVariable     ==
3.src=TX-#3.num=8#3.nam=CODEC#3.low=-150.0#3.hi=20.0#3.desc=Signal strength of CODEC output#3.unit=dBFS#3.fps=10#
Photo of William Hemmingsen

William Hemmingsen

  • 573 Posts
  • 278 Reply Likes
That was super helpful, and got me in the game!  Like for you !
Photo of Walt - KZ1F

Walt - KZ1F

  • 3040 Posts
  • 644 Reply Likes
Enzo, 48 sounds correct. Each meter is 4 bytes so 48 would be 12 meters.

Sorry...above I meant wasn't entirely what you had asked.
So in this case when the status arrives, it finds the partial meter object and fills in source, high low etc.
(Edited)
Photo of William Hemmingsen

William Hemmingsen

  • 573 Posts
  • 278 Reply Likes
I see now that the data, comes in in chunks, not all meters are sent at the same time, they seem to alternate in a repeating pattern.  sometimes 1,2,4,5,7  other times 9,10, 13, 15, 17  and other times 19,20,21 etc ect.

So what I did was just parse the incoming packets searching for the ID I want, then grab the next 16bits for the value.  This worked!

Ok I now can pull live S-Meter data.  Now how do I convert this to a useful data?

Im getting an integer of ~55468 that varies +- with singal strength.  So how do I convert this into dbm or s-units?

Doing a sub meter all told me that id 21 was "signal strength in passband"

I did something like this inside the for loop

if ((ids[i] & 0x0000ffff) == 21){
     signalstrength = vals[i] & 0x0000ffff;
}

logging the output show the values corresponded to to the signal strength.

So now how do I convert this value to something useful?

William
Photo of James Whiteway

James Whiteway

  • 914 Posts
  • 234 Reply Likes
William, that makes my head hurt! And it's why I like C# and using the Flexlib API.

The api spits out the value in dbm. I see the portability in doing it your way, but, I'm lazy and like Windows and MS Visual Studio for development.

I envy your ability to get up to speed on Java development. If Flex radio ever needs another developer, you might just get a call!

James

WD5GWY
(Edited)
Photo of Stu Phillips - K6TU

Stu Phillips - K6TU, Elmer

  • 642 Posts
  • 256 Reply Likes
The above snippet is code I wrote.

You can find all the logic for parsing/decoding the meter values in the file Meter.cs that is in the FlexLib directory from the link I posted somewhere above.

Go to the FlexRadio web site and download the source code of the FlexLib version that is written in C#.  Everything you need is in that code.

Stu K6TU
Photo of Stu Phillips - K6TU

Stu Phillips - K6TU, Elmer

  • 642 Posts
  • 256 Reply Likes
Ah ha!  The case of the crossing responses! :-)

Stu K6TU
Photo of Walt - KZ1F

Walt - KZ1F

  • 3040 Posts
  • 644 Reply Likes
Again, thanks Stu, That routine escaped my mind.

In java:
    public final void updateValue(int new_raw_value) {
        _raw_value = new_raw_value;

        switch (_units) {
            case Dbm:
            case Dbfs:
            case SWR:
                _value = _raw_value / 128.0f;
                break;
            case Volts:
            case Amps:
                _value = _raw_value / 1024.0f;
                break;
            case Degrees:
                _value = _raw_value / 64.0f;
                break;
        }

        OnDataReady(this, _value);
    }
Photo of James Whiteway

James Whiteway

  • 914 Posts
  • 234 Reply Likes
Walt, I'm the one that said the values are in dbm. I guess I wasn't clear enough and should of added "when queried thru Flexlib api". That's how I retreive them in the latest version of my test program. (Windows pgm written in C Sharp)
James
Photo of Walt - KZ1F

Walt - KZ1F

  • 3040 Posts
  • 644 Reply Likes
James, for the longest time...well over a year now, I had a series of conversations with Steve. In fact, I had a conversation with Greg at Boxboro, has it been 3, years ago. The thrust of my argument got refined to SmartSDR for Windows, implies SmartSDR for other platforms. The net of all that was, well, not my place to quote others, but it led me to 'screw it, I'll do it myself then".  I had a conversation with Stu, that didn't turn out quite as well as I had hoped. But it was always my intention. However, I worked and looking at the exist code I realized to have the same functionality was going to be a monumental effort. Fortunately I was somewhere between retired and working March of 2014 so I then had the time to do it. I took another position shortly there after and that went to this last Feb. There were several vectors that place me right on the verge of selling the radio for a K-3 or TS-590. Ironically, it wasn't that the radio sucked, quite the contrary, it was that Windows sucks. I have Windows on my laptop here for one reason only, Turbotax. Well, now it's two. In another couple of months it'll be strictly for DM-780 and cw-sweeper.  I don't really want to go into what S(er)SDR, ...I can not legally call what I am doing SSDR, it'll have more features and be directly integrated with my rotor, QRZ, my KAT-500 and KPA-500. It'll do some things that I won't telegraph now but it will also have a price tag. But even if it doesn't sell, it'll be on my Nexus 9 and my multi-monitor Linux system. Anyone remotely acclimated to SSDR will totally understand S(er)SDR. That, btw, is its working name, project name, if you will. Since it will probably offend people I don't want to offend, it'll likely have a product name in the near future. Oh, it WILL beat Maestro to the market.

I used to be huge in Windows, knew pretty much the internals, had an SDK at home. yada yada until Microsoft went one bridge too far. I love Linux as a development and execution platform, I've done really kickin web apps running under Linux, done a lot of devops stuff, Puppet, Juju, Openstack (I have a multi server OpenStack cloud in the basement, before that a multi-server Eucalyptus cloud. I did a lot of probono work with Eucalyptus, sort of Tim's position at FRS. As I've said before, on a good day I can spell .Net.

It took me the longest time to 'get' .Net events. I've got a kind of tenuous working knowledge of them now  But going through the whole of Flexlib to design it to be portable is not a trivial task. It's not 'hard' per se, it is immensely tedious. I believe Stu said that the other day, yep, he is not lying about that. I can see daylight now. There are times, however, when the question rears up, "why am I doing this?????".

One decision I made which slowed this process to a crawl, is do the entire kernel first, test it out, make sure it's working correctly, then do the GUI That way I am not debugging multiple things at once. I am now adding in the GUI. I did a you tube on the panadapter output the other day. You can barely see it but it is jumpin. I think it is faster than SSDR. This is a 2.4GHz to my laptop's 3.2GHz. Watching it live, it totally smokes. I do have a wireframe of the GUI in my head and will start building it out, slowly but surely. I am up to 87 classes so far not counting GUI classes.

That piece of code Stu mentioned, I had that. I vaguely remembered various divisors and then there was Tim's comment about DDUtil so it was all swirling around in the ether. As soon as Stu showed that snippet, it clicked.
Photo of William Hemmingsen

William Hemmingsen

  • 573 Posts
  • 278 Reply Likes
I'm still lost :(

How do these values represent dbm?

 short -12146
 int +55670

I'm not useing the API, I'm just decoding the payload in java.

For ID 21, which in the 6300 is ;   

S7F7A2149|meter 21.src=SLC#21.num=0#21.nam=LEVEL#21.low=-150.0#21.hi=20.0#21.desc=Signal strength of signals in the filter passband#21.unit=dBm#21.fps=10#

I'm getting a short value (next 16 bits) of -12146 which cast to an int value of 55670

Walt, I used your values above, because mine are almost identical.  So I guess I missed something.

Sorry for what may be a stupid question.  This is new territory for me :)

William
Photo of William Hemmingsen

William Hemmingsen

  • 573 Posts
  • 278 Reply Likes
I compared SSDR, and SmartSDR has a considerable lag also, so I guess this is just the way it is.  Never noticed this lag before,

By the way, the waterfall, does not show all that white noise as seen in the video.  Its some weird affect of the camera.
(Edited)
Photo of Walt - KZ1F

Walt - KZ1F

  • 3040 Posts
  • 644 Reply Likes
Not sure I know what you mean by your first sentence concerning lag.
OK, your turn. I am still not sure what band segment is displaying in my pan. This morning I added a slice, set it to 10.000 (WWV) and set that as the pan's center frequency. I was expecting to see a nice, well defined, AM signal. Nope. When I displayed the band, freq, etc about the pan prior to creating the slice, they were not populated. After creating the slice they were populated. Oh, the radio did change freq as I did hear WWV. What is your startup sequence prior to manually adjusting the freq, as far as
create pan
create slice
set set set etc?
Photo of William Hemmingsen

William Hemmingsen

  • 573 Posts
  • 278 Reply Likes
The S-meter is a sec or so behind the peaks displayed on the panadapter.  I found another post on here about the S-meter delay.  But it was for v 1.38.  It seems there is still this lag.  Anyway, about the panadpter;

Here are my startup commands.

c45|display pan create x=1400 y=200

That is it.  The I adjust the bandwidth to preference

c45|display pan set 0x40000000 bandwidth=+bandwidth

Then I tune frequency;

C45|slice tune +slice+ " + newFreqA

Finally center on tuned frequency;

C45|display pan set 0x40000000 center=" + newFreqA


I just tried you exact test on 15.0 WWV and it worked as expected.


William
Photo of William Hemmingsen

William Hemmingsen

  • 573 Posts
  • 278 Reply Likes
Other note - When I create the pan, it automatically creates slice 0, so I omit that step.

Other than that I do all the sub commands, prior to creating anything, this populates all my variables.

William
(Edited)
Photo of Walt - KZ1F

Walt - KZ1F

  • 3040 Posts
  • 644 Reply Likes
I reported an issue months ago where SSDR would start with no pan, others experience this as well. I did add a warning msg in my code when the slice isn't created, I see that in my log.. The display pan ... Fails as I surmised the creat pan fails, which I've now verified.
(Edited)
Photo of William Hemmingsen

William Hemmingsen

  • 573 Posts
  • 278 Reply Likes
Here is my smeter progress, seems accurate enough, but just a bit laggy

Photo of IW7DMH, Enzo

IW7DMH, Enzo

  • 353 Posts
  • 84 Reply Likes
I have two other questions:

- when in meter list I get fps=0 does it mean I'll never get that meter? or do I have to ignore fps value? It happens for both voltages and PA temperature meters.

- what about the conversion from dBm values? It seems it is not handled in Meter.cs - I think it needs a special handler, but I can't find where in flexLib api's code.

Thank you
Enzo
Photo of Walt - KZ1F

Walt - KZ1F

  • 3040 Posts
  • 644 Reply Likes
There is no meter for voltage and temp...they are just reported values. If you look at DDUtil, you can see how they are reported.
In meter.cs there is a method UpdateValue(int reportedValue) that does that conversion.
(Edited)
Photo of Walt - KZ1F

Walt - KZ1F

  • 3040 Posts
  • 644 Reply Likes
William, here is what I sent:

            Panadapter pan = new Panadapter(radio, new Size(1000, 500));
            PanDataReadyEventHandler tempVar = (Panadapter panx, short[] data) -> processPanData(panx, data);
            pan.addDataReadyEventListeners(tempVar);
            boolean panResult = pan.RequestPanadapterFromRadio();
            if (panResult) {
                Slice slc = new Slice(radio, 10.000, "ANT1", "AM");
                slc.RequestSliceFromRadio();
                System.out.println("Pan created");
                pan.setBandwidth(20000);
                pan.setCenterFreq(10.000);
                System.out.println(pan.getAutoCenter());
                System.out.println(pan.getBand());
                System.out.println(pan.getBandwidth());
                System.out.println(pan.getCenterFreq());
                System.out.println(Integer.toHexString(pan.getChildWaterfallStreamID()));

Here is what I received, so I have to troubleshoot why. Although it does explain why I couldn't figure out last night what it was receiving.

received status SB61421A5|display pan 0x40000000 x_pixels=1000 y_pixels=500 center=14.1 bandwidth=0.2 min_dbm=-125 max_dbm=-40 fps=25 average=0 weighted_average=0 rfgain=0 rxant=ANT1 wide=0 loopa=0 loopb=0 band=20 daxiq=0 daxiq_rate=0 capacity=16 available=16 waterfall=42000000 min_bw=0.004919999957085 max_bw=14.74560058594 xvtr= pre= ant_list=ANT1,ANT2,RX_A,XVTR
Photo of William Hemmingsen

William Hemmingsen

  • 573 Posts
  • 278 Reply Likes
Hmm so something is not working there.  My code is simple in this regard, I just send the strings.  I keep a telnet up to the radio that has all the sub commands ran.  This way I can see all the radio messages.  It makes troubleshoot easy.

Are you sure that 10.000 is valid?  I thought when setting frequency you use an interger as in 10000000. My code sets the frequency like this

c45|slice tune 0 10000000

and

C45|display pan set 0x40000000 center=10000000

William
Photo of William Hemmingsen

William Hemmingsen

  • 573 Posts
  • 278 Reply Likes
So did you figure out your issue?
Photo of Steve - N5AC

Steve - N5AC, VP Engineering / CTO

  • 1034 Posts
  • 1008 Reply Likes
If you create a panadapter without a frequency, I believe we default the frequency to 14.1MHz
Photo of Walt - KZ1F

Walt - KZ1F

  • 3040 Posts
  • 644 Reply Likes
Yep, that is pretty much what I figured as I found no reference to 14.1 (14.088 is popular too) in any FlexLib code. From what Willam said he, doing straight telnet style commands, adds the freq on the command. FlexLib doesn't do this, in fact there is only the one ctor. I can fix that. So what perplexes me is how, given the frequency is not specified on the disp pan create blah blah, the slice is re assigned a new freq. I deduce that has to be occuring in the GUI.

One other very interesting behavior is, recall the problem I reported months ago about no panadapter generated upon SSDR startup? In looking through the code I discover, well it appeared, the only way that could happen is during the display pan create ... tcp cmd it would fail and, the only reason I could deduce it would fail is the error code "could not create a receiver". There is a notation in the current code where Eric makes the comment, to the effect, "This is happening way more than I would have thought". The place that comment exists is in the area where there is a failure of slice.... inuse=1, I am seeing that all over the place in  my log. I have yet to figure out how to enable the SSDR logging.

BTW, Steve, Eric, whoever, The panadapter display is VERY animated. It is updating visibly faster than it does on my Windows laptop, and I am displaying a window MUCH larger than possible on the 15" laptop. FWIW. I am next going to start plumbing in the final GUI environment. This will be done in a few months. Now I have a deadline.
(Edited)
Photo of Steve - N5AC

Steve - N5AC, VP Engineering / CTO

  • 1034 Posts
  • 1008 Reply Likes
Walt, the guys in the office are very busy as you might imagine.  We read a lot (most/all) of the posts here in the community.  We see our job as to help unstick developers that get lost / have issues with the API / etc.  There are a lot of guys in the community that can also help and many that are doing things quite rapidly.  If you have a specific issue, it would be best to post a separate thread/topic about the issue and ask the question / provide details as concisely as possible.  The three paragraphs above dance around what may be issues, but we can't really tell from the descriptions what is going on and in the one sentence where there is a question mark, I can't tell if it is a question or a comment.

For example, your last paragraph tends to say you think that there is a bug in the panadapter update rate.  If you want us to look into this and respond, post your code and a video of what you see.
Photo of Walt - KZ1F

Walt - KZ1F

  • 3040 Posts
  • 644 Reply Likes
got it
Photo of Walt - KZ1F

Walt - KZ1F

  • 3040 Posts
  • 644 Reply Likes
William, do you have an email address we can use? You can send it to me at <my call> at arrl dot net.

Thanks,

Walt - kz1f