Skip to content

Commit

Permalink
first import
Browse files Browse the repository at this point in the history
  • Loading branch information
trabucayre committed May 11, 2020
1 parent 34c4ace commit 393efcc
Show file tree
Hide file tree
Showing 6 changed files with 948 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Editors
*.swp
# Prerequisites
*.d

Expand Down Expand Up @@ -29,6 +31,7 @@
*.dylib

# Executables
pluto-adsb-sim
*.exe
*.out
*.app
Expand Down
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
SRC=main.c adsb_encode.c
DEST=pluto-adsb-sim
OBJS=$(SRC:.c=.o)
LDFLAGS=-lm $(shell pkg-config --libs libiio libad9361)
CFLAGS=-g -Wall $(shell pkg-config --cflags libiio libad9361)

all: $(DEST)

$(DEST): $(OBJS)
$(CC) -o $@ $^ $(LDFLAGS)
%.o: %.c
$(CC) $(CFLAGS) -o $@ -c $<
clean:
rm -f *.o $(DEST)
95 changes: 93 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,93 @@
# pluto-adsb-sim
pluto-adsb-sim generates ADSB signal IQ data stream, which is then transmitted by the software-defined radio (SDR) platform ADALM-Pluto.
# pluto-absb-sim

pluto-adsb-sim generates ADSB signal IQ data stream, which is then transmitted
by the software-defined radio (SDR) platform [ADALM-Pluto](https://wiki.analog.com/university/tools/pluto).

Project based on [ADSB-Out](https://github.com/lyusupov/ADSB-Out)

Three mode are available:
* Tx stream from an ASCII file;
* Tx stream from fake frame;
* fake frame or ASCII file to binary file

### compile

#### dependencies
This application require [libiio](https://github.com/analogdevicesinc/libiio), [libad9361-iio](https://github.com/analogdevicesinc/libad9361-iio)
and *pkg-config*

```bash
$ sudo apt install libiio-dev libad9361-dev libad9361-0 libiio0 pkg-config
```

#### compile

```bash
$ make
```

### usage

```bash
Usage: pluto-adsb-sim [options]
-h This help
-t <filename> Transmit data from file
-o <outfile> Write to file instead of using PlutoSDR
-a <attenuation> Set TX attenuation [dB] (default -20.0)
-b <bw> Set RF bandwidth [MHz] (default 5.0)
-f <freq> Set RF center frequency [MHz] (default 868.0)
-u <uri> ADALM-Pluto URI
-n <network> ADALM-Pluto network IP or hostname (default pluto.local)
-i <ICAO>
-l <Latitude>
-L <Longitude>
-A <Altitude>
-I <Aicraft identification>

```

To use **-n** or nothing, you need to have in */etc/hosts* a line like:
```
192.168.2.1 pluto pluto.local
```

#### Transmit data from file

To use this mode a file must be provided with *-t* option

The file used is an ascii, hex format, one frame by line:
```
@XXXXXXXXXXXXYYYYYYYYYYYYYYYYYYYYYYYYYYYY;
```

Each line start with a *@* and finish with a *;*
Where:
* X is a 12 char hex date in ns
* Y is the 14 char hex full frame (DF, ICAO, DATA, CRC)

__example__
```bash
./pluto-adsb-sim -f 868 -t maFile.dat
```

#### Fake signal generation

To use this mode, don't provide a data file (no *-t* option)

__example__
```bash
./pluto-adsb-sim -f 868 -i 0xABCDEF -I GGM_1980 -l 48.36 -L -4.77 -A 9999.0
```

### binary file generation

If *-o* is used the *PlutoSDR* is not used. Instead the data stream is written
in a binary, signed short IQ interleaved format

### Verify with dump1090

```bash
$ dump1090 --freq 868000000
```

*--freq* parameter must be the same as -f
Loading

0 comments on commit 393efcc

Please sign in to comment.