-
Notifications
You must be signed in to change notification settings - Fork 178
built-in aisdecoder #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
dgiardini
wants to merge
151
commits into
keenerd:master
Choose a base branch
from
dgiardini:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
151 commits
Select commit
Hold shift + click to select a range
8ff1ba2
rtl_ais.c
dgiardini 15d7867
Merge pull request #1 from dgiardini/patch-1
dgiardini d2c44ed
compile aisdecoder files too
dgiardini cf11901
use built-in aisdecoder
dgiardini 6da04e9
ais decoder for rtl_ais
dgiardini 54775f8
ais decoder for rtl_ais
dgiardini 20ceb52
Create sounddecoder.c
dgiardini a7ad26c
Create sounddecoder.h
dgiardini bfd260a
receiver.c
dgiardini ea908bc
receiver.h
dgiardini c35a312
protodec.c
dgiardini 7695357
protodec.h
dgiardini c368c83
Create callbacks.h
dgiardini 65b9676
hmalloc.h
dgiardini ce5b37e
hmalloc.c
dgiardini 453b488
filter.h
dgiardini c420fb5
filter.c
dgiardini 49a5aa6
filter-i386.h
dgiardini 0014a83
build script
dgiardini d256988
rtl_ais built-in ais decoder.
dgiardini f517bd7
rtl_ais built-in aisdecoder
dgiardini f0e9d48
Update rtl_ais.c
dgiardini 43c8e9c
fclose() NULL file fixed
dgiardini 8151c67
Clean tree
nunojpg c6cf5e7
Remove libusb.h include
nunojpg 2948205
Build with a Makefile
nunojpg 877af1d
Merge pull request #2 from nunojpg/master
dgiardini d1084f6
add minimal support for MSys
dgiardini 5060803
README file added
dgiardini cf29a36
Fixed some typos
dgiardini 741578c
Update README
dgiardini 5dd3f74
typo fixed
dgiardini 8d4c4a0
small fix for OSX compilation
b805be0
Merge pull request #3 from Odyno/osx_makefile
dgiardini 5a03d35
Create TODO
dgiardini 8c2b9d3
Add files via upload
klapligehesten ebb5002
Add files via upload
klapligehesten 59f5577
Create Makefile
klapligehesten c0a521c
Add files via upload
klapligehesten 95e3011
Create README
klapligehesten c4afe3f
Update README
klapligehesten deba4a2
Update README
klapligehesten e8d2f37
Merge pull request #4 from klapligehesten/klapligehesten-patch-1
dgiardini 8e4cd04
Update tcp_listener.c
dgiardini 2a0a740
Correct getopt param
dgiardini bfd2e69
Add tcplistener to makefile
dgiardini 3e982c3
Update README
dgiardini 5409644
Update README
dgiardini 828dfcb
removed libtcp_listener.a linking is static.
klapligehesten b200d7a
Fix CLOSE_WAIT in special caces
klapligehesten e1387ea
Merge pull request #8 from klapligehesten/patch-8
dgiardini 06ce522
Revert "Fix CLOSE_WAIT in special caces"
dgiardini 1dd95d2
Merge pull request #7 from klapligehesten/patch-5
dgiardini 51237ad
Merge pull request #9 from dgiardini/revert-8-patch-8
dgiardini 65f8d41
Fix CLOSE_WAIT in special caces
dgiardini b873b74
Bugs fixed for Windows
dgiardini 95410e7
Clean Windows rtl_ais.exe too
dgiardini a54ab00
initial support for using rtl_ais as a library
seandepagnier 356854e
Merge branch 'master' of github.com:seandepagnier/rtl-sdr-misc
seandepagnier a208b5f
Merge pull request #10 from seandepagnier/master
dgiardini 28e6a29
Add again missing arguments "T" and "t"
dgiardini ce6bcce
Fix: Dongle_freq and dongle_rate are local
dgiardini 6c98544
Use internal aisdecoder by default
dgiardini 5aba6c6
Initialize config->seconds_for_decoder_stats=0
dgiardini b2dbee5
Avoid duplicatd messages to console
dgiardini c8a2579
Avid duplicated messages to console
dgiardini dcbdb7f
Change pthread_join() for pthread detach(); or can't be stopped using…
dgiardini 8d21c8d
init dc_avg=0; now starts receiving messages inmediatly. More init mi…
dgiardini 671ac02
Some missing strings re-added.
dgiardini e262cb5
spurious character supressed
dgiardini 0726fd3
Fix missing includes
rhaamo 0b456b5
Merge pull request #11 from rhaamo/fix_includes
dgiardini a2a8e78
fixed shifting of filter history in fifth_order()
v15n b93f9f3
Merge pull request #12 from v15n/fix-decimation-filter
dgiardini 252f33b
Missing colon for "t" parameter added
dgiardini efd05ad
Add command line option to output packet timing information
BertoldVdb eb62441
Fix extended NMEA for packets that require more than one sentence
BertoldVdb 72ad264
Merge pull request #13 from BertoldVdb/timing
dgiardini 6884447
Move variable declaration for C compliance
dgiardini c838eac
switch -I added
dgiardini 3c15243
Add missing include for musl
neheb 974c874
Merge pull request #14 from neheb/patch-2
dgiardini 1b6ac5b
treewide: Remove bzero and usleep
neheb c3d45e5
Merge pull request #16 from neheb/b
dgiardini 5e25eab
Check for nanosleep() availability
dgiardini a3338e8
Fix compliation "error multiple definition of `__mac_g'". Credits to …
dgiardini 6a5fc2c
fix buffer overflow
sayzard ef9c245
Merge pull request #17 from sayzard/fix_buffer_overflow
dgiardini b8e4efd
Add gitignore
FredericGuilbault 3038aeb
Merge pull request #18 from FredericGuilbault/master
dgiardini b935cac
Get rid of warnings
dgiardini 4861507
Avoid compiling warnings
dgiardini 36aef50
Avoid compiling warnings
dgiardini 7644b9a
Avoid compiling warnings
dgiardini bd68526
Add make install for linux
FredericGuilbault 0e85f4e
Merge pull request #19 from FredericGuilbault/master
dgiardini 6d9ee64
Update README format and include hardware information
ikatz-drizly 527e7d3
Merge remote-tracking branch 'dgiardini/master'
FredericGuilbault 29a51d9
Add Debian package builder and related procedure.
FredericGuilbault f39a989
Fix control file
FredericGuilbault bcf17b7
Fix errors in debian packaging documentation.
FredericGuilbault 9c37b6f
Merge pull request #22 from FredericGuilbault/master
dgiardini fa093d5
Merge branch 'master' into FredericGuilbault/master
FredericGuilbault 1beaeea
Add licence file
FredericGuilbault 00c2fc7
Fix make install, DESTDIR is for the target not source location.
FredericGuilbault d093381
Rework debian packaging to support source packages
FredericGuilbault 6638cbd
Merge pull request #27 from FredericGuilbault/debian
dgiardini 5f63ad8
Merge pull request #26 from FredericGuilbault/makefile
dgiardini 457a093
Merge pull request #21 from ianfixes/2020-03-02_readme
dgiardini 8b6a283
Merge pull request #24 from FredericGuilbault/licence
dgiardini 5a5abc6
Update LICENCE
dgiardini 1975fdd
small modifications to make the debian package compliant with standards
FredericGuilbault a28765a
Force ubuntu release as a workaround to librtlsdr0 version bug
FredericGuilbault 6de4563
fix bad category
FredericGuilbault 26b13c9
Add missing dep
FredericGuilbault 1280114
Build different package for respective arch.
FredericGuilbault d77aaf4
Add missing runtime dependency
FredericGuilbault 29a7a85
Change build OS
FredericGuilbault 6211704
Add ref to licence file location (requested by debuild linter )
FredericGuilbault 1ef4dc3
Merge pull request #31 from FredericGuilbault/debian
dgiardini 0535890
Added first cut of Dockerfile for building rtl-ais
bklofas a60426d
Removed reference to hardcoded git repository. Now copying in the git…
bklofas 0800467
Cleaned up dockerfile, removing unused packages after build. Image re…
bklofas c99eae0
Updated readme file with example Docker commands and container build …
bklofas f3b6d47
Cleaned up the README file, adding some more documentation
bklofas ab6d8e5
Merge pull request #38 from bklofas/dockerfile
dgiardini 23e3400
Added first cut of the github actions file for building the container…
bklofas 4c5004c
One too much indentation for the workflow_dispatch
bklofas 50cdccb
Workflow dispatch enabling?
bklofas 0dccad4
Will brackets work?
bklofas f5ee0bc
Merge branch 'github_actions_build_container'
bklofas ef0517e
Updated the README file with some multi-arch clarifications
bklofas e61e350
Updated README with clarification for multi-arch docker packages
bklofas 642cc66
Merge branch 'Dockerfile' with cleaned up documentation
bklofas 09ca36c
Add exotic librtlsdr path for some RPI distros
dgiardini 738ccca
Merge branch 'dgiardini:master' into master
bklofas 605c29c
Support for broadcast addresses
dgiardini 35f2011
Try to detect if pkg-config fails, default to -l librtlsdr
dgiardini 88d062f
Extra paths for the linker
dgiardini 3bcc835
Keep all warinings on
dgiardini 5293369
Add paths for Homebrew on Apple Silicon to the Makefile
nohal 9ab00f9
Merge pull request #45 from nohal/macos
dgiardini d1ab768
fix building error
jtaveau 9be4dfb
Merge pull request #47 from jtaveau/master
dgiardini 631bb9e
Updated github actions for building new container
bklofas 777f8e1
Merge pull request #2 from dgiardini/master
bklofas 66eca38
Updated debian strech -> bookworm
bklofas 5f63c41
Updated Dockerfile with build/run containers
bklofas 60a6992
Changed directory for rtl_ais so previous arguments work
bklofas d06ac95
Merge pull request #3 from bklofas/upstream_changes
bklofas 6717b76
Merge pull request #51 from bklofas/master
dgiardini File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Docker Builds | ||
|
||
on: [workflow_dispatch] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up QEMU | ||
uses: docker/[email protected] | ||
with: | ||
image: tonistiigi/binfmt:qemu-v8.1.5 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Cache Docker layers | ||
id: cache-docker | ||
uses: actions/cache@v4 | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-buildx-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-buildx- | ||
|
||
- name: Log in to GHCR | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.RTLAIS_GITHUB_TOKEN }} | ||
|
||
- name: Build and push to ghcr | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
platforms: linux/amd64,linux/arm64,linux/386,linux/arm/v6,linux/arm/v7 | ||
push: ${{ github.event_name != 'pull_request' }} | ||
outputs: type=image,name=target,annotation-index.org.opencontainers.image.description=AIS recevier using RTL-SDR dongle | ||
tags: | | ||
ghcr.io/bklofas/rtl-ais:latest | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
*.o | ||
rtl_ais | ||
debianPackage/usr | ||
debianPackage/*.deb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# ------------------- | ||
# The build container | ||
# ------------------- | ||
FROM debian:bookworm-slim AS build | ||
|
||
WORKDIR /usr/src/app | ||
|
||
COPY . /usr/src/app | ||
|
||
# Upgrade bookworm and install dependencies | ||
RUN apt-get -y update && apt -y upgrade && apt-get -y install --no-install-recommends \ | ||
rtl-sdr \ | ||
librtlsdr-dev \ | ||
libusb-1.0-0-dev \ | ||
build-essential \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Build rtl_ais | ||
RUN make && \ | ||
make install | ||
|
||
|
||
# ------------------------- | ||
# The application container | ||
# ------------------------- | ||
FROM debian:bookworm-slim | ||
|
||
LABEL org.opencontainers.image.title="rtl-ais" | ||
LABEL org.opencontainers.image.description="AIS decoding using RTL-SDR dongle" | ||
LABEL org.opencontainers.image.authors="Bryan Klofas KF6ZEO bklofas@gmail" | ||
LABEL org.opencontainers.image.source="https://github.com/bklofas/rtl-ais" | ||
|
||
# Upgrade bookworm and install dependencies | ||
RUN apt-get -y update && apt -y upgrade && apt-get -y install --no-install-recommends \ | ||
tini \ | ||
rtl-sdr \ | ||
librtlsdr-dev \ | ||
libusb-1.0-0-dev &&\ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
COPY --from=build /usr/src/app / | ||
|
||
# Use tini as init. | ||
ENTRYPOINT ["/usr/bin/tini", "--"] | ||
|
||
CMD ["/rtl_ais", "-n"] | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
* Copyright (C) 2012 by Kyle Keen <[email protected]> | ||
* rtl-ais uses code from AISDecoder Copyright (C) 2013 Astra Paging Ltd / AISHub ([email protected]) | ||
* AISDecoder uses parts of GNUAIS project (http://gnuais.sourceforge.net/) | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 2 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
CFLAGS?=-O2 -g -Wall | ||
CFLAGS+= -I./aisdecoder -I ./aisdecoder/lib -I./tcp_listener | ||
LD_EXTRA_PATHS= -L /usr/lib/arm-linux-gnueabihf -L /usr/lib/i386-linux-gnu -L /usr/lib/x86_64-linux-gnu | ||
LDFLAGS+=-lpthread -lm $(LD_EXTRA_PATHS) | ||
ifeq ($(PREFIX),) | ||
PREFIX := /usr/local | ||
endif | ||
UNAME := $(shell uname) | ||
ifeq ($(UNAME),Linux) | ||
#Conditional for Linux | ||
CFLAGS+= $(shell pkg-config --cflags librtlsdr) | ||
LD_LIBRTLSDR=$(shell pkg-config --libs librtlsdr) | ||
#Ugly hack. Check if the output of pkg-config is long enough to be valid | ||
LD_LIBRTLSDR_LENGTH := $(shell echo "$(LD_LIBRTLSDR)" | wc -c) | ||
ifeq ($(shell test $(LD_LIBRTLSDR_LENGTH) -gt 13; echo $$?),0) | ||
#The pkg-config output seem to be ok, let's use it | ||
LDFLAGS+=$(shell pkg-config --libs librtlsdr) | ||
else | ||
#The pkg-config output seem to be too short, use the default lib name and default paths | ||
LDFLAGS+=-lrtlsdr | ||
endif | ||
|
||
else | ||
# | ||
#ADD THE CORRECT PATH FOR LIBUSB AND RTLSDR | ||
#TODO: | ||
# CMAKE will be much better or create a conditional pkg-config | ||
|
||
|
||
# RTLSDR | ||
RTLSDR_INCLUDE=/tmp/rtl-sdr/include | ||
RTLSDR_LIB=/tmp/rtl-sdr/build/src | ||
|
||
# LIBUSB | ||
LIBUSB_INCLUDE=/tmp/libusb/include/libusb-1.0 | ||
LIBUSB_LIB=/tmp/libusb/lib | ||
|
||
ifeq ($(UNAME),Darwin) | ||
#Conditional for OSX | ||
CFLAGS+= -I/usr/local/include/ -I/opt/homebrew/include -I$(LIBUSB_INCLUDE) -I$(RTLSDR_INCLUDE) | ||
LDFLAGS+= -L/usr/local/lib -L/opt/homebrew/lib -L$(LIBUSB_LIB) -L$(RTLSDR_LIB) -lrtlsdr -lusb-1.0 | ||
else | ||
#Conditional for Windows | ||
CFLAGS+=-I $(LIBUSB_INCLUDE) -I $(RTLSDR_INCLUDE) | ||
LDFLAGS+=-L$(LIBUSB_INCLUDE) -L$(RTLSDR_LIB) -L/usr/lib -lusb-1.0 -lrtlsdr -lWs2_32 | ||
endif | ||
|
||
|
||
endif | ||
|
||
CC?=gcc | ||
SOURCES= \ | ||
main.c rtl_ais.c convenience.c \ | ||
./aisdecoder/aisdecoder.c \ | ||
./aisdecoder/sounddecoder.c \ | ||
./aisdecoder/lib/receiver.c \ | ||
./aisdecoder/lib/protodec.c \ | ||
./aisdecoder/lib/hmalloc.c \ | ||
./aisdecoder/lib/filter.c \ | ||
./tcp_listener/tcp_listener.c | ||
|
||
OBJECTS=$(SOURCES:.c=.o) | ||
EXECUTABLE=rtl_ais | ||
|
||
all: $(SOURCES) $(EXECUTABLE) | ||
|
||
$(EXECUTABLE): $(OBJECTS) | ||
$(CC) $(OBJECTS) -o $@ $(LDFLAGS) | ||
|
||
.c.o: | ||
$(CC) -c $< -o $@ $(CFLAGS) | ||
|
||
clean: | ||
rm -f $(OBJECTS) $(EXECUTABLE) $(EXECUTABLE).exe | ||
|
||
install: | ||
install -d -m 755 $(PREFIX)/bin | ||
install -m 755 $(EXECUTABLE) "$(PREFIX)/bin/" | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,162 @@ | ||
`rtl-ais`, a simple AIS tuner and generic dual-frequency FM demodulator | ||
----------------------------------------------------------------------- | ||
|
||
rtl-ais provides the `rtl_ais` command, which decodes AIS data from Software Defined Radio (SDR) and outputs `AIVDM` / `AIVDO` sentences. | ||
|
||
| OS support | | | ||
|------------|---| | ||
| Linux | ✅ | | ||
| Windows | ✅ | | ||
| OSX | ✅ | | ||
|
||
|
||
Command Line | ||
------------ | ||
``` | ||
Use: rtl_ais [options] [outputfile] | ||
[-l left_frequency (default: 161.975M)] | ||
[-r right_frequency (default: 162.025M)] | ||
left freq < right freq | ||
frequencies must be within 1.2MHz | ||
[-s sample_rate (default: 24k)] | ||
maximum value, might be down to 12k | ||
[-o output_rate (default: 48k)] | ||
must be equal or greater than twice -s value | ||
[-E toggle edge tuning (default: off)] | ||
[-D toggle DC filter (default: on)] | ||
[-d device_index (default: 0)] | ||
[-g tuner_gain (default: automatic)] | ||
[-p ppm_error (default: 0)] | ||
[-R enable RTL chip AGC (default: off)] | ||
[-A turn off built-in AIS decoder (default: on)] | ||
use this option to output samples to file or stdout. | ||
Built-in AIS decoder options: | ||
[-h host (default: 127.0.0.1)] | ||
[-P port (default: 10110)] | ||
[-T use TCP communication as tcp listener ( -h is ignored)] | ||
[-t time to keep ais messages in sec, using tcp listener (default: 15)] | ||
[-n log NMEA sentences to console (stderr) (default off)] | ||
[-L log sound levels to console (stderr) (default off)] | ||
[-I add sample index to NMEA mesages (default off)] | ||
[-S seconds_for_decoder_stats (default 0=off)] | ||
When the built-in AIS decoder is disabled the samples are sent to | ||
to [outputfile] (a '-' dumps samples to stdout) | ||
omitting the filename also uses stdout | ||
Output is stereo 2x16 bit signed ints | ||
Examples: | ||
Receive AIS traffic,sent UDP NMEA sentences to 127.0.0.1 port 10110 | ||
and log the senteces to console: | ||
rtl_ais -n | ||
Tune two fm stations and play one on each channel: | ||
rtl_ais -l233.15M -r233.20M -A | play -r48k -traw -es -b16 -c2 -V1 - | ||
``` | ||
|
||
|
||
Compiling | ||
--------- | ||
Make sure you have the following dependencies: | ||
- librtlsdr | ||
- libusb | ||
- libpthread | ||
|
||
```console | ||
$ # Get the source code: | ||
$ git clone https://github.com/dgiardini/rtl-ais | ||
$ # Change to the source dir | ||
$ cd rtl-ais | ||
$ make | ||
$ # Test running the command | ||
$ ./rtl_ais | ||
``` | ||
|
||
For compiling a MS Windows executable you will need a working MSYS/MinGW environment. | ||
Edit the `Makefile`, and modify these lines: | ||
|
||
```Makefile | ||
#### point this to your correct path ### | ||
RTLSDR_PATH="/c/tmp/rtl-sdr/" | ||
RTLSDR_LIB=$(RTLSDR_PATH)/build/src/ | ||
######################################## | ||
``` | ||
|
||
|
||
Installing | ||
---------- | ||
* On Linux, `sudo make install` | ||
* On Windows, put the `librtlsdr.dll` and `libusb-1.0.dll` files in the same directory | ||
with `rtl_ais.exe`. You'll need the `zadig` driver installed too. | ||
|
||
|
||
Running | ||
------- | ||
|
||
rtl-ais uses software defined radio (SDR). The specific | ||
hardware we use for this is a DVB-T dongle. A good starting point is: | ||
https://www.rtl-sdr.com/about-rtl-sdr | ||
|
||
You'll need also an antenna, and be located near (some miles) the | ||
passing vessels. | ||
|
||
You'll also need to do some procedure to get the tunning error for the | ||
specfic dongle you have (aka ppm error), and pass that number as parameter | ||
of rtl-ais. | ||
|
||
|
||
Docker Container | ||
---------------- | ||
Now you can run rtl-ais in a docker container. No dependencies to install. Total container size is 55 to 75 MB, depending on the host architecture. Get/install docker [here](https://docs.docker.com/get-docker/). | ||
|
||
Two options for obtaining the container: Either download and run a pre-built container, or build the container locally. | ||
|
||
1. Just to test things out: `docker run -it --rm --device=/dev/bus/usb ghcr.io/bklofas/rtl-ais:latest` | ||
* This downloads a pre-built container from the Github container registry. | ||
* Architectures supported are i386, amd64, arm32v6, arm32v7, and arm64. Tested on amd64, arm32v7, and arm64. arm packages run on all RaspberryPi flavors. Your client will automatically download the appropriate architecture. | ||
* This image will run by default `./rtl_ais -n`, showing the received packets on STDOUT. Uses all other default values. | ||
* You can add other ./rtl-sdr options, see below. | ||
* Make sure at least one RTL-SDR dongle is connected. | ||
* Startup messages and decoded packets will display in the terminal. | ||
* Ctrl-C to kill. | ||
* Using the `--rm` flag will delete the container when you kill it. Otherwise, it will stay around until you prune. | ||
|
||
1. For a more permanent setup, run the container in the background and add any options you want: `docker run -d --name rtl-ais --restart=unless-stopped --log-driver=local --network=host --device=/dev/bus/usb ghcr.io/bklofas/rtl-ais:latest ./rtl_ais -n -d 00000002 -h 127.0.0.1 -P 10110` | ||
* -d: Start this container in daemon/background mode. | ||
* --name: Name this anything you want. | ||
* --restart=unless-stopped: Automatically restart the container if something happens (reboot, USB problem), unless you have manually stopped the container. | ||
* --log-driver=local: By default, docker uses the json log driver which may fill up your harddrive, depending on how busy your station is. `local` log driver defaults to 100MB of saved logs, and automatically rotates them. | ||
* --network=host: Allows the container to talk to the internet, if you are sending the packets to an online service. | ||
* --device=: Allows the container to talk to the USB bus to access the RTL-SDR dongle. | ||
* ./rtl_ais: Same command-line options as non-containerized. | ||
* View the startup messages and decoded packets with `docker logs --follow rtl-ais` | ||
* Stop the container with `docker stop rtl-ais` | ||
|
||
Building the container: | ||
|
||
* Clone the repository with `git clone https://github.com/dgiardini/rtl-ais.git` , then from the folder `docker build -t rtl-ais .` | ||
* Or, build the container without cloning the repository: `docker build https://github.com/dgiardini/rtl-ais.git` | ||
|
||
Other tips and tricks: | ||
|
||
* If you have the `-n` flag, view the decoded AIS packets in real-time with `docker logs --follow rtl-ais` | ||
* If you are only sending packets to one internet service (such as marinetraffic.com), you can use the `-h` and `-P` options that they provide. | ||
* You are encouraged to send your decoded packets to multiple online services. Check out AIS packet multiplexer [kplex](http://www.stripydog.com/kplex/), pre-built containers are available [here](https://ghcr.io/bklofas/kplex). | ||
|
||
|
||
Testing | ||
------- | ||
|
||
TODO: something like | ||
https://github.com/freerange/ais-on-sdr/wiki/Testing-AISDecoder#with-an-audio-file | ||
|
||
|
||
Known Issues | ||
------------ | ||
* The `[-p ppm error]` parameter is essential for rtl_ais to work. | ||
* The ppm error is the frequency deviation in parts per million from the desired tuning | ||
frequency, and the real tuned frequency due to the crystal oscillator deviation. This | ||
figure is different for each device, it's very important to know this value and pass this parameter to rtl_ais. | ||
* Some instructions for get the ppm error are here: | ||
http://www.rtl-sdr.com/how-to-calibrate-rtl-sdr-using-kalibrate-rtl-on-linux | ||
* and here (using SDR#): | ||
http://www.atouk.com/SDRSharpQuickStart.html#adjusting | ||
* and here (using HDSDR ad AIS traffic) | ||
http://www.cruisersforum.com/forums/f134/new-rtlsdr-plugin-102929-11.html#post1844966 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
---- | ||
TODO | ||
---- | ||
- Auto calibration mode | ||
- Compile as library | ||
- Add audio gain control |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you intend to change the github url?