Hello. Can I write my own client to get the current DOA? What I mean is that there is a web server on Raspberry PI on port 8080, that provides a web interface for KrakenSDR configuration and DOA estimation. And I would like to write a client software for personal use, that will extract the current DOA (the one on the compass on the “DOA Estimation” tab). Can I do that? I mean your web client gets this data somehow, as well as the Android application.
So my questions are:
Does a Raspberry PI’s :8080 Kraken web server have an API that could be queried and is it documented somewhere?
If there are no documented APIs, how can I get a current DOA (and current frequency if possible) in the same way the Android app (allegedly) does? I.e. is there an endpoint like GET http://krakensdr:8080/doa that returns something like { angle: 180, frequency: 446.031 } ?
I have tried monitoring web clients’ requests to the raspberry server using the chrome console, but haven’t seen any queries. I thought that the web client makes a request every N ms to get a DOA and then draws the data on the compass, but apparently, I was wrong.
When set to the ‘Kraken App’ DOA Data Format the latest bearing data will be output to an HTML page at “http://PI4_IP_ADDR:8081/DOA_value.html” in the CSV format every update period.
The output format CSV ordering is as follows:
1. UNIX Epoch Time : (13 Digit LONG),
2. Max DOA Angle in Degrees in Compass Convention : (3 Digit 000 - 359, 90deg East),
3. Confidence Value : (0-99 float, higher indicates a better quality reading),
4. RSSI Power in dB : (0 dB is max power),
5. Channel Frequency in Hz,
6. Antenna Array Arrangement : ("UCA"/"ULA"/"Custom"),
7. Latency in ms : (Time from signal arrival at antenna, to result. NOT including network latency.),
8. Station ID : (Name of the KrakenSDR station inputted in the Station Information box in the Web GUI),
9. Latitude,
10. Longitude,
11. GPS Heading,
12. Compass Heading (if available),
13. Main Heading Sensor Used ("GPS"/"Compass"),
14-17. Reserved for possible future use,
18-377. Full 360 degrees DOA output. First element specifies DOA power output at 0 degrees, second element power at 1 degrees etc. NOTE: Uses unit circle convention, so due EAST is classed as 0 degrees, NORTH 90 degrees and so on. Needs to be rotated into compass convention.
If multiple VFO channels are used, each channel will output it’s own unique CSV data from 1-377 separated by a newline character “\n”.
I can not understand what exactly is the VFO. In case I have center frequency Fc I assume that I can see DoA of each signal in the 2.4 MHz BW. Correct? If yes, what VFO offer?
You have 2.4 MHz bandwidth, and within that bandwidth there may be dozens of individual narrowband signals. You can only see the DOA data for the specific signal selected by VFO-0.
If you want to simultaneously gather data for more than one signal you can add more than one VFO, and select each signal that you want.
Thank you. So if a signal is present across the entire 2.4 GHz bandwidth (or most of it), using only VFO-0 should be sufficient. Is that correct? Also, how VFO are implemented? Are like bandpass filtering?
Yes then you can either set the VFO bandwidth to be equal to the entire bandwidth (which may be bad for the Pi4 due to the increased computational requirement), or just use a subset of that signal with a smaller bandwidth which is usually fine.
The VFO is just implemented through FIR decimation.
Thank you for your answer. Could you please provide some information on what exactly (how is calculated) the 3. Confidence Value and the 7. Latency in ms?
Furthermore, I would like to mention that I have calculated the maximum position from the CSV file using the last 360 columns, which are in unit circle convention (let’s call it theta). As you mentioned earlier, the maximum direction of arrival (DoA) angle in the CSV file is in compass convention and located in column 2 (let’s call it phi). However, I found that the calculated angle theta is different from the angle phi. The code sets the relation between the two angles as phi = 360 - theta, but I am curious to know why this relation exists. Could you please explain the reason behind this?
The code to calculate the confidence can be found here krakensdr_doa/krakenSDR_signal_processor.py at main · krakenrf/krakensdr_doa · GitHub under function calculate_doa_papr. It’s a simple SNR type calculation of the DOA graph. A single high DOA peak has greater confidence compared to low or multiple peaks. Note that the confidence value is not used by the KrakenSDR Android App anymore.
Latency is just the time from antenna input to the result being output. It’s only an approximate number.
The output angle may reversed from what you expect because the Android app developer initially used a reverse convention for the angles. So it’s just that way for legacy reasons.
Thank you again for your help. Just to clarify, I understand that the data in the last 360 columns of the CSV file is in the unit circle convention, where 0 is in the east and non-zero values can only be found from 270 to 0 to 90 degrees. The DoA angle (theta) is the position of the maximum of the last 360 columns. To convert to compass convention, I need to calculate phi = 360 - theta. Lastly, if the heading is different than 0, I would need to adjust phi accordingly. Is my understanding correct?
If you’re using a ULA array, the Kraken software will by default calculate both the forward and mirror images, so there will be data in each of the 360 columns. But you can use the “ULA Output Direction” setting if you want to truncate either the forward or backward mirror image.
Hello, I have a follow-up question. I noticed that the maximum confidence level in my data is only 5, even though you mentioned that the values could range from 0 to 99. What does this indicate about the quality of my data? Should I be concerned that these are poor captures? Additionally, since the confidence level is no longer utilized by the Android app, is there any point in analyzing this information?
A low confidence level could mean that there are many peaks on the graph, or wide peaks, indicating multipath, or a low resolution (small for the frequency) antenna array.
But really the confidence level should only be used relatively, against your own data for the same run. You can filter out the log entries with the lowest confidence values if you want to improve processing times.
But TBH, the confidence value was never really a good measure to go by. Getting a value of 99 is impossible in reality, and even in the best cases in reality the confidence value always stays quite low.
Hello, I am studying the code and I can see that the RSSI is the max value for a snapshot of spectrum IQ samples. For one channel DoA can not performed and the rssi is the max_amplitude. For multiple channels DoA can be performed and the RSSI is the max of all the channels?
Ah right I see you are talking about the hardware. Yes there are 5 input channels on the hardware.
For the RSSI, it just takes the value from Channel 1 on the KrakenSDR hardware.
In the software you get 2.4 MHz of bandwidth and so there can be many individual signals within that bandwidth. Taking a single RSSI reading of the entire bandwidth is meaningless.
So you can set multiple IF channels, for each individual signal. Each IF channel in software will output it’s own RSSI reading. Each reading will come from hardware Channel 1 / Antenna 1.
So if I set multiple 2 IF channels the 2 RSSIs will be the peak of power of each channel but by the same antenna (ie. peak power CH1 / Antenna 1, peak power CH2 / Antenna 2)?