Web API to set frequency remotely

Hello. Is there an API to remotely set frequency and maybe other settings from a third-party app? I know there is a way to read DOA output (:8081/DOA_value.html). Also, I know that I can update a settings.json file and changes will be applied, but since I want to do this remotely, I’ll have to create some kind of web app, running on a Raspberry, that will receive my commands and update the config file accordingly (I guess I am allowed by the Linux file access restrictions to do so), but is there a workaround? The Android app updates the frequency somehow, as well as the black-backgrounded config page on port 8080, so there must be some kind of existing API that does what I need. Thank you

P.S. Another idea that I have is SSH-ing to a running Pi to update a settings.json every time I want to change frequency, but it is a bit of an overkill

The Android app doesn’t update the frequency, you still need to do that via the web GUI.

We don’t have any API like that built at the moment, it all needs to be done through some middleware that writes the settings.json file. The web mapper can back control the Kraken via the middleware software. If you wanted to develop your own API that might be a good starting point.

@krakenrf_carl
Is “web mapper” a configuration web interface with a black background, that already uses the middleware you mentioned? Can a 3rd-party app use this pre-existing middleware to update the config?

No by web mapper I mean the site at map.krakenrf.com. Unfortunately it does require an authenticated connection from the server. But the code is open source, so you could probably program it to accept a web socket connection from your own control server.

1 Like

@krakenrf_carl
Doesn’t the black-backgrounded config page use WebSockets as well? Can I reuse the way of communicating it already uses to update the configuration?

This can be done in _nodejs/index.js. You can get settings.json and write it. After overwriting, the application will determine that the settings have changed and load it.

@KrakenRF @krakenrf_carl I’ve tried patching the settings.json file to update the frequency manually (center_freq, MHz), but there are multiple other frequency-related fields in the config file, like vfo_freq_0 (in Hz) and fields vfo_freq_1- vfo_freq_15 (in MHz) that are not getting updated automatically when I change the center frequency.

Should I ignore fields vfo_freq_0 - vfo_freq_15 and leave them as is? Or should I also update those fields to match the center_freq? Maybe other fields apart from the vfo_freq_X need updating when the frequency is changed manually (by patching the config file)? Thank you

P.S. It seems that "vfo_freq_0" is the only frequency-related field with a value in Hz, not MHz. Is this correct?

P.P.S. Maybe I should only update a center_freq field and execute some python script to evaluate and update the rest of the frequency-related fields in the config file accordingly to match the center frequency?

@krakenrf_carl could you please correct me?

I think this is along the same lines… but it would be great if you could store 5-10 or more frequencies that you could change to easily for VFO-0, or have it so the Android app can change the frequency directly from the app without having to go to the server page to do it.

I realize the sync/recalibrate/etc will still happen and will take a short time to do it’s thing upon frequency changes.

Obviously, trying to change the frequency on VFO-0 while moving around is tough and unsafe. Making that simpler is what I’m thinking.

My reasoning: I have 5+ channels of bootleggers here I am after (commercial users using ham radio frequencies) and being able to pick one of them fast when I happen to be close to them would be helpful. Sometimes I just drive around with another radio on scan, and when I hear them, I start looking.

I’m not talking about using multiple VFOs, and the limitations of doing so. I can’t use the multiple VFO scenario for this because most of the channels these bootleggers are using are more than 2.4mhz apart.

1 Like

In the mean time (if this ever gets implemented as a feature), you could send the raw HTTP request with a script or something to switch the frequency, that way you wouldn’t have to spend time manually configuring stuff (freq, bandwith, etc) on the web interface, rather just send the HTTP requests with the preconfigured values with a python script or something. This obviously assumes that the frequency you are hunting are in the range of your current physical antenna configuration.This could be further improved by somehow running the appropriate script directly from the phone with a push of a button.

If this is not implemented I will eventually throw something together for this as I need it to :smiley:

That’s not a bad idea. I’ll look into doing that myself too.

If we’re taking feature requests, that’s very high on my list. We’d like to turn a Kraken over to some less advanced users, and having to navigate both the server’s configuration web page and the Android app is less than optimal.

Thanks!!

…R

1 Like

You’ll need to update VFO-0 at least as well. The other VFO’s will need to be updated also if you are using them.