miweber67 / spyserver_client

CLI spyserver client to provide basic rtl_sdr and rtl_power-like outputs from an Airspy spyserver.
GNU General Public License v3.0
25 stars 2 forks source link

Example of piping IQ into local SDR app? #6

Closed kevinelliott closed 3 years ago

kevinelliott commented 4 years ago

Has anyone been able to pipe the IQ output into a Linux/macOS SDR app? I'd like to be able to try exploring various frequencies using the ss_client and then visualizing the waterfalls to narrow in on signals, which I can then later pass into various decoder apps that can take an IQ input.

kevinelliott commented 4 years ago
Screen Shot 2020-08-24 at 4 05 16 PM
kevinelliott commented 4 years ago

For dumpvdl2, I would imagine it would be something like:

ss_client iq -r <ip> -q <port> -s 105000 -f 136955000 - | dumpvdl2 --iq-file - --centerfreq 136955000 136975000

I will make some tries.

kevinelliott commented 3 years ago

Hello, I haven't been able to make this work. Any further thoughts to help?

miweber67 commented 3 years ago

Sorry, missed this originally somehow.

First, output of ss_client IQ mode is signed 16-bit integer samples. So, you will need the --sample-format S16_LE option for dumpvdl2.

Second, the satellite frequency you want to decode must be within the bandpass of the data you capture. That is equal to the center frequency you pass plus the sample rate (half on either side of the center). So, if you say your center is 100, and your rate is 10, you can only tune between 95 and 105. Best bet is to tune ss_client to the satellite frequency, not using an offset as your example showed.

I would try something like this;

ss_client iq -r <ip> -q <port> -s 105000 -f 136975000 - | dumpvdl2 --iq-file - --sample-format S16_LE

kevinelliott commented 3 years ago

It looks like dumpvdl2 is erroring out opening STDIN before ss_client has a chance to stream to it?

dumpvdl2 2.1.0 (libacars 2.1.2)
Warning: frequency not set - using VDL2 Common Signalling Channel as a default (136975000 Hz)
Sampling rate set to 1050000 sps
fopen(): No such file or directory
SS_client_if: Connected
...
ss_client: setting center_freq to 1.36775e+08
SS_client_if: Starting Streaming
kevinelliott commented 3 years ago

Actually, I forgot that it doesn't support the STDIN input, and that I had to make a system pipe (mkfifo). Hopefully I can get some decoding to happen.

kevinelliott commented 3 years ago

So far no luck decoding with any remote spyserver host. Frame decodes are always rejected, I think the data is not coming in to it just right.

Screen Shot 2021-01-24 at 12 52 53 PM
miweber67 commented 3 years ago

Can you please post the complete command lines you're using to invoke ss_client AND dumpvdl2? I will try this myself when I get a chance and see if I can figure out what's going on.

Another question to you... looking at the output you posted earlier, dumpvdl is saying the freq is 136.975 but ss_client is tuned to 136.775. That's 200kHz difference... is that how dumpvdl2 normally works?

kevinelliott commented 3 years ago

First make the fifo:

mkfifo ss-dumpvdl-fifo

Then a script to execute both processes using the FIFO:

REMOTE_IP=$1
REMOTE_PORT=$2
FREQUENCY=$3

./ss_client iq -r $REMOTE_IP -q $REMOTE_PORT -s 105000 -f $FREQUENCY ss-dumpvdl-fifo &

sleep 5

dumpvdl2 --iq-file ss-dumpvdl-fifo --sample-format S16_LE --debug all $FREQUENCY

pi@scanner1:~/source/spyserver_client $ ./remote-vdl.sh 81.184.154.198 5556 136975000
kevinelliott commented 3 years ago

Hey @miweber67 thought I would check in. Any luck?

miweber67 commented 3 years ago

@kevinelliott Been slammed lately; will try to look at this over the weekend.

miweber67 commented 3 years ago

Your -s parameter value to ss_client needs an extra zero. This is because the default oversample value for dumpvdl2 is 10. These two commands work for me:

/ss_client iq -r localhost -p 5555 -s 1050000 -f 136975000 ss-dumpvdl-fifo

dumpvdl2 --iq-file ss-dumpvdl-fifo --sample-format S16_LE  136975000

Also, your spyserver.config needs to be set to a sample rate at least as high as the -s value. I let it pick the default. I let the client tune the rtl-sdr and set the type to rtl-sdr explicitly. I'm using a nooelec nesdr smart.

I get lots of output like this:

[2021-02-06 18:45:05 EST] [136.975] [-37.8/-51.1 dBFS] [13.3 dB] [-1.1 ppm]
10509A (Ground station, On ground) -> AA7E51 (Aircraft): Command
AVLC type: I sseq: 4 rseq: 7 poll: 0
 ACARS:
  Reassembly: skipped
  Reg: .N77520
  Mode: 2 Label: RA Blk id: Q More: 0 Ack: !
  Message:
   QUDPCULUA.1PIREP PROCESSED
   UA301/06 KIAD KORF
   SENT: 23:45:01Z
   PIREP SUBMITTED TO NWS

Hope that helps. Good luck! :-)