KrakenSDR API endpoints and documentation

You’re on older code without the fix, that is from January.

Either download the latest image from KrakenSDR Images - Google Drive

Then do a “git pull” in the krakensdr_doa/krakensdr_doa folder, or give me a couple of weeks until I’ve updated the image files.

1 Like

Thanks I will get the latest DoA code from the main branch using git clone as the firmware code has not changed for a while.

Man I got the latest of everything using the install script. I get the same as I said in the previous message. For example for one VFO (i.e j=0) the theta_0_list[0] is 348 and the doa_result_log is

 [2.5347063541412354, 2.332536458969116, 2.135164737701416, 1.9445171356201172, 1.7621545791625977, 1.5893044471740723, 1.4268951416015625, 1.2755942344665527, 1.1358401775360107, 1.00787043571472
17, 0.8917531967163086, 0.7874042987823486, 0.6946120262145996, 0.6130518913269043, 0.5423026084899902, 0.4818596839904785, 0.43114709854125977, 0.3895268440246582, 0.356309175491333, 0.330766201019287
1, 0.312136173248291, 0.2996363639831543, 0.29247283935546875, 0.28984999656677246, 0.29097914695739746, 0.2950928211212158, 0.3014514446258545, 0.3093528747558594, 0.3181467056274414, 0.32723331451416
016, 0.33608007431030273, 0.3442203998565674, 0.3512609004974365, 0.35688138008117676, 0.3608357906341553, 0.36295175552368164, 0.36312246322631836, 0.36130809783935547, 0.35752439498901367, 0.35183811
18774414, 0.3443589210510254, 0.33522939682006836, 0.32462072372436523, 0.31271934509277344, 0.2997286319732666, 0.28585100173950195, 0.27129220962524414, 0.25625085830688477, 0.24091386795043945, 0.22
545933723449707, 0.21004772186279297, 0.1948237419128418, 0.17991399765014648, 0.16542816162109375, 0.1514577865600586, 0.1380763053894043, 0.12534379959106445, 0.11330270767211914, 0.10198259353637695
, 0.0913991928100586, 0.08156108856201172, 0.0724630355834961, 0.06409263610839844, 0.05643177032470703, 0.049454689025878906, 0.04313373565673828, 0.03743410110473633, 0.032321929931640625, 0.02775812
1490478516, 0.023706912994384766, 0.020128726959228516, 0.016985416412353516, 0.014239788055419922, 0.01185464859008789, 0.009794235229492188, 0.008027076721191406, 0.006520271301269531, 0.005245208740
234375, 0.004172325134277344, 0.003277301788330078, 0.002537250518798828, 0.0019292831420898438, 0.0014367103576660156, 0.0010404586791992188, 0.0007266998291015625, 0.0004830360412597656, 0.0002970695
495605469, 0.0001621246337890625, 7.104873657226562e-05, 1.7642974853515625e-05, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0
.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.
0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1743459701538086, 0.17
441129684448242, 0.1746072769165039, 0.17493581771850586, 0.1753988265991211, 0.17599916458129883, 0.17673921585083008, 0.1776270866394043, 0.1786665916442871, 0.17986488342285156, 0.1812300682067871,
0.18277311325073242, 0.18450546264648438, 0.18643760681152344, 0.18858623504638672, 0.19096755981445312, 0.19360065460205078, 0.19650554656982422, 0.1997065544128418, 0.2032308578491211, 0.207106590270
9961, 0.21136903762817383, 0.21605324745178223, 0.22120118141174316, 0.22685742378234863, 0.23307156562805176, 0.2399001121520996, 0.24740290641784668, 0.2556488513946533, 0.2647101879119873, 0.2746691
7037963867, 0.2856159210205078, 0.29764699935913086, 0.3108706474304199, 0.32540392875671387, 0.34137463569641113, 0.35892343521118164, 0.3782007694244385, 0.3993721008300781, 0.42261505126953125, 0.44
81239318847656, 0.4761059284210205, 0.5067813396453857, 0.5403907299041748, 0.5771865844726562, 0.6174380779266357, 0.6614270210266113, 0.7094523906707764, 0.7618210315704346, 0.8188540935516357, 0.880
8779716491699, 0.9482245445251465, 1.0212266445159912, 1.100210189819336, 1.1854922771453857, 1.2773692607879639, 1.3761100769042969, 1.4819438457489014, 1.595045566558838, 1.7155232429504395, 1.843395
709991455, 1.9785711765289307, 2.120823383331299, 2.2697606086730957, 2.4247958660125732, 2.585103988647461, 2.7495925426483154, 2.9168591499328613, 3.085153818130493, 3.2523558139801025, 3.41595506668
0908, 3.5730621814727783, 3.7204430103302, 3.8545942306518555, 3.971867084503174, 4.068631649017334, 4.141490459442139, 4.187505722045898, 4.204436302185059, 4.190935134887695, 4.1466803550720215, 4.07
2417736053467, 3.969913959503174, 3.8418078422546387, 3.691411018371582, 3.5224742889404297, 3.3389480113983154, 3.144782781600952, 2.9437549114227295, 2.7393548488616943]

generated by

doa_result_log = self.doa_result_log_list[j] + np.abs(np.min(self.doa_result_log_list[j])) for j=0

Then if I get doa_result_log.index(max(doa_result_log])) I get again 348. I don’t know if something changes during the writing on the csv file.

Is 348 deg also what you’re seeing in the web interface as the maximum value, when you have the polar plot graph in compass mode?

Yes, it is the same in plot graph too (both in Polar and compass plot). I am monitoring only the back of the antenna array.

This question is regarding the angle convention used for the Max DOA field (second field after Unix Epoch Time) in the CSV returned by http://PI4_IP_ADDR:8081/DOA_value.html. I’m not using the Android app. I’m just polling port 8081 to get the value. Is the angle relative to the antenna array (so that zero degrees represents the vector from the center of the array to antenna #0), or is it absolute (so that zero degrees represents geographic North)?

Of course, in order for it to be absolute, it would have to compute the heading of the front of the antenna array (presumably by comparing successive GPS locations and assuming the antenna array is facing the front of the vehicle). Does it actually do this? I know the Android app has the option to use the phone’s compass, but like I said, I’m not using the Android app.

Thanks!

The data from the Kraken has no idea about the current orientation of the antenna.

So max DOA bearing should be relative to the antenna array with the convention that antenna 0 faces in the forward direction.

Thanks for confirming, Carl. I’m aware you already know the following info. I’m posting it here to benefit others.

I am successfully able to compute the absolute (compass) DoA by first computing the heading of the antenna array, then using (heading + DoA), where DoA is the value in the second column of the CSV returned from http://<host_ip>:8081/DOA_value.html. This is the same value in the “DOA” field in the XML returned from http://<host_ip>:8081/doa.xml

‘heading’ is computed by calculating the direction vector from the two most recent GPS positions, and DoA is obtained from DOA_value.html.

Once I did that, I was able to get the absolute DoA direction. Of course, this assumes that antenna zero is in “front” (pointing toward the front of the car) and that the car (if in motion) is moving forward (pretty safe assumption).

It’s important to distinguish this from the “unit circle convention” which is used for the full 360 degrees DOA power output (columns 18-377). In the unit circle convention, 0 degrees is Due East, and angles increase counter-clockwise.

If you are calculating the maximum DOA from the full 360-degree output (unit circle convention), and want to convert it to the compass convention to match the second column, the relationship is phi = 360 - theta, where theta is the angle in unit circle convention and phi is the angle in compass convention. This inverse relationship exists due to legacy reasons with how the Android app was initially developed.