AlexandreRouma / SDRPlusPlus

Cross-Platform SDR Software
GNU General Public License v3.0
4.05k stars 556 forks source link

spyserver_source: causes remote server to terminate on connection #109

Closed 10man closed 3 years ago

10man commented 3 years ago

I am new to this project and I will try to be of some use...

I have encountered a couple issues while trying to get my server working:

As for the logging from sdrpp, not much to report... Here is the startup:

[2021-04-24 09:12:03.466] [info] SDR++ v0.3.0_beta
[2021-04-24 09:12:03.466] [info] Loading config
[2021-04-24 09:12:03.890] [info] Loading icons
[2021-04-24 09:12:03.901] [info] Loading band plans
[2021-04-24 09:12:03.905] [info] Loading band plans color table
[2021-04-24 09:12:03.916] [info] Loading modules
[2021-04-24 09:12:03.916] [info] Loading /usr/lib/sdrpp/plugins/radio.so
[2021-04-24 09:12:03.931] [info] Loading /usr/lib/sdrpp/plugins/airspyhf_source.so
[2021-04-24 09:12:03.946] [info] Loading /usr/lib/sdrpp/plugins/spyserver_source.so
[2021-04-24 09:12:03.962] [info] Loading /usr/lib/sdrpp/plugins/discord_integration.so
[2021-04-24 09:12:03.979] [info] Loading /usr/lib/sdrpp/plugins/file_source.so
[2021-04-24 09:12:03.996] [info] Loading /usr/lib/sdrpp/plugins/recorder.so
[2021-04-24 09:12:04.015] [info] Loading /usr/lib/sdrpp/plugins/audio_sink.so
[2021-04-24 09:12:04.035] [info] Loading /usr/lib/sdrpp/plugins/meteor_demodulator.so
[2021-04-24 09:12:04.048] [info] Loading /usr/lib/sdrpp/plugins/weather_sat_decoder.so
[2021-04-24 09:12:04.063] [info] Initializing AirspyHF+ Source (airspyhf_source)
[2021-04-24 09:12:04.086] [info] New DSP samplerate: 768000.0
[2021-04-24 09:12:04.087] [info] Initializing Audio Sink (audio_sink)
[2021-04-24 09:12:04.094] [info] Initializing File Source (file_source)
[2021-04-24 09:12:04.113] [info] FileSourceModule 'File Source': Instance created!
[2021-04-24 09:12:04.113] [info] Initializing Radio (radio)
[2021-04-24 09:12:04.245] [info] Initializing Recorder (recorder)
[2021-04-24 09:12:04.246] [info] Initializing SpyServer Source (spyserver_source)
[2021-04-24 09:12:04.248] [info] Loading color maps
[2021-04-24 09:12:04.248] [info] Loading /usr/share/sdrpp/colormaps/websdr.json
[2021-04-24 09:12:04.249] [info] Loading /usr/share/sdrpp/colormaps/magma.json
[2021-04-24 09:12:04.250] [info] Loading /usr/share/sdrpp/colormaps/plasma.json
[2021-04-24 09:12:04.251] [info] Loading /usr/share/sdrpp/colormaps/electric.json
[2021-04-24 09:12:04.261] [info] Loading /usr/share/sdrpp/colormaps/turbo.json
[2021-04-24 09:12:04.278] [info] Loading /usr/share/sdrpp/colormaps/viridis.json
[2021-04-24 09:12:04.294] [info] Loading /usr/share/sdrpp/colormaps/inferno.json
[2021-04-24 09:12:04.311] [info] Loading /usr/share/sdrpp/colormaps/classic.json
[2021-04-24 09:12:04.328] [info] Loading /usr/share/sdrpp/colormaps/greyscale.json
[2021-04-24 09:12:04.390] [info] New DSP samplerate: 768000.0
[2021-04-24 09:12:04.392] [info] AirspyHFSourceModule 'AirspyHF+ Source': Menu Select!
[2021-04-24 09:12:04.392] [info] AirspyHFSourceModule 'AirspyHF+ Source': Tune: 0.0!
[2021-04-24 09:12:04.448] [info] AirspyHFSourceModule 'AirspyHF+ Source': Tune: 100000000.0!
[2021-04-24 09:12:04.448] [info] Ready.

Then, here is the error produced when connecting to the server:

[2021-04-24 09:12:59.814] [info] AirspyHFSourceModule 'AirspyHF+ Source': Menu Deselect!
[2021-04-24 09:12:59.814] [info] New DSP samplerate: 2560000.0
[2021-04-24 09:12:59.815] [info] SpyServerSourceModule 'SpyServer Source': Menu Select!
[2021-04-24 09:13:22.919] [info] SpyServerSourceModule 'SpyServer Source': Tune: 692800.0!
Connected[2021-04-24 09:46:01.867] [info] SpyServerSourceModule 'SpyServer Source': Start!
[2021-04-24 09:46:01.867] [info] SpyServerSourceModule 'SpyServer Source': Tune: 692800.0!
[2021-04-24 09:46:01.867] [error] Socket error
AlexandreRouma commented 3 years ago

Hello, The spyserver source is currently non-functional.

Best regards, Alex

10man commented 3 years ago

Maybe I can help, what is missing? Is there a new protocol that need implemented or are the changes going to be deeper than that?

AlexandreRouma commented 3 years ago

Most of it actually. The spyserver protocol is really badly "documented" and the module was just a quick test to see if it was even possible to interface with it. It needs a full rewrite and some cleaner cross platform networking code.

10man commented 3 years ago

I can't even find the source repo for the spyserver itself, much less any API docs? Do you have a place to start looking for the code or the API?

AlexandreRouma commented 3 years ago

I can't even find the source repo for the spyserver itself

Both spyserver and sdr# are proprietary so that's normal. You can find the "docs" (which are actually just raw C# code...) on the airspy groups.io, I don't have them with me atm.

nmaster2042 commented 3 years ago

Here is the raw C# code SpyServerClient.zip

And a C++ translation here: https://github.com/opensatelliteproject/xritdemod/blob/master/demodulator/src/SpyServerFrontend.h https://github.com/opensatelliteproject/xritdemod/blob/master/demodulator/src/SpyServerProtocol.h https://github.com/opensatelliteproject/xritdemod/blob/master/demodulator/src/SpyServerFrontend.cpp

AlexandreRouma commented 3 years ago

last time I tried I wasn't able to get that client to work, i'll try again I guess

10man commented 3 years ago

I wonder if it's not just simpler to do a server mode of sdr++ that provides an open source protocol / interface that allows remote connection and control of the receiver. Being that spyserver is proprietary and the protocol to the receiver isn't documented, why not just go around it.

It really comes down to how tough it would be to run the airspyhf_source as a server. Could we UDP the data on a port and setup a TCP port for control / feedback.

Something like: airspyhf_source >> sdrpp-server >> UDP mcast IQ data & TCP JSON API for control >> sdrpp-remote_source >> sdr++ GUI

Thoughts?

nmaster2042 commented 3 years ago

@10man Yes it could be a real alternative to make a sdrpp_server that can use sdrpp existing sources, so all sdr hardware supported by sdrpp would be remotely usable. SDR console have this feature.

AlexandreRouma commented 3 years ago

it is already planned but I don't want to rush it. It won't be anything like spyserver or rtl_tcp, much more advanced

AlexandreRouma commented 3 years ago

the spyserver source is now functional