Skip to content

Commit

Permalink
limesdr: basic implementation of LimeSDR support
Browse files Browse the repository at this point in the history
The commit provides a basic implementation of support for LimeSDR USB
receivers based on LMS7002 chip. The solution has several limitations:
 - passing parameters for tune LimeSDR receiver via command-line
   options is not implemented;
 - only hardcoded configuration is used (channel 0 of lower band LNA,
   LMS_FMT_I16 format, gain, bandwidth and timeout);
 - only one device is supported and it is not possible to select a
   desired one in case if several devices are connected to the host.

Test: compare the output of the program for RTL and LimeSDR receivers.
Environment:
 - RTL2832SDR dongle;
 - LMS7002M based USB LimeSDR board;
 - 800MHz-2200MHz omnidirectional antenna with SMA connector.
Procedure:
 - connect RTL dongle to the host and start the program with the
   following parameters:
   $ ./dump1090 --device-type rtlsdr --interactive
 - wait until several planes will be detected;
 - stop the program, connect the LimeSDR board to the host and restart
   the program with the following parameters:
   $ ./dump1090 --device-type limesdr --interactive
 - ensure that the same planes are detected.
Acceptance criteria: the same planes are detected using both receivers
   and track information matches with information from the
   FlightRadar24 application.

Signed-off-by: Gluttton <gluttton@ukr.net>
  • Loading branch information
Gluttton committed Jul 29, 2020
1 parent d6b8065 commit 53183c0
Show file tree
Hide file tree
Showing 7 changed files with 404 additions and 3 deletions.
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ PROGNAME=dump1090

RTLSDR ?= yes
BLADERF ?= yes
LIMESDR ?= yes

CPPFLAGS += -DMODES_DUMP1090_VERSION=\"$(DUMP1090_VERSION)\" -DMODES_DUMP1090_VARIANT=\"dump1090-fa\"

Expand Down Expand Up @@ -39,6 +40,13 @@ ifeq ($(BLADERF), yes)
LIBS_SDR += $(shell pkg-config --libs libbladeRF)
endif

ifeq ($(LIMESDR), yes)
SDR_OBJ += sdr_limesdr.o
CPPFLAGS += -DENABLE_LIMESDR
CFLAGS += $(shell pkg-config --cflags LimeSuite)
LIBS_SDR += $(shell pkg-config --libs LimeSuite)
endif

all: dump1090 view1090

%.o: %.c *.h
Expand Down
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ see https://flightaware.com/adsb/piaware/install

This is packaged with jessie. `sudo apt-get install librtlsdr-dev`

### Dependencies - LimeSDR

You will need a build of [LimeSuite](https://github.com/myriadrf/LimeSuite).
See detailed instruction on [the official Wiki](https://wiki.myriadrf.org/Lime_Suite) how to build and install it.

### Actually building it

Nothing special, just build it (`dpkg-buildpackage -b`)
Expand All @@ -45,7 +50,7 @@ Nothing special, just build it (`dpkg-buildpackage -b`)
First run `prepare-wheezy-tree.sh`. This will create a package tree in
package-wheezy/. Build in there (`dpkg-buildpackage -b`)

The wheezy build does not include bladeRF support.
The wheezy build does not include bladeRF and LimeSDR support.

## Building manually

Expand All @@ -56,5 +61,8 @@ install them (and a method for starting them) yourself.
``make BLADERF=no`` will disable bladeRF support and remove the dependency on
libbladeRF.

``make RTLSDR=no`` will disable rtl-sdr support and remove the dependency on
``make RTLSDR=no`` will disable rtl-sdr support and remove the dependency on
librtlsdr.

``make LIMESDR=no`` will disable LimeSDR support and remove the dependency on
libLimeSuite.
3 changes: 3 additions & 0 deletions dump1090.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,9 @@ void showHelp(void) {
#ifdef ENABLE_BLADERF
"ENABLE_BLADERF "
#endif
#ifdef ENABLE_LIMESDR
"ENABLE_LIMESDR "
#endif
#ifdef SC16Q11_TABLE_BITS
// This is a little silly, but that's how the preprocessor works..
#define _stringize(x) #x
Expand Down
2 changes: 1 addition & 1 deletion dump1090.h
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ typedef enum {
//======================== structure declarations =========================

typedef enum {
SDR_NONE, SDR_IFILE, SDR_RTLSDR, SDR_BLADERF
SDR_NONE, SDR_IFILE, SDR_RTLSDR, SDR_BLADERF, SDR_LIMESDR
} sdr_type_t;

// Structure representing one magnitude buffer
Expand Down
7 changes: 7 additions & 0 deletions sdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
#ifdef ENABLE_BLADERF
# include "sdr_bladerf.h"
#endif
#ifdef ENABLE_LIMESDR
# include "sdr_limesdr.h"
#endif

typedef struct {
const char *name;
Expand Down Expand Up @@ -85,6 +88,10 @@ static sdr_handler sdr_handlers[] = {
{ "bladerf", SDR_BLADERF, bladeRFInitConfig, bladeRFShowHelp, bladeRFHandleOption, bladeRFOpen, bladeRFRun, bladeRFClose },
#endif

#ifdef ENABLE_LIMESDR
{ "limesdr", SDR_LIMESDR, limesdrInitConfig, limesdrShowHelp, limesdrHandleOption, limesdrOpen, limesdrRun, limesdrClose },
#endif

{ "ifile", SDR_IFILE, ifileInitConfig, ifileShowHelp, ifileHandleOption, ifileOpen, ifileRun, ifileClose },
{ "none", SDR_NONE, noInitConfig, noShowHelp, noHandleOption, noOpen, noRun, noClose },

Expand Down
Loading

0 comments on commit 53183c0

Please sign in to comment.