Two rtl-sdr receivers on a single Raspberry Pi, can it be done?

Every time I add another RPI to my stack (3) the noise on 2m in my shack goes up another S point or 2 despite having them in an aluminium boxes which are grounded. I have ferrite clamp on toroids on every cable coming and going. I know, in theory one can support more than one rtl-sdr if configured correctly but…
Has any one tried it?
How did you configure satnogs-setup?
Does the RPi3B+ have sufficient horsepower to run 2 rtl-sdrs?
4 cores at 1.4G should work, maybe.
What about when both the VHF and UHF rtl-sdr are processing observations at the same time?
73 Bob vk2byf

This information may not be completely useful, but it is possible to run two SatNOGS stations on an x86 setup. This approach may also work on a RPi3B+ though it probably is not possible to configure both stations through satnogs-setup. Whether or not the RPi3B+ has enough CPU power to run both is also not clear to me.

For an x86 setup you’ll have to do the following things:

  • Set the rtlsdr SNR identifier with rtl_eeprom (http://www.cloud-sdr.com/tutorial-sharing-two-rtlsdr-receivers/)
  • Operate each satnogs-client from a separate terminal which each has different SATNOGS environment variables. I run mine from a vnc and do not use satnogs-setup.
  • For each rtlsdr, use the SATNOGS_DEV_ARGS to specify which rtlsdr the current shell should listen to: e.g. export SATNOGS_DEV_ARGS="rtl=437000"
  • Specify rotator and rig control ports which are different for each satnogs-client session. This to prevent, for example, the VHF satnogs-client operating the UHF gr-satnogs scripts.
  • Specify separate paths for output (SATNOGS_APP_PATH, SATNOGS_OUTPUT_PATH, SATNOGS_COMPLETE_OUTPUT_PATH, SATNOGS_INCOMPLETE_OUTPUT_PATH).

I hope that makes sense.

2 Likes

when you say, x86 setup, you mean satnogs running on a Linux laptop? This is something I want to play with first but I haven’t found a tutorial yet explaining to a beginner like myself how to do it.

I will look at the website more closely tomorrow. I have played with gnuradio so I know you can identify 2 different SDRs.

I suppose I should concentrate getting my UHF station 724 on the air first. Thanks for you effort to reply.
73 Bob vk2byf

Hi Bob,

Yes, with x86 I mean a linux computer. I’m using a small barebone pc (like an Intel NUC).

The hardest part of this setup is installing satnogs-client and gr-satnogs as well as their dependencies. You’ll also have to manually upgrade these once new versions are released, so this is not necessarily an easy solution.

Hey Bob!

unfortunately I don’t think the Pi 3B+ has enough guts. The gnuradio scripts we have will run on all 4 cores, I’m not sure how successful 2 will be at the same time so no effort has been made to make this work within the client (and some of the demodulation scripts are more compute intensive than others).

That said… if someone wanted to go down this path and start to prove this theory one way or the other, the scripts can be run by hand on the pi.

/usr/bin/satnogs_*

raspberrypi➜  ~  /usr/bin/satnogs_fm_demod.py --help
linux; GNU C++ version 6.2.0 20161010; Boost_106100; UHD_003.009.005-0-unknown

Usage: satnogs_fm_demod.py: [options]

A generic FM demodulation block

Options:
  -h, --help            show this help message and exit
  --antenna=ANTENNA     Set antenna [default=]
  --bb-gain=BB_GAIN     Set bb_gain [default=-1]
  --decoded-data-file-path=DECODED_DATA_FILE_PATH
                        Set decoded_data_file_path
                        [default=/tmp/.satnogs/data/data]
  --dev-args=DEV_ARGS   Set dev_args [default=]
  --doppler-correction-per-sec=DOPPLER_CORRECTION_PER_SEC
                        Set doppler_correction_per_sec [default=20]
  --enable-iq-dump=ENABLE_IQ_DUMP
                        Set enable_iq_dump [default=0]
  --file-path=FILE_PATH
                        Set file_path [default=test.ogg]
  --if-gain=IF_GAIN     Set if_gain [default=-1]
  --iq-file-path=IQ_FILE_PATH
                        Set iq_file_path [default=/tmp/iq.dat]
  --lo-offset=LO_OFFSET
                        Set lo_offset [default=100k]
  --ppm=PPM             Set ppm [default=0]
  --rf-gain=RF_GAIN     Set rf_gain [default=-1]
  --rigctl-port=RIGCTL_PORT
                        Set rigctl_port [default=4532]
  --rx-freq=RX_FREQ     Set rx_freq [default=100M]
  --rx-sdr-device=RX_SDR_DEVICE
                        Set rx_sdr_device [default=usrpb200]
  --waterfall-file-path=WATERFALL_FILE_PATH
                        Set waterfall_file_path [default=/tmp/waterfall.dat]

You would need to specify one rtlsdr over the other, using --dev-args (not sure off the top of my head what the argument is, but this gets passed to the gr-osmosdr block so look there). Use --rx-sdr-device=rtlsdr

By default the script will dump audio to test.ogg, so set --file-path to something unique for each.

Don’t worry about rigctl port as you’re just trying to see if it is possible to run both at the same time, the challenge of doppler shifting 2 simultaneously would have to be solved in the client.

then, I would recommend pointing each at a signal you know you can get results from, maybe APRS or a passing satellite using --rx-freq.

With both running, watch the consoles for ocerruns (you’ll see O’s printed on the screen). If so, then the script is getting more data from the SDR than the CPU can process (which is bad). If it runs for a while cleanly, and the audio files both sound good, then this might be feasible for a rpi3.

All that said, there would still be a need for a lot of development in the client to make this work, but at least we would know of the feasibility.

Thanks for your food for thought. I’m not a programmer so this idea will have to sit on the back burner for a while.
73 Bob

You can lower the CPU usage (and the noise) lowering the sampling rate.
With SATNOGS_RX_DEVICE="rtlsdr" I had good results using:

SATNOGS_SAMP_RATE="900001"
SATNOGS_LO_OFFSET="60e3"

and:

SATNOGS_SAMP_RATE="225001"
SATNOGS_LO_OFFSET="20e3"

Note that however very few GRC scripts support such low samprate (they are designed with USRP in mind, allowing high samprate).
Also, the waterfall is not scaled, so it looks rather ugly.

Something else I noticed is the rtlsdr devices consume power even while not sampling. I use a command to let the USB controller power off the bus after each use:

#!/bin/sh
echo 0 > $(dirname $(fgrep -l 2838 /sys/bus/usb/devices/*/idProduct))/authorized

and the to power it on before starting to sample:

#!/bin/sh
echo 1 > $(dirname $(fgrep -l 2838 /sys/bus/usb/devices/*/idProduct))/authorized

2838 is the USB Product ID (0x2838 for RTL2838).

Very interesting. I have printed your suggestion and will give it a try on little step at a time. I note you create a LO_OFFSET when changing the samp rate. I remember reading about this somewhere but can’t remember the maths behind it. Can you explain it please? I know the minimum samp rate should be twice the maximum frequency of the sample.

I’m particularly interested in reducing the noise generated as my VHF noise level is now at S8
I have found some aluminium cases for my 3 RPis on fleebay which are connected to my shack ground and I have clamp on toroids on every cable but the noise is still too high and goes away when I shut down the RPis.

#!/bin/sh
echo 0 > $(dirname $(fgrep -l 2838 /sys/bus/usb/devices/*/idProduct))/authorized

What do I do with this? SSH into the RPi? Then what?
I don’t want to create a problem which I won’t be able to diagnose and fix having just finally gotten both of my stations working properly.

I found all my problems were because when I clicked on Apply in satnogs-setup "It didn’t always apply all of my configuration and I had to click Apply 3 times before it stared to work properly.

#!/bin/sh
echo 0 > $(dirname $(fgrep -l 2838 /sys/bus/usb/devices/*/idProduct))/authorized

Is this a script? I can’t see how this can be a command. Do I create a file or what? What is dirname do I have to supply a directory name from where?

There is a command which tells me the details of the USB hardware, I can’t remember what it is. $ sudo lshw doesn’t work.

I’m obviously not a programmer I’ve being sucked in when I stated playing with SDRs and having to do more and more with software.

I’ve obviously bitten off more than I can handle but I’m still amazed what can be done with a $10 SDR and some fancy software.
I’ll be 70 next birthday, I should be relaxing in a rocking chair but I’m still thirsty for learning new things.
Thanks for taking the time to respond.
73 Bob vk2byf

“lsusb” is the command you are looking for for listing USB devices :wink:

I have tried. I hope my sdrs won’t ever be mixed up again at each reboot (I mean power failure)!
Thanks for the hint!!!