Coder Social home page Coder Social logo

sdr-enthusiasts / docker-readsb-protobuf Goto Github PK

View Code? Open in Web Editor NEW
221.0 9.0 38.0 501 KB

Multi-architecture readsb-protobuf container with support for RTLSDR, bladeRF and plutoSDR (x86_64, arm32v7, arm64v8)

Dockerfile 18.32% Shell 81.68%
readsb readsb-protobuf adsb mode-s tis sdr rtlsdr bladerf

docker-readsb-protobuf's Introduction

sdr-enthusiasts/docker-readsb-protobuf

Docker Image Size (tag) Discord

Mictronics' readsb-protobuf Mode-S/ADSB/TIS decoder for RTLSDR, BladeRF, Modes-Beast and GNS5894 devices, running in a docker container.

This version uses Google's protocol buffer for data storage and exchange with web application. Saves on storage space and bandwidth.

This container also contains InfluxData's Telegraf, and can send flight data and readsb metrics to InfluxDB (if wanted - not started by default).

Support for all supported SDRs is compiled in. Builds and runs on x86_64, arm32v7 and arm64v8 (see below).

This image will configure a software-defined radio (SDR) to receive and decode Mode-S/ADSB/TIS data from aircraft within range, for use with other services such as:

bladeRF & plutoSDR are untested - I don't own bladeRF or plutoSDR hardware (only RTL2832U as outlined above), but support for the devices is compiled in. If you have the hardware and would be willing to test, please open an issue on GitHub.

Note for Users running 32-bit Debian Buster-based OSes on ARM

Please see: Buster-Docker-Fixes!

Table of Contents

Supported tags and respective Dockerfiles

  • latest should always contain the latest released versions of rtl-sdr, bladeRF, libiio, libad9361-iio and readsb. This image is built nightly from the main branch Dockerfile for all supported architectures.
  • latest_nohealthcheck is the same as the latest version above. However, this version has the docker healthcheck removed. This is done for people running platforms (such as Nomad) that don't support manually disabling healthchecks, where healthchecks are not wanted.
  • Specific version and architecture tags are available if required, however these are not regularly updated. It is generally recommended to run latest.

Multi Architecture Support

Currently, this image should pull and run on the following architectures:

  • amd64: Linux x86-64
  • arm32v7, armv7l: ARMv7 32-bit (Odroid HC1/HC2/XU4, RPi 2/3)
  • arm64v8, aarch64: ARMv8 64-bit (RPi 3B+/4)

Prerequisites

Kernel Module Configuration

NOTE: If you used the docker-install.sh script, you can skip this section.

Before we can plug in our RTL-SDR dongle, we need to blacklist the kernel modules for the RTL-SDR USB device from being loaded into the host's kernel and taking ownership of the device.

There are three parts to this.

  1. Blacklist modules from being directly loaded AND blacklist modules from being loaded as a dependency of other modules
  2. Unload any of our blacklisted modules from memory
  3. Updating the initramfs boot image to remove any references to our now blacklisted modules
1. Blacklist Modules

To do this, we will create a blacklist file at /etc/modprobe.d/blacklist-rtlsdr.conf with the following command. While logged in as root, please copy and paste all lines at once, and press enter after to ensure the final line is given allowing it to run.

sudo tee /etc/modprobe.d/blacklist-rtlsdr.conf <<TEXT1
# Blacklist host from loading modules for RTL-SDRs to ensure they
# are left available for the Docker guest.

blacklist dvb_core
blacklist dvb_usb_rtl2832u
blacklist dvb_usb_rtl28xxu
blacklist dvb_usb_v2
blacklist r820t
blacklist rtl2830
blacklist rtl2832
blacklist rtl2832_sdr
blacklist rtl2838
blacklist rtl8192cu
blacklist rtl8xxxu

# This alone will not prevent a module being loaded if it is a
# required or an optional dependency of another module. Some kernel
# modules will attempt to load optional modules on demand, which we
# mitigate here by causing /bin/false to be run instead of the module.
#
# The next time the loading of the module is attempted, the /bin/false
# will be executed instead. This will prevent the module from being
# loaded on-demand. Source: https://access.redhat.com/solutions/41278

install dvb_core /bin/false
install dvb_usb_rtl2832u /bin/false
install dvb_usb_rtl28xxu /bin/false
install dvb_usb_v2 /bin/false
install r820t /bin/false
install rtl2830 /bin/false
install rtl2832 /bin/false
install rtl2832_sdr /bin/false
install rtl2838 /bin/false
install rtl8192cu /bin/false
install rtl8xxxu /bin/false

TEXT1
2. Unload Modules

Next, ensure the modules are unloaded by running the following commands:

sudo modprobe -r rtl2832_sdr
sudo modprobe -r dvb_usb_rtl2832u
sudo modprobe -r dvb_usb_rtl28xxu
sudo modprobe -r dvb_usb_v2
sudo modprobe -r r820t
sudo modprobe -r rtl2830
sudo modprobe -r rtl2832
sudo modprobe -r rtl2838
sudo modprobe -r rtl8192cu
sudo modprobe -r rtl8xxxu
sudo modprobe -r dvb_core
3. Update the Boot Image

Now we need to update our boot image to ensure any references to the modules we've blacklisted are removed

sudo update-initramfs -u

This will take a minute or more depending on the speed of your system, and output lots of status message lines as it goes until it is finished.


Failure to do the steps above will result in the error below being spammed to the readsb container log.

usb_claim_interface error -6
rtlsdr: error opening the RTLSDR device: Device or resource busy

Identifying your SDR's device path

Plug in your USB radio, and run the command lsusb. Find your radio. It'll look something like this:

Bus 001 Device 004: ID 0bda:2832 Realtek Semiconductor Corp. RTL2832U DVB-T

Take note of the USB bus number, and USB device number. In the output above, its 001 and 004 respectively. While the individual device can be passed through (/dev/bus/usb/001/004 in this case), it's more reliable to pass the entire USB bus through, as seen in the examples below.

Up-and-Running with docker run

Start the docker container, passing through the USB device:

docker volume create readsbpb_rrd
docker volume create readsbpb_autogain
docker run \
 -d \
 -it \
 --restart=always \
 --name readsb \
 --hostname readsb \
 --device /dev/bus/usb:/dev/bus/usb \
 -p 8080:8080 \
 -p 30005:30005 \
 -e TZ=<YOUR_TIMEZONE> \
 -e READSB_DCFILTER=true \
 -e READSB_DEVICE_TYPE=rtlsdr \
 -e READSB_FIX=true \
 -e READSB_GAIN=autogain \
 -e READSB_LAT=<YOUR_LATITUDE> \
 -e READSB_LON=<YOUR_LONGITUDE> \
 -e READSB_MODEAC=true \
 -e READSB_RX_LOCATION_ACCURACY=2 \
 -e READSB_STATS_RANGE=true \
 -e READSB_NET_ENABLE=true \
 -v readsbpb_autogain:/run/autogain \
 -v readsbpb_rrd:/run/collectd \
 --tmpfs=/run:exec,size=64M \
 --tmpfs=/var/log:size=32M \
 ghcr.io/sdr-enthusiasts/docker-readsb-protobuf:latest

For example:

docker volume create readsbpb_rrd
docker volume create readsbpb_autogain
docker run \
 -d \
 -it \
 --restart=always \
 --name readsb \
 --hostname readsb \
 --device /dev/bus/usb:/dev/bus/usb \
 -p 8080:8080 \
 -p 30005:30005 \
 -e TZ=Australia/Perth \
 -e READSB_DCFILTER=true \
 -e READSB_DEVICE_TYPE=rtlsdr \
 -e READSB_FIX=true \
 -e READSB_GAIN=autogain \
 -e READSB_LAT=33.33333 \
 -e READSB_LON=-111.11111 \
 -e READSB_MODEAC=true \
 -e READSB_RX_LOCATION_ACCURACY=2 \
 -e READSB_STATS_RANGE=true \
 -e READSB_NET_ENABLE=true \
 -v readsbpb_autogain:/run/autogain \
 -v readsbpb_rrd:/run/collectd \
 --tmpfs=/run:exec,size=64M \
 --tmpfs=/var/log:size=32M \
 ghcr.io/sdr-enthusiasts/docker-readsb-protobuf:latest

Alternatively, you could pass through the entire USB bus with --device /dev/bus/usb:/dev/bus/usb, but please understand the security implications of doing so.

Up-and-Running with Docker Compose

An example docker-compose.yml file is below:

version: "2.0"

volumes:
  readsbpb_rrd:
  readsbpb_autogain:

services:
  readsb:
    image: ghcr.io/sdr-enthusiasts/docker-readsb-protobuf:latest
    tty: true
    container_name: readsb
    hostname: readsb
    restart: always
    devices:
      - /dev/bus/usb:/dev/bus/usb
    ports:
      - 8080:8080
      - 30005:30005
    environment:
      - TZ=Australia/Perth
      - READSB_DCFILTER=true
      - READSB_DEVICE_TYPE=rtlsdr
      - READSB_FIX=true
      - READSB_GAIN=autogain
      - READSB_LAT=-33.33333
      - READSB_LON=111.11111
      - READSB_MODEAC=true
      - READSB_RX_LOCATION_ACCURACY=2
      - READSB_STATS_RANGE=true
      - READSB_NET_ENABLE=true
    volumes:
      - readsbpb_rrd:/run/collectd
      - readsbpb_autogain:/run/autogain
      - /proc/diskstats:/proc/diskstats:ro
    tmpfs:
      - /run/readsb:size=64M
      - /var/log:size=32M

Testing the container

Once running, you can test the container to ensure it is correctly receiving & decoding ADSB traffic by issuing the command:

docker exec -it readsb viewadsb

Which should display a departure-lounge-style screen showing all the aircraft being tracked, for example:

 Hex    Mode  Sqwk  Flight   Alt    Spd  Hdg    Lat      Long   RSSI  Msgs  Ti -
────────────────────────────────────────────────────────────────────────────────
 7C801C S                     8450  256  296                   -28.0    14  1
 7C8148 S                     3900                             -21.5    19  0
 7C7A48 S     1331  VOZ471   28050  468  063  -31.290  117.480 -26.8    48  0
 7C7A4D S     3273  VOZ694   13100  376  077                   -29.1    14  1
 7C7A6E S     4342  YGW       1625  109  175  -32.023  115.853  -5.9    71  0
 7C7A71 S           YGZ        725   64  167  -32.102  115.852 -27.1    26  0
 7C42D1 S                    32000  347  211                   -32.0     4  1
 7C42D5 S                    33000  421  081  -30.955  118.568 -28.7    15  0
 7C42D9 S     4245  NWK1643   1675  173  282  -32.043  115.961 -13.6    60  0
 7C431A S     3617  JTE981   24000  289  012                   -26.7    41  0
 7C1B2D S     3711  VOZ9242  11900  294  209  -31.691  116.118  -9.5    65  0
 7C5343 S           QQD      20000  236  055  -30.633  116.834 -25.5    27  0
 7C6C96 S     1347  JST116   24000  397  354  -30.916  115.873 -17.5    62  0
 7C6C99 S     3253  JST975    2650  210  046  -31.868  115.993  -2.5    70  0
 76CD03 S     1522  SIA214     grnd   0                        -22.5     7  0
 7C4513 S     4220  QJE1808   3925  282  279  -31.851  115.887  -1.9    35  0
 7C4530 S     4003  NYA      21925  229  200  -30.933  116.640 -19.8    58  0
 7C7533 S     3236  XFP       4300  224  266  -32.066  116.124  -6.9    74  0
 7C4D44 S     3730  PJQ      20050  231  199  -31.352  116.466 -20.1    62  0
 7C0559 S     3000  BCB       1000                             -18.4    28  0
 7C0DAA S     1200            2500  146  002  -32.315  115.918 -26.6    48  0
 7C6DD7 S     1025  QFA793   17800  339  199  -31.385  116.306  -8.7    53  0
 8A06F0 S     4131  AWQ544    6125  280  217  -32.182  116.143 -12.6    61  0
 7CF7C4 S           PHRX1A                                     -13.7     8  1
 7CF7C5 S           PHRX1B                                     -13.3     9  1
 7C77F6 S           QFA595     grnd 112  014                   -33.2     2  2

Press CTRL-C to escape this screen.

You should also be able to point your web browser at http://dockerhost:8080/ to view the web interface.

Environment Variables

Container Options

Variable Description Default
DISABLE_PERFORMANCE_GRAPHS Set to any value to disable the performance graphs (and data collection). Unset
DISABLE_WEBAPP Set to any value to disable the container's web server (you may also want to DISABLE_PERFORMANCE_GRAPHS if using this option). Unset
TZ Local timezone in "TZ database name" format. UTC
VERBOSE_LOGGING Set to any value to enable verbose logging for troubleshooting. Unset

readsb General Options

Where the default value is "Unset", readsb's default will be used.

Variable Description Controls which readsb option Default
READSB_AGGRESSIVE Set to any value to enable two-bit CRC error correction --aggressive Unset
READSB_DCFILTER Set to any value to apply a 1Hz DC filter to input data (requires more CPU) --dcfilter Unset
READSB_DEVICE_TYPE If using an SDR, set this to rtlsdr, bladerf, modesbeast, gnshulc or plutosdr depending on the model of your SDR. If not using an SDR, leave un-set. --device-type=<type> Unset
READSB_ENABLE_BIASTEE Set to any value to enable bias tee on supporting interfaces --enable-biastee Unset
READSB_FIX Set to any value to enable CRC single-bit error correction --fix Unset
READSB_FORWARD_MLAT Set this to any value to allow forwarding of received mlat results to output ports. Leave this unset unless you know what you're doing. --forward-mlat Unset
READSB_FREQ Set frequency (in Hz). Typically 1090000000. --freq=<hz> 1090000000
READSB_GAIN Set gain (in dB). Use autogain to have the container determine an appropriate gain, more on this below. --gain=<db> Max gain
READSB_GNSS Set this to any value to show altitudes as GNSS when available --gnss Unset
READSB_LAT Reference/receiver surface latitude --lat=<lat> Unset
READSB_LON Reference/receiver surface longitude --lon=<lon> Unset
READSB_MAX_RANGE Absolute maximum range for position decoding (in nm) --max-range=<dist> 300
READSB_METRIC Set this to any value to use metric units --metric Unset
READSB_MLAT Set this to any value to display raw messages in Beast ASCII mode --mlat Unset
READSB_MODEAC Set this to any value to enable decoding of SSR Modes 3/A & 3/C --modeac Unset
READSB_NO_CRC_CHECK Set this to any value to disable messages with invalid CRC (discouraged) --no-crc-check Unset
READSB_NO_FIX Set this to any value to disable CRC single-bit error correction --no-fix Unset
READSB_NO_MODEAC_AUTO Set this to any value and Mode A/C won't be enabled automatically if requested by a Beast connection --no-modeac-auto Unset
READSB_PREAMBLE_THRESHOLD Preamble threshold, lower means more CPU usage (valid range: 40 - 400) --preamble-threshold=<n> 58
READSB_RX_LOCATION_ACCURACY Accuracy of receiver location in metadata: 0=no location, 1=approximate, 2=exact --rx-location-accuracy=<n> Unset
READSB_STATS_EVERY Number of seconds between showing and resetting stats. --stats-every=<sec> Unset
READSB_STATS_RANGE Set this to any value to collect range statistics for polar plot. --stats-range Unset

readsb Network Options

Where the default value is "Unset", readsb's default will be used.

Variable Description Controls which readsb option Default
READSB_NET_ENABLE Set this to any value to enable networking. --net Unset
READSB_NET_BEAST_REDUCE_INTERVAL BeastReduce position update interval, longer means less data (valid range: 0.000 - 14.999) --net-beast-reduce-interval=<seconds> 0.125
READSB_NET_BEAST_REDUCE_OUT_PORT TCP BeastReduce output listen ports (comma separated) --net-beast-reduce-out-port=<ports> Unset
READSB_NET_BEAST_INPUT_PORT TCP Beast input listen ports --net-bi-port=<ports> 30004,30104
READSB_NET_BEAST_OUTPUT_PORT TCP Beast output listen ports --net-bo-port=<ports> 30005
READSB_NET_BUFFER TCP buffer size 64Kb * (2^n) --net-buffer=<n> 2 (256Kb)
READSB_NET_CONNECTOR See "READSB_NET_CONNECTOR syntax" below. --net-connector=<ip,port,protocol> Unset
READSB_NET_CONNECTOR_DELAY Outbound re-connection delay. --net-connector-delay=<seconds> 30
READSB_NET_HEARTBEAT TCP heartbeat rate in seconds (0 to disable). --net-heartbeat=<rate> 60
READSB_NET_ONLY Set this to any value to enable just networking, no SDR used. --net-only Unset
READSB_NET_RAW_INPUT_PORT TCP raw input listen ports. --net-ri-port=<ports> 30001
READSB_NET_RAW_OUTPUT_INTERVAL TCP output flush interval in seconds (maximum interval between two network writes of accumulated data). --net-ro-interval=<rate> 0.05
READSB_NET_RAW_OUTPUT_PORT TCP raw output listen ports. --net-ro-port=<ports> 30002
READSB_NET_RAW_OUTPUT_SIZE TCP output flush size (maximum amount of internally buffered data before writing to network). --net-ro-size=<size> 1200
READSB_NET_SBS_INPUT_PORT TCP BaseStation input listen ports. --net-sbs-in-port=<ports> Unset
READSB_NET_SBS_OUTPUT_PORT TCP BaseStation output listen ports. --net-sbs-port=<ports> 30003
REASSB_NET_VERBATIM Set this to any value to forward messages unchanged. --net-verbatim Unset
READSB_NET_VRS_PORT TCP VRS JSON output listen ports. --net-vrs-port=<ports> Unset

READSB_NET_CONNECTOR syntax

This variable allows you to configure outgoing connections. The variable takes a semicolon (;) separated list of ip,port,protocol, where:

  • ip is an IP address. Specify an IP/hostname/containername for outgoing connections.
  • port is a TCP port number
  • protocol can be one of the following:
    • beast_out: Beast-format output
    • beast_in: Beast-format input
    • raw_out: Raw output
    • raw_in: Raw input
    • sbs_out: SBS-format output
    • vrs_out: VRS-format JSON output

For example, to pull in MLAT results (so the performance graphs in the web interface show MLAT numbers), you could do the following:

    environment:
    ...
      - READSB_NET_CONNECTOR=piaware,30105,beast_in;adsbx,30105,beast_in;rbfeeder,30105,beast_in
    ...

readsb RTL-SDR Options

Use with READSB_DEVICE_TYPE=rtlsdr.

Where the default value is "Unset", readsb's default will be used.

Variable Description Controls which readsb option Default
READSB_RTLSDR_DEVICE Select device by serial number. --device=<serial> Unset
READSB_RTLSDR_ENABLE_AGC Set this to any value to enable digital AGC (not tuner AGC!) --enable-agc Unset
READSB_RTLSDR_PPM Set oscillator frequency correction in PPM. See section Estimating PPM below --ppm=<correction> Unset

readsb BladeRF Options

Use with READSB_DEVICE_TYPE=bladerf.

Where the default value is "Unset", readsb's default will be used.

Variable Description Controls which readsb option Default
READSB_BLADERF_DEVICE Select device by bladeRF 'device identifier'. --device=<ident> Unset
READSB_BLADERF_BANDWIDTH Set LPF bandwidth ('bypass' to bypass the LPF). --bladerf-bandwidth=<hz> Unset
READSB_BLADERF_DECIMATION Assume FPGA decimates by a factor of N. --bladerf-decimation=<N> Unset
READSB_BLADERF_FPGA Use alternative FPGA bitstream ('' to disable FPGA load). --bladerf-fpga=<path> Unset

readsb Mode-S Beast Options

Use with READSB_DEVICE_TYPE=modesbeast.

Where the default value is "Unset", readsb's default will be used.

Beast binary protocol and hardware handshake are always enabled.

Variable Description Controls which readsb option Default
READSB_BEAST_CRC_OFF Set this to any value to turn OFF CRC checking. --beast-crc-off Unset
READSB_BEAST_DF045_ON Set this to any value to turn ON DF0/4/5 filter. --beast-df045-on Unset
READSB_BEAST_DF1117_ON Set this to any value to turn ON DF11/17-only filter. --beast-df1117-on Unset
READSB_BEAST_FEC_OFF Set this to any value to turn OFF forward error correction. --beast-fec-off Unset
READSB_BEAST_MLAT_OFF Set this to any value to turn OFF MLAT time stamps. --beast-mlat-off Unset
READSB_BEAST_MODEAC Set this to any value to turn ON mode A/C. --beast-modeac Unset
READSB_BEAST_SERIAL Path to Beast serial device. --beast-serial=<path> /dev/ttyUSB0

readsb GNS HULC Options

Use with READSB_DEVICE_TYPE=gnshulc.

Variable Description Controls which readsb option Default
READSB_BEAST_SERIAL Path to Beast serial device. --beast-serial=<path> /dev/ttyUSB0

readsb ADALM-Pluto SDR Options

Use with READSB_DEVICE_TYPE=plutosdr.

Where the default value is "Unset", readsb's default will be used.

Variable Description Controls which readsb option Default
READSB_PLUTO_NETWORK Hostname or IP to create networks context. --pluto-network=<hostname or IP> pluto.local
READSB_PLUTO_URI Create USB context from this URI. (eg. usb:1.2.5) --pluto-uri=<USB uri> Unset

readsb Graphs Options

Where the default value is "Unset", readsb's default will be used.

Variable Description Controls which readsb option Default
READSB_RRD_STEP Interval in seconds to feed data into RRD files. 60
READSB_GRAPH_SIZE Set graph size, possible values: small, default, large, huge, custom. default
READSB_GRAPH_ALL_LARGE Make the small graphs as large as the big ones by setting to yes. no
READSB_GRAPH_FONT_SIZE Font size (relative to graph size). 10.0
READSB_GRAPH_MAX_MESSAGES_LINE Set to 1 to draw a reference line at the maximum message rate. 0
READSB_GRAPH_LARGE_WIDTH Defines the width of the larger graphs. 1096
READSB_GRAPH_LARGE_HEIGHT Defines the height of the larger graphs. 235
READSB_GRAPH_SMALL_WIDTH Defines the width of the smaller graphs. 619
READSB_GRAPH_SMALL_HEIGHT Defines the height of the smaller graphs. 324

Auto-Gain Options

These variables control the auto-gain system (explained further below). These should rarely need changing from the defaults.

Variable Description Default
AUTOGAIN_INITIAL_PERIOD How long each gain level should be measured during auto-gain initialisation (ie: "roughing in"), in seconds. 7200 (2 hours)
AUTOGAIN_INITIAL_MSGS_ACCEPTED How many locally accepted messages should be received per gain level during auto-gain initialisaion to ensure accurate measurement. 1000000
AUTOGAIN_FINETUNE_PERIOD How long each gain level should be measured during auto-gain fine-tuning, in seconds. 604800 (7 days)
AUTOGAIN_FINETUNE_MSGS_ACCEPTED How many locally accepted messages should be received per gain level during auto-gain fine-tuning to ensure accurate measurement. 7000000
AUTOGAIN_FINISHED_PERIOD How long between the completion of fine-tuning (and ultimetly setting a preferred gain), and re-running the entire process. 31536000 (1 year)
AUTOGAIN_MAX_GAIN_VALUE The maximum gain setting in dB that will be used by auto-gain. 49.6 (max supported by readsb)
AUTOGAIN_MIN_GAIN_VALUE The minimum gain setting in dB that will be used by auto-gain. 0.0 (min supported by readsb)
AUTOGAIN_PERCENT_STRONG_MESSAGES_MAX The maximum percentage of "strong messages" auto-gain will aim for. 10.0
AUTOGAIN_PERCENT_STRONG_MESSAGES_MIN The minimum percentage of "strong messages" auto-gain will aim for. 0.5
AUTOGAIN_SERVICE_PERIOD How often the auto-gain system will check results and perform actions, in seconds 900

InfluxDB Options

These variables control the sending of flight data and readsb metrics to InfluxDB (via a built-in instance of Telegraf).

Variable Description Default
INFLUXDBURL The full HTTP URL for your InfluxDB instance. Required for both InfluxDB v1 and v2. Unset
INFLUXDBUSERNAME If using authentication, a username for your InfluxDB instance. If not using authentication, leave unset. Not required for InfluxDB v2. Unset
INFLUXDBPASSWORD If using authentication, a password for your InfluxDB instance. If not using authentication, leave unset. Not required for InfluxDB v2. Unset
INFLUXDB_V2 Set to a non empty value to enable InfluxDB V2 output. Unset
INFLUXDB_V2_BUCKET Required if INFLUXDB_V2 is set, bucket must already exist in your InfluxDB v2 instance. Unset
INFLUXDB_V2_ORG Required if INFLUXDB_V2 is set. Unset
INFLUXDB_V2_TOKEN Required if INFLUXDB_V2 is set. Unset
INFLUXDB_SKIP_AIRCRAFT Set to any value to skip publishing aircraft data to InfluxDB to minimize bandwidth and database size. Unset

Prometheus Options

These variables control exposing flight data and readsb metrics to Prometheus (via a built-in instance of Telegraf).

Variable Description Default
ENABLE_PROMETHEUS Set to any string to enable Prometheus support Unset
PROMETHEUSPORT The port that the prometheus client will listen on 9273
PROMETHEUSPATH The path that the prometheus client will publish metrics on /metrics

Ports

Port Details
8080/tcp readsb web interface

In addition to the ports listed above, depending on your readsb configuration the container may also be listening on other ports that you'll need to map through (if external connectivity is required).

Some common ports are as follows (which may or may not be in use depending on your configuration):

Port Details
30001/tcp Raw protocol input
30002/tcp Raw protocol output
30003/tcp SBS/Basestation protocol output
30004/tcp Beast protocol input
30005/tcp Beast protocol output
30104/tcp Beast protocol input

Paths & Volumes

Path (inside container) Details
/run/readsb readsb protobuf file storage. Not necessarily required to be mapped to persistent storage.
/run/collectd collectd RRD file storage used by readsb's "performance graphs" in the web interface. Map to persistent storage if you use this feature.
/run/autogain Map this to persistent storage if you set READSB_GAIN=autogain

Auto-Gain system

An automatic gain adjustment system is included in this container, and can be activated by setting the environment variable READSB_GAIN to autogain. You should also map /run/autogain to persistent storage, otherwise the auto-gain system will start over each time the container is restarted.

Why is this written in bash? Because I wanted to keep the container size down and not have to install an interpreter like python. I don't know C/Go/Perl or any other languages.

Auto-gain will take several weeks to initially (over the period of a week or so) work out feasible maximum and minimum gain levels for your environment. It will then perform a fine-tune process to find the optimal gain level.

During each process, gain levels are ranked as follows:

  • The range achievable by each gain level
  • The signal-to-noise ratio of the receiver

The ranking process is done by sorting the gain levels for each statistic from worst to best, then awarding points. 0 points are awarded for the worst gain level, 1 point for the next gain level all the way up to several points for the best gain level (total number of points is the number of gain levels tested). The number of points for each gain level is totalled, and the optimal gain level is the level with the largest number of points. Any gain level with a percentage of "strong signals" outside of AUTOGAIN_PERCENT_STRONG_MESSAGES_MAX and AUTOGAIN_PERCENT_STRONG_MESSAGES_MIN is discarded.

Using this method, auto-gain tried to achieve the best balance of range, tracks and signal-to-noise ratio, whilst ensuring an appropriate number of "strong signals".

The auto-gain system will work as follows:

Initialisation Stage

In the initialisation process:

  1. readsb is set to maximum gain (AUTOGAIN_MAX_GAIN_VALUE).
  2. Results are collected up to AUTOGAIN_INITIAL_PERIOD (up to 2 hours by default).
  3. Check to ensure at least AUTOGAIN_INITIAL_MSGS_ACCEPTED messages have been locally accepted (1,000,000 by default). If not, continue collecting data for up to 24 hours. This combination of time and number of messages ensures we have enough data to make a valid initial assessment of each gain level.
  4. Gain level is lowered by one level.
  5. Gain levels are reviewed from lowest to highest gain level. If there have been gain levels resulting in a percentage of strong messages between AUTOGAIN_PERCENT_STRONG_MESSAGES_MAX and AUTOGAIN_PERCENT_STRONG_MESSAGES_MIN, and there have been three consecutive gain levels above AUTOGAIN_PERCENT_STRONG_MESSAGES_MAX, auto-gain lowers the maximum gain level.
  6. Gain levels are reviewed from highest to lowest gain level. If there have been gain levels resulting in a percentage of strong messages between AUTOGAIN_PERCENT_STRONG_MESSAGES_MAX and AUTOGAIN_PERCENT_STRONG_MESSAGES_MIN, and there have been three consecutive gain levels below AUTOGAIN_PERCENT_STRONG_MESSAGES_MIN, auto-gain discontinues testing gain levels.

Auto-gain then moves onto the fine-tuning stage.

Fine-Tuning Stage

In the fine-tuning process:

  1. readsb is set to maximum gain level chosen at the end of the initialisation process.
  2. Results are collected up to AUTOGAIN_FINETUNE_PERIOD (7 days by default).
  3. Check to ensure at least AUTOGAIN_FINETUNE_MSGS_ACCEPTED messages have been locally accepted (7,000,000 by default). If not, continue collecting data for up to 48 hours. This combination of time and number of messages ensures we have enough data to make an accurate assessment of each gain level, and by using 7 days this ensures any peaks/troughs in data due to quiet/busy days of the week do not skew results.
  4. Gain level is lowered by one level until the minimum gain level chosen at the end of the initialisation process is reached.

At this point, all of the tested gain levels are ranked based on the criterea discussed above.

The gain level with the most points is chosen, and readsb is set to this gain level.

Auto-gain then moves onto the finished stage.

Finished Stage

In the finished stage, auto-gain does nothing (as readsb is operating at optimal gain) for AUTOGAIN_FINISHED_PERIOD (1 year by default). After this time, auto-gain reverts to the initialisation stage and the entire process is completed again. This makes sure your configuration is always running at the optimal gain level as your RTLSDR ages.

State/Log/Stats Files

All files for auto-gain are located at /run/autogain within the container. They should not be modified by hand.

Forcing auto-gain to re-run from scratch

Run docker exec <container_name> rm /run/autogain/* to remove all existing auto-gain state data. Restart the container and auto-gain will detect this and re-start at initialisation stage.

Advanced Usage: Creating an MLAT Hub

There may be reasons you wish to use readsb to combine MLAT feeds from different collectors, to feed into visualisation tools (eg: mikenye/tar1090) or data collectors (eg: mikenye/adsb-to-influxdb).

To do this, you can create a second container to act as an MLAT hub.

Here are example service definitions (from a docker-compose.yml file) for readsb, mlathub, adsb2influxdb and tar1090.

---
readsb:
  image: ghcr.io/sdr-enthusiasts/docker-readsb-protobuf:latest
  tty: true
  container_name: readsb
  hostname: readsb
  restart: always
  devices:
    - /dev/bus/usb:/dev/bus/usb
  ports:
    - 8079:8080
    - 30003:30003
    - 30005:30005
  networks:
    - adsbnet
  environment:
    - TZ=Australia/Perth
    - READSB_DCFILTER=true
    - READSB_DEVICE_TYPE=rtlsdr
    - READSB_FIX=true
    - READSB_GAIN=autogain
    - READSB_LAT=-33.33333
    - READSB_LON=111.11111
    - READSB_MAX_RANGE=600
    - READSB_MODEAC=true
    - READSB_RX_LOCATION_ACCURACY=2
    - READSB_STATS_RANGE=true
    - READSB_NET_ENABLE=true
    - READSB_NET_CONNECTOR=mlathub,30105,beast_in
  volumes:
    - readsbpb_rrd:/run/collectd
    - readsbpb_autogain:/run/autogain
  tmpfs:
    - /run/readsb:size=64M
    - /var/log:size=32M

mlathub:
  image: ghcr.io/sdr-enthusiasts/docker-readsb-protobuf:latest
  tty: true
  container_name: mlathub
  hostname: mlathub
  restart: always
  ports:
    - 30105:30105
  networks:
    - adsbnet
  environment:
    - TZ=Australia/Perth
    - DISABLE_PERFORMANCE_GRAPHS=true
    - DISABLE_WEBAPP=true
    - READSB_NET_ENABLE=true
    - READSB_NET_ONLY=true
    - READSB_FORWARD_MLAT=true
    - READSB_NET_CONNECTOR=piaware,30105,beast_in;adsbx,30105,beast_in;rbfeeder,30105,beast_in
    - READSB_NET_BEAST_OUTPUT_PORT=30105

adsb2influxdb:
  image: mikenye/adsb-to-influxdb:latest
  tty: true
  container_name: adsb2influxdb
  restart: always
  environment:
    - TZ=Australia/Perth
    - INFLUXDBURL=http://influxdb:8086
    - ADSBHOST=readsb
    - MLATHOST=mlathub
  networks:
    - adsbnet

tar1090:
  image: mikenye/tar1090:latest
  tty: true
  container_name: tar1090
  restart: always
  depends_on:
    - readsb
  environment:
    - TZ=Australia/Perth
    - BEASTHOST=readsb
    - MLATHOST=mlathub
    - LAT=-33.33333
    - LONG=111.11111
  volumes:
    - "tar1090_heatmap:/var/globe_history"
  tmpfs:
    - /run:exec,size=64M
    - /var/log:size=32M
  networks:
    - adsbnet
  ports:
    - 8078:80

In this example:

  • readsb reads and demodulates the ADSB data from the RTLSDR.
  • Other services (such as adsbx, piaware and rbfeeder - not shown) pull ADSB data from readsb, perform multilateration, and have their resulting MLAT data published on TCP port 30105.
  • mlathub connects to the services providing MLAT results (via READSB_NET_CONNECTOR), and combines them into a single feed, available on TCP port 30105 (via READSB_NET_BEAST_OUTPUT_PORT=30105).
  • readsb pulls these MLAT results (via a READSB_NET_CONNECTOR) so MLAT results show up in its webapp. It is important to note that MLAT results are NOT fed to feeders, which is the desired approach.
  • adsb2influxdb pulls these MLAT results (via MLATHOST) so MLAT metrics are sent to InfluxDB.
  • tar1090 pulls these MLAT results (via MLATHOST) so MLAT positions show up in tar1090's web interface.

You must make absolutely certain that READSB_FORWARD_MLAT is NOT set on your main readsb instance! This is why we perform the MLAT hub functionality in a separate instance of readsb. You do not want to cross-contaminate MLAT results between feeders. Doing so will almost certainly result in your MLAT results being rejected, and/or may end up getting you ignored/banned from feeding services.

PlutoSDR Support

If using PlutoSDR, you will need to configure a host entry for pluto.local.

If using docker run, you can add the command line argument --add-host pluto.local:<IP_OF_PLUTO_HOST>.

If using docker compose, you can add the following to the readsb: service definition:

extra_hosts:
  - "pluto.local:<IP_OF_PLUTO_HOST>"

Replace <IP_OF_PLUTO_HOST> with the IP address of your PlutoSDR host.

Grafana Dashboard

If you're using INFLUXDBURL and pushing metrics into InfluxDB, I've put together an example Grafana dashboard, which can be found here:

https://grafana.com/grafana/dashboards/13168

InfluxDB Schema

If INFLUXDBURL is set, an instance of Telegraf will be started within the container, and metrics will be written to the InfluxDB.

The database readsb will be created if it does not exist.

Within this database are the following measurements:

aircraft Measurement

Tags and fields used for this measurement should match Virtual Radar Server's JSON response ("the new way").

Tag Key Type Description
Call String The aircraft's callsign.
Gnd Boolean True if the aircraft is on the ground.
Icao String The ICAO of the aircraft.
Mlat Boolean True if the latitude and longitude appear to have been calculated by an MLAT server and were not transmitted by the aircraft.
SpdTyp Number The type of speed that Spd represents. Only used with raw feeds. 0/missing = ground speed, 1 = ground speed reversing, 2 = indicated air speed, 3 = true air speed.
Sqk Number The squawk as a decimal number (e.g. a squawk of 7654 is passed as 7654, not 4012).
Tisb Boolean True if the last message received for the aircraft was from a TIS-B source.
TrkH Boolean True if Trak is the aircraft's heading, false if it's the ground track. Default to ground track until told otherwise.
VsiT Number 0 = vertical speed is barometric, 1 = vertical speed is geometric. Default to barometric until told otherwise.
host String The hostname of the container.
Field Key Type Description
Alt float The altitude in feet at standard pressure.
Cmsgs float The count of messages received for the aircraft.
GAlt float The altitude adjusted for local air pressure, should be roughly the height above mean sea level.
InHg float The air pressure in inches of mercury that was used to calculate the AMSL altitude from the standard pressure altitude.
Lat float The aircraft's latitude over the ground.
Long float The aircraft's longitude over the ground.
PosTime float The time (at UTC in JavaScript ticks) that the position was last reported by the aircraft.
Sig float The signal level for the last message received from the aircraft, as reported by the receiver. Not all receivers pass signal levels. The value's units are receiver-dependent.
Spd float The ground speed in knots.
TAlt float The target altitude, in feet, set on the autopilot / FMS etc.
TTrk float The track or heading currently set on the aircraft's autopilot or FMS.
Trak float Aircraft's track angle across the ground clockwise from 0° north.
Trt float Transponder type - 0=Unknown, 1=Mode-S, 2=ADS-B (unknown version), 3=ADS-B 0, 4=ADS-B 1, 5=ADS-B 2.
Vsi float Vertical speed in feet per minute.

autogain Measurement

Tag Key Type Description
host String The hostname of the container.
Field Key Type Description
autogain_current_value float The current gain level as set by autogain.
autogain_max_value float The maximum gain level as set by autogain.
autogain_min_value float The minimum gain level as set by autogain.
autogain_pct_strong_messages_max float The maximum percentage of strong messages.
autogain_pct_strong_messages_min float The minimum percentage of strong messages.

polar_range Measurement

Tag Key Type Description
bearing Number The bearing value is between 00 and 71. Each bearing represents 5° on the compass, with 00 as North.
host String The hostname of the container.
Field Key Type Description
range float The range (in metres) at a specific bearing.

readsb Measurement

Tag Key Type Description
host String The hostname of the container.

Field keys should be as-per the StatisticEntry message schema from readsb.proto.

Field Key Type Description
cpr_airborne float Total number of airborne CPR messages received
cpr_global_bad float Global positions that were rejected because they were inconsistent
cpr_global_ok float Global positions successfully derived
cpr_global_range float Global positions that were rejected because they exceeded the receiver max range
cpr_global_skipped float Global position attempts skipped because we did not have the right data (e.g. even/odd messages crossed a zone boundary)
cpr_global_speed float Global positions that were rejected because they failed the inter-position speed check
cpr_local_aircraft_relative float Local positions found relative to a previous aircraft position
cpr_local_ok float Local (relative) positions successfully found
cpr_local_range float Local positions not used because they exceeded the receiver max range or fell into the ambiguous part of the receiver range
cpr_local_skipped float Local (relative) positions not used because we did not have the right data
cpr_local_speed float Local positions not used because they failed the inter-position speed check
cpr_surface float Total number of surface CPR messages received
cpu_background float Milliseconds spent doing network I/O, processing received network messages, and periodic tasks.
cpu_demod float Milliseconds spent doing demodulation and decoding in response to data from a SDR dongle.
cpu_reader float Milliseconds spent reading sample data over USB from a SDR dongle.
local_accepted float The number of valid Mode S messages accepted from a local SDR with N-bit errors corrected.
local_modeac float Number of Mode A / C messages decoded.
local_modes float Number of Mode S preambles received. This is not the number of valid messages!
local_noise float Calculated receiver noise floor level.
local_peak_signal float Peak signal power of a successfully received message, in dbFS; always negative.
local_samples_dropped float Number of sample blocks dropped before processing. A nonzero value means CPU overload.
local_samples_processed float Number of sample blocks processed.
local_signal float Mean signal power of successfully received messages, in dbFS; always negative.
local_strong_signals float Number of messages received that had a signal power above -3dBFS.
local_unknown_icao float Number of Mode S messages which looked like they might be valid but we didn't recognize the ICAO address and it was one of the message types where we can't be sure it's valid in this case.
max_distance_in_metres float Maximum range in metres
max_distance_in_nautical_miles float Maximum range in nautical miles
messages float Total number of messages accepted by readsb from any source
remote_accepted float Number of valid Mode S messages accepted over the network with N-bit errors corrected.
remote_modeac float Number of Mode A / C messages received.
remote_modes float Number of Mode S messages received.
tracks_mlat_position float Tracks consisting of a position derived from MLAT
tracks_new float Total tracks (aircrafts) created. Each track represents a unique aircraft and persists for up to 5 minutes.
tracks_single_message float Tracks consisting of only a single message. These are usually due to message decoding errors that produce a bad aircraft address.
tracks_with_position float Tracks consisting of a position.

Estimating PPM

Every RTL-SDR dongle will have a small frequency error as it is cheaply mass produced and not tested for accuracy. This frequency error is linear across the spectrum, and can be adjusted in most SDR programs by entering a PPM (parts per million) offset value. This image allows you to adjust the PPM figure using the READSB_RTLSDR_PPM environment variable.

To estimate your RTL-SDR's PPM, you can:

  • Stop the readsb container if it is running (freeing up the RTL-SDR for use)
  • Running docker run --rm -it --entrypoint /scripts/estimate_rtlsdr_ppm.sh --device /dev/bus/usb ghcr.io/sdr-enthusiasts/docker-readsb-protobuf:latest. This takes about 30 minutes.
  • Updating your readsb container with the suggested PPM value

Example output is as follows:

$ docker run --rm -it --entrypoint /scripts/estimate_rtlsdr_ppm.sh --device /dev/bus/usb ghcr.io/sdr-enthusiasts/docker-readsb-protobuf:latest

Running rtl_test -p for 30 minutes

Found 1 device(s):
  0:  Realtek, RTL2832U, SN: 00001000

Using device 0: Generic RTL2832U
Found Rafael Micro R820T tuner
Supported gain values (29): 0.0 0.9 1.4 2.7 3.7 7.7 8.7 12.5 14.4 15.7 16.6 19.7 20.7 22.9 25.4 28.0 29.7 32.8 33.8 36.4 37.2 38.6 40.2 42.1 43.4 43.9 44.5 48.0 49.6
[R82XX] PLL not locked!
Sampling at 2048000 S/s.
Reporting PPM error measurement every 10 seconds...
Press ^C after a few minutes.
Reading samples in async mode...
real sample rate: 2048129 current PPM: 63 cumulative PPM: 63
real sample rate: 2047957 current PPM: -21 cumulative PPM: 20
real sample rate: 2048125 current PPM: 61 cumulative PPM: 34
...<lines removed for brevity>...
real sample rate: 2047998 current PPM: -1 cumulative PPM: 1
real sample rate: 2047992 current PPM: -3 cumulative PPM: 0
real sample rate: 2048005 current PPM: 3 cumulative PPM: 1
Signal caught, exiting!

User cancel, exiting...
Samples per million lost (minimum): 0

Results:

PPM setting of: -2, Score of: 1
PPM setting of: 10, Score of: 1
PPM setting of: 20, Score of: 1
PPM setting of: 34, Score of: 1
PPM setting of: 6, Score of: 1
PPM setting of: 63, Score of: 1
PPM setting of: 8, Score of: 1
PPM setting of: 9, Score of: 1
PPM setting of: -1, Score of: 2
PPM setting of: 3, Score of: 4
PPM setting of: 4, Score of: 4
PPM setting of: 5, Score of: 4
PPM setting of: 7, Score of: 4
PPM setting of: 2, Score of: 8
PPM setting of: 0, Score of: 51
PPM setting of: 1, Score of: 94

Estimated optimum PPM setting: 1

In this instance, the RTL-SDR has a PPM of 1, so we would set the environment variable READSB_RTLSDR_PPM=1.

Getting help

Please feel free to open an issue on the project's GitHub.

I also have a Discord channel, feel free to join and converse.

Changelog

See the project's commit history.

docker-readsb-protobuf's People

Contributors

ajgon avatar avgeeklucky avatar bigmak40 avatar blackholefinder avatar cerebralxor avatar dependabot[bot] avatar dziban303 avatar easternpa avatar fredclausen avatar gionag avatar github-actions[bot] avatar josiahwhite avatar kx1t avatar lpgeek avatar maxwinterstein avatar mikenye avatar qtang avatar raackley avatar revilo951 avatar rpatel3001 avatar tardoe avatar visibilityspots avatar wiedehopf avatar yipyup avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-readsb-protobuf's Issues

[error] table plugin: Failed to open file "/sys/class/thermal/thermal_zone0/temp": No such file or directory.

Hi @mikenye

These containers have been so helpful for me getting started with ADS-B, thank you for creating them and putting together the guide!

I've got the readsb-protobuf container up and running, and it's successfully feeding to other containers. I am, however, getting some errors, though they don't seem to cause it to break that I can tell.

[collectd] 2021/12/27 04:02:34 [error] table plugin: Failed to open file "/sys/class/thermal/thermal_zone0/temp": No such file or directory.
[collectd] 2021/12/27 04:02:34 [notice] read-function of plugin `table' failed. Will suspend it for 240.000 seconds.
[collectd] 2021/12/27 04:06:34 [error] table plugin: Failed to open file "/sys/class/thermal/thermal_zone0/temp": No such file or directory.
[collectd] 2021/12/27 04:06:34 [notice] read-function of plugin `table' failed. Will suspend it for 480.000 seconds.
[collectd] 2021/12/27 04:14:34 [error] table plugin: Failed to open file "/sys/class/thermal/thermal_zone0/temp": No such file or directory.
[collectd] 2021/12/27 04:14:34 [notice] read-function of plugin `table' failed. Will suspend it for 960.000 seconds.
[collectd] 2021/12/27 04:30:34 [error] table plugin: Failed to open file "/sys/class/thermal/thermal_zone0/temp": No such file or directory.
[collectd] 2021/12/27 04:30:34 [notice] read-function of plugin `table' failed. Will suspend it for 1920.000 seconds.
[collectd] 2021/12/27 05:02:34 [error] table plugin: Failed to open file "/sys/class/thermal/thermal_zone0/temp": No such file or directory.
[collectd] 2021/12/27 05:02:34 [notice] read-function of plugin `table' failed. Will suspend it for 3840.000 seconds.

Is the thermal_zone0 something specific to Raspberry Pi? I am running this on an x86 server running Debian. Or maybe this is a device that I need to pass through to the container?

Missing values in influxdb for local_signal, local_noise and more

Hi

I use readsb-protobuf as a docker container (in kubernetes). It is running fine and does export data to my InfluxDB.
Auth. and connection is working fine and I can see some of the stats in grafana.

image

I saw that in the dashboard some pannels are still emtpy so I start investiation:

  • Agv. SNR
  • % Strong Signala
  • Autogain: Gain Levels (don't care about that).
  • Signal Strength

As I can see in Grafana all this stuff is based on:

  • local_signal
  • local_noise
  • local_peak_signal
  • local_accepted
  • local_strong_signals

If I take a look into my Influx I can see that there are no such fields.

One more thing I want to mention is that I use readsb without any rtlsdr. I just use it to use data as beast_in which are exported from my dump1090-fa instance running on rPi3.

So I use following ENVs:

        - name: TZ
          value: "Europe/Berlin"
        - name: READSB_NET_CONNECTOR
          value: "fr24feed-piaware,30005,beast_in"
        - name: READSB_NET_ONLY
          value: "true"
        - name: INFLUXDBURL
          value: "http://my-influx-db:8086"
        - name: INFLUXDBUSERNAME
          value: "readsb"
        - name: INFLUXDBPASSWORD
          value: "xxxxxxxxxxxxxxxxxxxxxxxxxxx"
        - name: READSB_LAT
          value: "47.xxxx"
        - name: READSB_LON
          value: "7.xxxx"
        - name: READSB_STATS_RANGE
          value: "true"
        - name: READSB_NET_ENABLE
          value: "true"
        - name: READSB_DEVICE_TYPE
          value: "modesbeast"

Do I not get this values as I do not have a rtlsdr connected? Are such values not included in beast-out from my dump1090-fa instance and are not displayed because of that? Or do I just missed some settings?

Can't work after autogain changed gain value

After the autogain changed the gain value , I got error report like this in log.

[readsb] 2022/05/26 08:52:11 r82xx_write: i2c wr failed=-1 reg=10 len=1
[readsb] 2022/05/26 08:52:11 r82xx_set_freq: failed=-1
[readsb] 2022/05/26 08:52:11 [R82XX] PLL not locked!

I don't know what's wrong with it,this situation also happens after manually restarting the container.
Currently I can only solve it by restarting the host.udev rule
As of now, I've tried modifying udev rule and restarting policy , but none of them solved the problem. I don't konw what else I can do other than ask you for help. thanks

Docker is trying to connect every 5 and 15 seconds to GitHub

Hi,
In pi-hole I have alternating entries of DNS queries for github.com for IPv4 and IPv6 at 5 and 15 second intervals. Likewise for github.com on the local network, which of course does not exist. Is there any way to turn this off with Docker Compose? The docker file is the latest.
Thank you very much for the support :-)
Many greetings Christian

Logs are filled with MLAT messages

I get a lot of entries like this in the Docker logs. I assume this is a good thing (a measurement of error), but it feels like an error (problem).

Received MLAT timestamp error: 0 seconds!

Is it possible to quiet the log output to include only WARN level messages or above?

... or does this message actually indicate an error?

Telegraf timeouts

Getting a ton of the following error

Error in plugin: exec: command timed out for command 'bash /scripts/telegraf_input_readsb_protoc_range.sh':

The script takes just about 5 seconds (the default timeout) to run on my machine (pi 2B) running both readsb-protobuf and dump978 in docker as the only load. I fixed my issue by adding a 10s timeout line for this script in /rootfs/etc/cont-init.d/04-telegraf at line 92, but there may be a better fix.

100% usage of core for readsb

I'm not sure if this is truely an issue. With the latest image, readsb persistently uses one core for 100% on my Pi4:

    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND
   4732 root      20   0  153184  16956   7800 S  29.2   0.4  10:42.61 /usr/local/bin/readsb --net-bind-address=0.0.0.0 --quiet --write-output=/run/readsb --device-type=rtlsdr --fix --gai.....

i did not notice this on ealier versions, I recall it being on 5-10% tops.
Any idea what's causing this?

Web UI started showing a VersionError

The Web UI map started showing the following error via my browser:
VersionError: The requested version (11) is less than the existing version (304).

The map is also not centered on my position anymore when it starts and it very unresponsive when dring it over to my position.

It appears to have stared in the last few weeks.

Using Airspy Mini without Success

Hello All

First thanks for this dev, I know, this could be a nightmare !!

Im' trying to use an airspy mini without success. Normally, it should a rtlsdr dongle (rt820) but is not detected ..

I've try to install air spy mini on the docker without more success. I'm pretty sure that I'm not so far ...

slush

Bus 001 Device 003: ID 1d50:60a1 OpenMoko, Inc. Airspy

What the best way to use it ?

MLAT ok?

Hi! I wonder if the mlat on the readsb container is ok.
I have never seen any black line or value on the performance graphs:

readsb-local_rate-24h

Flightaware seems to get some, there mlat is enabled and show a couple of received ones.

The log (full log see attachment) shows messages like:
rbfeeder | 2021-03-16T16:04:28.671404666+01:00 [mlat-client] Tue Mar 16 16:04:28 2021 Disconnecting from mlat1.rb24.com:40900: No data (not even keepalives) received for 60 seconds
rbfeeder | 2021-03-16T16:07:01.436023085+01:00 [mlat-client] Tue Mar 16 16:07:01 2021 Connected to multilateration server at mlat1.rb24.com:40900, handshaking
rbfeeder | 2021-03-16T16:08:01.925845237+01:00 [mlat-client] Tue Mar 16 16:08:01 2021 Disconnecting from mlat1.rb24.com:40900: No data (not even keepalives) received for 60 seconds

more logs:
mlat.txt

rtlsdr: no device matching '1090' found.

Ran through the docs this morning, and came across this issue:

adsb    | [readsb] 2023/01/26 23:00:33   0:  Realtek, RTL2838UHIDIR, SN: 00000001
readsb    | [readsb] 2023/01/26 23:00:34 Thu Jan 26 23:00:34 2023 GMT  Mictronics v4.0.3 starting up.
readsb    | [readsb] 2023/01/26 23:00:34 rtlsdr: no device matching '1090' found.
readsb    | [readsb] 2023/01/26 23:00:34 rtlsdr: found 1 device(s):
readsb    | [readsb] 2023/01/26 23:00:34   0:  Realtek, RTL2838UHIDIR, SN: 00000001

Got a bit confused by it, but went digging... found READSB_RTLSDR_DEVICE=1090 set in the docker-compose file... changed that to 00000001, restarted the container, and it worked...

If i had followed the following steps (https://sdr-enthusiasts.gitbook.io/ads-b/setting-up-rtl-sdrs/re-serialise-sdrs) it would have changed the serial number, but having something someone can find, if they did something as stupid as me, and missed that step, might be helpful... Google did not find anything useful...

Segmentation fault for readsb-protobuf 4.0.2

Hi,

My docker container just updated and the logs are filled with the below:

[telegraf_vrs_connector] 2021/01/06 13:14:07 socat[682] E connect(5, AF=2 127.0.0.1:33333, 16): Connection refused

./run: line 325: 3785 Segmentation fault (core dumped) "${READSB_BIN}" "${READSB_CMD[@]}" 2>&1

Not sure what more information you may require.

Thanks

Andy

Container won't stop after kill command (Ubuntu 21.04, Raspi 3B+)

Hello,
I currently have the issue that the container can't be stopped or killed and even somehow prevents a system reboot.
OS is Ubuntu 21.04 on a raspberrypi 3 running the latest version of the software:

  • docker (1.5-2)
  • docker-ce 5:20.10.103-0ubuntu-hirsute
  • containerd.io 1.4.11-1
  • containerd golang-1.16 (= 1.16.2-0ubuntu1)
  • OS: Ubuntu 21.04 aarch64
  • Host: Raspberry Pi 3 Model B Plus Rev 1.3
  • Kernel: 5.11.0-1021-raspi

In general the container works fine for some hours and after sometimes days I get error messages from piaware as well as fr24feed that there's no data received from readsb. Stopping or restarting piaware and fr24feed works fine and the webserver of readsab works but shows that no data is reveiced. After sending the stop or kill command to the container the webserver stops working but the container itselft seems to be still running. To stop it I have to hard-reset (pull the power cable) the raspberrypi and after reboot the container is stopped.
Just rebooting doesn't work (I waited 5 Minutes and nothing happened).

The same setup had no issues using Raspbian as OS.

Additionally something with the time seems to be wrong. The kill signal was send somewhere around 19:50 local, 17:50 UTC.

Log of container:

2021-10-26T14:09:53.865198324Z [telegraf] 2021-10-26T14:09:53Z E! [agent] Error writing to outputs.influxdb: could not write any address

2021-10-26T14:09:54.821284162Z [telegraf] 2021-10-26T14:09:54Z E! [outputs.influxdb] When writing to [http://192.168.178.47:8087]: failed doing req: Post "http://192.168.178.47:8087/write?db=readsb": dial tcp 192.168.178.47:8087: connect: connection refused

2021-10-26T14:09:54.821960041Z [telegraf] 2021-10-26T14:09:54Z E! [agent] Error writing to outputs.influxdb: could not write any address

2021-10-26T14:09:55.830385553Z [telegraf] 2021-10-26T14:09:55Z E! [outputs.influxdb] When writing to [http://192.168.178.47:8087]: failed doing req: Post "http://192.168.178.47:8087/write?db=readsb": dial tcp 192.168.178.47:8087: connect: connection refused

2021-10-26T14:09:55.830539978Z [telegraf] 2021-10-26T14:09:55Z E! [agent] Error writing to outputs.influxdb: could not write any address

2021-10-26T14:09:56.823246452Z [telegraf] 2021-10-26T14:09:56Z E! [outputs.influxdb] When writing to [http://192.168.178.47:8087]: failed doing req: Post "http://192.168.178.47:8087/write?db=readsb": dial tcp 192.168.178.47:8087: connect: connection refused

2021-10-26T14:09:56.824944928Z [telegraf] 2021-10-26T14:09:56Z E! [agent] Error writing to outputs.influxdb: could not write any address

2021-10-26T14:09:57.020377956Z [cont-finish.d] executing container finish scripts...

2021-10-26T14:09:57.137539337Z [cont-finish.d] 05-rtlsdr-biastee: executing...

2021-10-26T14:09:57.856642539Z [telegraf] 2021-10-26T14:09:57Z E! [outputs.influxdb] When writing to [http://192.168.178.47:8087]: failed doing req: Post "http://192.168.178.47:8087/write?db=readsb": dial tcp 192.168.178.47:8087: connect: connection refused

2021-10-26T14:09:57.856776392Z [telegraf] 2021-10-26T14:09:57Z E! [agent] Error writing to outputs.influxdb: could not write any address

2021-10-26T14:09:58.258301008Z [cont-finish.d] 05-rtlsdr-biastee: exited 0.

2021-10-26T14:09:58.279907393Z [cont-finish.d] done.

2021-10-26T14:09:58.288039774Z [s6-finish] waiting for services.

2021-10-26T14:09:58.749522230Z [s6-finish] sending all processes the TERM signal.

2021-10-26T14:10:01.819658967Z [s6-finish] sending all processes the KILL signal and exiting.

Missing port number 30003, adsbhub can't connect

Hi,

not sure if this is the right place, but the container adsbhub has errors reading the readsb at port 30003:

2021/08/30 08:01:38 socat[757] E connect(5, AF=2 172.18.0.7:30003, 16): Connection refused
not connected

Where 172.18.0.7 is my readsb container. But port 30003 is not used. Port number 30005 is available, but I guess that is a different format.

So, how to make my adsbhub container working. Is this related to #40? Where you added beast export port. Maybe there are more exports needed for different ports?

The docker-compose config is using the readsb container https://github.com/mikenye/docker-adsbhub#up-and-running-with-docker-compose

Logs flooding with error

I switched from piaware to readsb as ADS-B source. I noticed the log is flooding with the following message:
[readsbrrd] 2020/11/09 11:05:51 cannot create rrd files in '/var/lib/collectd/rrd/localhost/readsb': no such directory

This directory is mapped as a persistent volume in my docker-compose file:

volumes:
  - /docker/readsb/rrd:/run/collectd

I entered the container and saw that the directory /var/lib/collectd/rrd/localhost exists, but not the subdirectory readsb. Created it and the error is gone. Looks like something is off during the initialization phase.
But are al files now in the right place?

Positions far off in local view

Hi, I am a very happy user of this docker image and kudos to the good work done here.

But, on one of my remote receivers which I deployed at my son's place in Germany, I am having a really strange issue with the Maps display, when using it directly on the container, but I think a picture tells more than 1000 words:

image

So the station is located in Paderborn, Germany, but the planes show up somewhere over Oxford in the UK......

The first check from me was to see if remotely loaded data had been impacted by this as well, so I setup my little own map server at home in the Netherlands and started to load the Paderborn data remotely into another readsb container running in NET_ONLY mode and subscribing to the data stream of not only my local receivers but also to the other two remote rcvrs in Hamburg and Paderborn.

In the consolidated view here in NL, everything is / was alright and the planes showed up where I would expect them: somewhere close to Paderborn and not in Oxford...

Next step then was to see if this was related to the config of the local receiver and see if there were any ENV variables which would be different to the other receivers in NL and Hamburg: identical, except the specific settings per location like LONG/LAT and the Timezones which are of course specific to every location. (Actually they are all in CET, but my home receiver gets Europe/Amsterdam, the other one's as they are in Germany, get TZ=Europe/Berlin)

So I thought, okay, the Paderborn receiver had the worst receiver and antenna setup still running on a unfiltered rtlsdr from ebay, so I changed them this weekend against a self built and burnt-in colinear antenna on a Flightaware 1090 filter with a nooelec rtlsdr as the receiver....which ran perfect and with no issues at all during the burnin test here in NL. But also with a completely different receiving hardware, the positions are still far off in the local view....

Anyone an idea on where to look further or ever experienced something like this before?

Here is a pastebin of a docker inspect of the affected container:
https://pastebin.com/BgHLqQMZ

Why is a specific gain chosen from autogain?

I've been running the autogain sequence and i am now in the final state. My next review is scheduled for may 2022.
But i feel like the chosen gain is wrong.

File Value
autogain_current_value 32.8
autogain_max_value 49.6
autogain_min_value 29.7

I'll try and list some of the findings and explain why i feel like the chosen value of 32.8 is wrong.
All these numbers are from the .finetune files, not the .init files.

gain autogain_results pct_strong_msgs max_distance total_accepted_msgs tracks_new
29.7 -37 3.250 422732 5310215 5348
32.8 1650 3.880 441913 7019561 7917
33.8 1551 3.590 519896 7000562 8238
36.4 1212 3.270 454991 7050111 8062
37.2 764 3.040 462524 7031887 8283
38.6 256 3.180 439159 7231599 9218
40.2 17 2.700 437740 7076983 7843
42.1 949 2.510 448339 7184047 8917
43.4 36 1.030 443968 7116347 5586
43.9 38 .5800 442202 7128397 8149
44.5 60 .7100 434903 7084865 7979
48.0 39 .6700 446719 7020796 8306
49.6 71 .2300 465604 27826003 29576

Looking at this, i feel like 33.8 should be the accepted gain, but i would actually prefer a much higher gain like 48.0 or 49.6. I live right next to a major airport (like 3km to tarmac, 5km to the gates) and i pickup so many signals from ground vehicles and parked planes. I am thinking those signals are kinda skewing the results of the autogain, as my current gain (32.8) gives me way less airborne planes and less long distance planes compared to when i was using a gain above 45.

Sure it is nice to track the planes from the gates, to the runway and departing, but i lose most planes at the 50km mark.

Looking at my feeder right now, i am getting a message rate of 250msg/s with 24/15 aircraft. But 5 are grounded and parked (not at gates, but like in storage/maintenance buildings) and 2 are non aircraft vehicles, which services the runway. 3 of those 15 aircrafts are outside of my 50km radius, whereas the rest are within 50km (most within 25km).

Should i just ignore the autogain and do some trial and error in order to find a satisfying gain or is there a way to filter the results by altitude, so i avoid those parked aircraft and vehicles?

Feature Request: Add variable to allow setting of Telegraf hostname

Currently Telegraf appears to pick up the container ID as the hostname when logging to InfluxDB. As the ID changes when the container is redeployed, this causes the hostname in Influx DB to change when the container is updated. Can a variable be added to give the option to set the Telegraf hostname to a fixed value which then persists across container instances.

Feature Request: Disable CPU Temp monitoring

Hi,
i tried readsb today in a docker VM inside Proxmox.
This allows me for easy backup and has several other advantages.
USB passthrough works.
But readsb cannot read the CPU Temp. Therefore, i get an error in the log file as well as a missing graph.

Would it be possible to disable the cpu readout?

Thanks

Synology Docker issue

Hello.

I am trying to launch a container in Docker on Synology and I get an error:
rtlsdr: no supported devices found

But on a laptop with Debian, the container starts correctly.

telegraf error: Error in plugin: metric parse error: expected field at 72:31: "polar_range,bearing=71 range=..."

Hi. I get a lot of errors like in the title from telegraf:

[telegraf] 2022-01-12T21:27:01Z E! [inputs.exec] Error in plugin: metric parse error: expected field at 72:31: "polar_range,bearing=71 range= 1642022821000000000"
[telegraf] 2022-01-12T21:28:01Z E! [inputs.exec] Error in plugin: metric parse error: expected field at 72:31: "polar_range,bearing=71 range= 1642022881000000000"

The data seems to be generated by /scripts/telegraf_input_readsb_protoc_range.sh. Reading this, I think the error may be caused by a missing initialization of the range variable.
The bearings seems to be 360/5 (72), and the output is generated in reverse order which means that bearing 71 is actually the first one generated.

I think this may be fixed by adding range=0 underneath https://github.com/mikenye/docker-readsb-protobuf/blob/7426037aedaf60712d0074043320fe1cb921e584/rootfs/scripts/telegraf_input_readsb_protoc_range.sh#L18

Does my conclusion look right?

Web UI map shows no planes

I tested with viewadsb and I get a lot of results, but for some reason the web map at :8080 shows no aircraft. I get the following error in the console:

Uncaught DOMException: Failed to execute 'importScripts' on 'WorkerGlobalScope': The script at http://planepi:8080/script/readsb/pbf.js' failed to load at http://planepi:8080/script/readsb/backend/aircraftCollection.js/:2:6

The file is actually at http://planepi:8080/script/pbf.js, so apparently the extra slash in the URL of aircraftCollection.js is throwing off the reference to self.importScripts("../../pbf.js"); at the top. I don't know enough about the infrastructure of the web sources to debug why that URL is being built that way.

I'm using Linux Chrome if that makes any difference.

Wrong display of polar plot

I can see that the polar plot does display wrong directions:

image

If I compare to flightaware and flightradar24:
image

image

It looks like it is mirrored between West/East? Any ideas why this happens?

Map Overview in grafana dashboard

Hi!

First of all thank you work on this!
However i found i was missing something in the grafana dashboard itself, so i decided to make it myself and share it with you trough an issue.

This is what i made:
a geo map that queries the database for the following aircraft data:

  • lat
  • long
  • Alt ( extra value when icon on map is clicked, icon scales depending on this value)
  • Spd ( extra value when icon on map is clicked)
  • Trak ( used for heading, geomap rotates the icon depending on this value)

ordered by ICAO and CALL
image

when the icon is clicked:

image

i hope this is something you can use to upgrade/update your dashboard to rev5!

below is the json output of the panel::

{ "id": 35, "gridPos": { "h": 32, "w": 15, "x": 0, "y": 5 }, "type": "geomap", "title": "Currently Tracked Aircraft map", "datasource": { "type": "influxdb", "uid": "" }, "pluginVersion": "9.2.3", "timeFrom": "1m", "hideTimeOverride": true, "description": "A map with the position data of aircraft in the last minute", "fieldConfig": { "defaults": { "custom": { "hideFrom": { "tooltip": false, "viz": false, "legend": false } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] }, "color": { "mode": "thresholds" } }, "overrides": [] }, "options": { "view": { "id": "fit", "lat": 46, "lon": 14, "zoom": 15, "allLayers": true, "lastOnly": false, "layer": "Layer 1" }, "controls": { "showZoom": true, "mouseWheelZoom": true, "showAttribution": true, "showScale": true, "showMeasure": true, "showDebug": false }, "tooltip": { "mode": "details" }, "basemap": { "config": {}, "name": "Layer 0", "type": "osm-standard" }, "layers": [ { "config": { "showLegend": true, "style": { "color": { "fixed": "#000000" }, "opacity": 1, "rotation": { "field": "Heading", "fixed": 0, "max": 360, "min": -360, "mode": "mod" }, "size": { "field": "Altitude", "fixed": 5, "max": 15, "min": 10 }, "symbol": { "fixed": "img/icons/marker/plane.svg", "mode": "fixed" }, "text": { "field": "Call", "fixed": "", "mode": "field" }, "textConfig": { "fontSize": 12, "offsetX": 0, "offsetY": 30, "textAlign": "center", "textBaseline": "middle" } } }, "location": { "latitude": "aircraft.Lat", "longitude": "aircraft.Long", "mode": "auto" }, "name": "Aircraft", "tooltip": true, "type": "markers" } ] }, "targets": [ { "datasource": { "type": "influxdb", "uid": "IfTatmoVz" }, "groupBy": [ { "params": [ "Icao" ], "type": "tag" }, { "params": [ "Call" ], "type": "tag" } ], "measurement": "aircraft", "orderByTime": "ASC", "policy": "default", "refId": "A", "resultFormat": "table", "select": [ [ { "params": [ "Lat" ], "type": "field" }, { "params": [], "type": "last" }, { "params": [ "Latitude" ], "type": "alias" } ], [ { "params": [ "Long" ], "type": "field" }, { "params": [], "type": "last" }, { "params": [ "Longitude" ], "type": "alias" } ], [ { "params": [ "Alt" ], "type": "field" }, { "params": [], "type": "last" }, { "params": [ "Altitude" ], "type": "alias" } ], [ { "params": [ "Spd" ], "type": "field" }, { "params": [], "type": "last" }, { "params": [ "Speed" ], "type": "alias" } ], [ { "params": [ "Trak" ], "type": "field" }, { "params": [], "type": "last" }, { "params": [ "Heading" ], "type": "alias" } ] ], "tags": [ { "key": "Call", "operator": "!=", "value": "" } ] } ] }

Error with Telegraf

Hello Mike,

I get this error today when I started readsb-protobuf. And now no data can be seen in Grafana.

2021-02-18T08:10:34.906873867Z [readsb] 2021/02/18 09:10:34 Found Rafael Micro R820T tuner
2021-02-18T08:10:34.925793874Z [lighttpd] 2021/02/18 09:10:34 2021-02-18 09:10:34: (server.c.1464) server started (lighttpd/1.4.53) 
2021-02-18T08:10:35.089667270Z [readsb] 2021/02/18 09:10:35 rtlsdr: tuner gain set to 49.6 dB
2021-02-18T08:10:35.325139723Z [readsb] 2021/02/18 09:10:35 Beast TCP input: Connection established: mlathub (172.18.0.9) port 30105
2021-02-18T08:11:01.283955530Z [telegraf] 2021-02-18T08:11:01Z E! [inputs.exec] Error in plugin: metric parse error: expected field at 72:31: "polar_range,bearing=71  range= 1613635861000000000"
2021-02-18T08:11:34.482054923Z [graphs] 2021/02/18 09:11:34 Initialising graphs
2021-02-18T08:12:01.901672867Z [telegraf] 2021-02-18T08:12:01Z E! [inputs.exec] Error in plugin: metric parse error: expected field at 72:31: "polar_range,bearing=71  range= 1613635921000000000"
2021-02-18T08:13:01.874342539Z [telegraf] 2021-02-18T08:13:01Z E! [inputs.exec] Error in plugin: metric parse error: expected field at 72:31: "polar_range,bearing=71  range= 1613635981000000000"
2021-02-18T08:14:02.564231281Z [telegraf] 2021-02-18T08:14:02Z E! [inputs.exec] Error in plugin: metric parse error: expected field at 72:31: "polar_range,bearing=71  range= 1613636042000000000"
2021-02-18T08:15:02.487289986Z [telegraf] 2021-02-18T08:15:02Z E! [inputs.exec] Error in plugin: metric parse error: expected field at 72:31: "polar_range,bearing=71  range= 1613636102000000000"
2021-02-18T08:16:02.827809255Z [telegraf] 2021-02-18T08:16:02Z E! [inputs.exec] Error in plugin: metric parse error: expected field at 72:31: "polar_range,bearing=71  range= 1613636162000000000"

readsb-protobuf v4.0.1 to v4.0.2: readsb becomes unreachable

I noticed that my fr24feed container became unhealthy after the most recent updates. The fr24feed logs show:

2021-08-28 14:39:28 | [reader][e]Could not connect to tcp://readsb:30005
2021-08-28 14:39:33 | [reader][e]Could not connect to tcp://readsb:30005
2021-08-28 14:39:38 | [reader][e]Could not connect to tcp://readsb:30005
2021-08-28 14:39:43 | [reader][e]Could not connect to tcp://readsb:30005

When downgrading readsb-protobuf from latest to v4.0.1 everything works OK. When upgrading to v4.0.2 the problem reoccurs. What happened?

Pluto SDR Start Instructions

I have successfully gotten the docker image to run with the PlutoSDR using this docker command:

docker volume create readsbpb_rrd
docker volume create readsbpb_autogain

docker rm -f readsb

docker run \
	 -d \
	 -it \
	 --restart=always \
	 --name readsb \
	 --network host \
	 --hostname readsb \
	 --add-host pluto.local:192.168.2.1 \
         --device /dev/bus/usb:/dev/bus/usb \
         -p 8080:8080 \
         -p 30005:30005 \
         -e TZ=America/Denver \
	 -e READSB_DCFILTER=true \
	 -e READSB_DEVICE_TYPE=plutosdr \
         -e READSB_FIX=true \
         -e READSB_GAIN=autogain \
         -e READSB_LAT=39.8 \
         -e READSB_LON=-104.7 \
         -e READSB_MODEAC=true \
	 -e READSB_RX_LOCATION_ACCURACY=2 \
         -e READSB_STATS_RANGE=true \
         -e READSB_NET_ENABLE=true \
         -e READSB_ENABLE_BIASTEE=true \
         -v readsbpb_autogain:/run/autogain \
         -v readsbpb_rrd:/run/collectd \
         --tmpfs=/run:exec,size=64M \
         --tmpfs=/var/log:size=32M \
         ghcr.io/sdr-enthusiasts/docker-readsb-protobuf:latest

Critical to the success was the argument:

 --add-host pluto.local:192.168.2.1 

Otherwise the readsb process can not find the plutosdr network connection. Even if you use the option and specify the IP address. Not sure why that would not work.

Hope this helps!

cannot read realtime clock: Operation not permitted

Hi,

Thanks for providing this container. After the last re-creation yesterday I ran into some kind of privilege issue. I see this in the container logs (taken from Portainer):

[readsb] 1985/01/20 21:28:32 Sat Feb 21 12:03:28 1970 Germany  Mictronics v4.0.1 starting up.
[readsb] 1985/01/20 21:28:32 readsb: ../../libusb/libusbi.h:497: usbi_get_monotonic_time: Assertion `clock_gettime(1, tp) == 0' failed.
./run: line 325:  1262 Aborted                 (core dumped) "${READSB_BIN}" "${READSB_CMD[@]}" 2>&1
      1263 Done                    | stdbuf -o0 sed --unbuffered '/^$/d'
      1264 Done                    | stdbuf -o0 awk '{print "[readsb] " strftime("%Y/%m/%d %H:%M:%S", systime()) " " $0}'
sleep: cannot read realtime clock: Operation not permitted
[autogain] 1957/05/17 10:27:12 sleep: cannot read realtime clock: Operation not permitted
sleep: cannot read realtime clock: Operation not permitted
sleep: cannot read realtime clock: Operation not permitted
sleep: cannot read realtime clock: Operation not permitted
sleep: cannot read realtime clock: Operation not permitted
sleep: cannot read realtime clock: Operation not permitted
sleep: cannot read realtime clock: Operation not permitted
[readsb] 1957/11/08 09:29:36 Thu Feb 26 19:29:20 1970 Germany  Mictronics v4.0.1 starting up.
[readsb] 1957/11/08 09:29:36 readsb: ../../libusb/libusbi.h:497: usbi_get_monotonic_time: Assertion `clock_gettime(1, tp) == 0' failed.
./run: line 325:  1323 Aborted                 (core dumped) "${READSB_BIN}" "${READSB_CMD[@]}" 2>&1
      1324 Done                    | stdbuf -o0 sed --unbuffered '/^$/d'
      1325 Done                    | stdbuf -o0 awk '{print "[readsb] " strftime("%Y/%m/%d %H:%M:%S", systime()) " " $0}'
sleep: cannot read realtime clock: Operation not permitted
sleep: cannot read realtime clock: Operation not permitted
sleep: cannot read realtime clock: Operation not permitted
sleep: cannot read realtime clock: Operation not permitted
sleep: cannot read realtime clock: Operation not permitted
sleep: cannot read realtime clock: Operation not permitted
[autogain] 2003/10/26 04:05:20 sleep: cannot read realtime clock: Operation not permitted
sleep: cannot read realtime clock: Operation not permitted
[readsb] 1987/12/22 05:37:04 Wed Feb 25 07:04:48 1970 Germany  Mictronics v4.0.1 starting up.
[readsb] 1987/12/22 05:37:04 readsb: ../../libusb/libusbi.h:497: usbi_get_monotonic_time: Assertion `clock_gettime(1, tp) == 0' failed.
./run: line 325:  1380 Aborted                 (core dumped) "${READSB_BIN}" "${READSB_CMD[@]}" 2>&1
      1381 Done                    | stdbuf -o0 sed --unbuffered '/^$/d'
      1382 Done                    | stdbuf -o0 awk '{print "[readsb] " strftime("%Y/%m/%d %H:%M:%S", systime()) " " $0}'
sleep: cannot read realtime clock: Operation not permitted
[autogain] 2020/08/31 05:34:56 sleep: cannot read realtime clock: Operation not permitted
sleep: cannot read realtime clock: Operation not permitted
sleep: cannot read realtime clock: Operation not permitted
sleep: cannot read realtime clock: Operation not permitted
sleep: cannot read realtime clock: Operation not permitted
sleep: cannot read realtime clock: Operation not permitted
sleep: cannot read realtime clock: Operation not permitted

I then re-created the container using docker-compose setting privileged: true
After this change the container seems to be running fine.
Any idea what causes this issue? I believe using the privileged flag is not the best option?

I am using Docker version 20.10.8, build 3967b7d
on a Raspberry Pi 4 5.10.52-v7l+ #1441 SMP Tue Aug 3 18:11:56 BST 2021 armv7l

Cheers

Problems when starting lighttpd

When I run the container, everything starts smoothly, except lighttpd. I'm seeing this in my logs, over and over again:

Mar 10 00:51:13 host  [lighttpd] 2021/03/10 00:51:13 2021-03-10 00:51:13: (server.c.1209) opening pid-file failed: /var/run/lighttpd/lighttpd.pid Permission denied
Mar 10 00:51:13 host  [lighttpd] 2021/03/10 00:51:13 2021-03-10 00:51:13: (server.c.428) unlink failed for: /var/run/lighttpd/lighttpd.pid 2 No such file or directory

The problem is, that after starting, lighttpd drops privileges to readsb user (which is fine) and tries to create a pidfile. However /var/run/lighttpd directory is owned by root with no write permissions to other. Thus lighttpd fails.

Currently I circumvent this, by mounting /run/lighttpd volume with proper permissions - but I believe, the proper fix will be changing ownership of this directory to readsb.

P.S. This thing is amazing! :)

InfluxDB:latest upgraded to version 2

my docker-compose points to influxdb:latest. 4 days ago, the latest branch upgraded from version 1 to 2, making the current setup failing. When I modify my docker-compose to influxdb:1.8 it is working again.

However, it would be nice to have the latest version available. I am no InfluxDB expert, can you help upgrading to the latest version?

Issue Re-Serializing RTL2832U (but not an RTL2838)

Hello everyone!

I just got started following along the handy helpful guide a few weeks ago to get my setup running, and while I was able to achieve an adequate setup, I would love some help making things... a little less fiddly.

I have two RTL-SDR USB sticks:

By plugging each in one at a time, I was able to reserialize the SMArTee v2 to a serial number of 1080 but I wasn't able to re-serialize the SMArt v4 (sporting that RTL2832U). So now what I have to do each time I restart the box is find which exact USB device/bus combo corresponds to which SDR so I can pass each individually to their corresponding Docker containers.

Is it something I did wrong, is it an issue with this particular repo, or is it an upstream issue? Here's the output from the two relevant commands:

$ lsusb -vs 001:004

Bus 001 Device 004: ID 0bda:2832 Realtek Semiconductor Corp. RTL2832U DVB-T
Couldn't open device, some information will be missing
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x0bda Realtek Semiconductor Corp.
  idProduct          0x2832 RTL2832U DVB-T
  bcdDevice            1.00
  iManufacturer           1 Generic
  iProduct                2 RTL2832U
  iSerial                 3 [serial redacted]
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0019
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          4 
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol    255 Vendor Specific Protocol
      iInterface              5 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
$ sudo docker run --rm -it --device /dev/bus/usb/001/004 --entrypoint rtl_eeprom mikenye/readsb-protobuf -s 978

Found 2 device(s):
  0:  Generic RTL2832U
  1:  Generic RTL2832U OEM

Using device 0: Generic RTL2832U
Found Rafael Micro R820T tuner

Current configuration:
Error: invalid RTL2832 EEPROM header!
Error: invalid string descriptor!
Error: invalid string descriptor!
Error: invalid string descriptor!
__________________________________________
Vendor ID:		0xffff
Product ID:		0xffff
Manufacturer:		???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
Product:		????????????????????????????????????????????????????????????
Serial number:		??????????????????????????????????
Serial number enabled:	no
IR endpoint enabled:	yes
Remote wakeup enabled:	yes
__________________________________________

New configuration:
Error: string too long, truncated!

Again, the serialization worked fine for the SMArTee v2, just not for this SMArt v4. Has anyone run into this issue before?

Feature request: Healthcheck for dropped samples

Hi Mike,

This morning I noticed that I have dropped samples again.
grafik
A simple restart of the container resolved the issue as before. I still need to dig deeper into that (might be a transient thing with the PSU or SDR) but I started to wonder on how many stations this occurs unnoticed.
As a feature request: Would it be possible (and useful) to somehow integrate this into the healthchecks? If any dropped samples over time x, mark the container as degraded and throw an error message in the logs (or maybe even force a container internal readsb restart)?

Feature request / usage clarification: Remote SDR

Dear Mike,

I recently moved to a house near an airport, which has drawn me into aircraft monitoring. I already have a working system based on dump1090, but I'm in the process of finding ways to do more than forward data to some websites. Just yesterday I came across your projects and they look really promising - thanks for that!

I have a Raspberry Pi 4, a FlightAware stick and a TEN-90 antenna in the attic. The Raspbi is currently running dump1090, which I'd like to convert to work with your project. I have a more powerful computer in the basement that I would like to use to run the containers.

Is it possible to "connect" remote SDR's over the network? If not, do you think this is an idea worth adding? If not, do you have any ideas on how to achieve it by other means?

Many thanks and greetings
Sebastian

making readsbpb_rrd persistent

Hello,
I am encountering some issues while trying to make the rrd volume persist between updates of the readsb-protobuf container.

At the moment I have the following docker composed deployed through portainer as a Stack:

version: '2.1'
volumes:
  readsbpb_rrd:
    driver: local
    driver_opts:
      type: none
      device: /docker_config/config/readsb/run/collectd
      o: bind
#  readsbpb_autogain:

services:
  readsb:
    image: mikenye/readsb-protobuf:latest
    tty: true
    container_name: readsb
    hostname: readsb
    devices:
      - "/dev/bus/usb:/dev/bus/usb"
    ports:
      - 8080:8080
    environment:
      - TZ="Europe/Rome"
      - READSB_DEVICE_TYPE=rtlsdr
      - READSB_RTLSDR_DEVICE=a1090
      - READSB_GAIN=autogain
      - READSB_LAT=y.yyyy
      - READSB_LON=x.xxxx
      - READSB_RX_LOCATION_ACCURACY=2
      - READSB_STATS_RANGE=true
      - READSB_NET_ENABLE=true
      - READSB_RTLSDR_PPM=0
      - FEEDER_ALT_FT=69
      - FEEDER_ALT_M=21
      - READSB_DCFILTER=true
    volumes:
      - /docker_config/config/readsb/run/autogain:/run/autogain
      - readsbpb_rrd:/run/collectd
    tmpfs:
      - /run/readsb
      - /var/log

This results into the following volume to be created.
Schermata 2021-11-19 alle 17 32 30

Today I had to rebuild the stack and change its name (it was formerly something like test1234) and after the deployment, I realized that the whole content of the docker_config/config/readsb/run/collectd folder has been overwritten, thus loosing a couple of months of stats.

Now, my question is: has it been initialized by readsb-protobuf? if so , what are the conditions under which it rebuilds the collectd folder?

partial write: max-series-per-database limit exceeded: (1000000)

Hello,

I'm using the latest version of your container and feeding it into influxdb 1.8.x

Full error - Failed to write metric (will be dropped: 400 Bad Request): partial write: max-series-per-database limit exceeded: (1000000)

I've been using this container for a while and I noticed this error in the container logs this morning. Looking back I can see that this error has been occurring for months as most data is missing, but it is recording metrics sporadically.

Obviously I could up the limit above 1 million but I don't think that is the best thing to do, I'd like to understand why I am hitting this limit instead.

Thanks in advance for any help you can provide.

readsb error on docker-compose up -d

I've never used docker and I'm just getting into ads-b. I have been following the guide from https://mikenye.gitbook.io/ads-b/foundations/deploy-readsb-container and I've run into this problem when attempting docker-compose up -d which I have included below. Because of the readsb error it won't create the adsbx container. I also included the docker-compose.yml file text below that. Any help with what I may have going wrong would be appreciated.
Thanks

pi@raspberrypi:/opt/adsb $ docker-compose up -d
dump978 is up-to-date
Creating readsb ... error

ERROR: for readsb Cannot create container for service readsb: Conflict. The container name "/readsb" is already in use by container "619a3a5d97055f7cedd0a7a14cdec9328dd6043ce1897ae5f10e80af377faa78". You have to remove (or rename) that container to be able to reuse that name.

ERROR: for readsb Cannot create container for service readsb: Conflict. The container name "/readsb" is already in use by container "619a3a5d97055f7cedd0a7a14cdec9328dd6043ce1897ae5f10e80af377faa78". You have to remove (or rename) that container to be able to reuse that name.
ERROR: Encountered errors while bringing up the project.

docker-compose.yml

version: '3.8'

volumes:
readsbpb_rrd:
readsbpb_autogain:

services:
readsb:
image: mikenye/readsb-protobuf:latest
tty: true
container_name: readsb
hostname: readsb
restart: always
devices:
- /dev/bus/usb
ports:
- 8080:8080
environment:
- TZ=${FEEDER_TZ}
- READSB_DEVICE_TYPE=rtlsdr
- READSB_RTLSDR_DEVICE=1090
- READSB_GAIN=autogain
- READSB_LAT=${FEEDER_LAT}
- READSB_LON=${FEEDER_LONG}
- READSB_RX_LOCATION_ACCURACY=2
- READSB_STATS_RANGE=true
- READSB_NET_ENABLE=true
- READSB_NET_CONNECTOR=dump978,37981,raw_in
volumes:
- readsbpb_rrd:/run/collectd
- readsbpb_autogain:/run/autogain
tmpfs:
- /run/readsb
- /var/log
dump978:
image: mikenye/dump978:latest
tty: true
container_name: dump978
restart: always
devices:
- /dev/bus/usb
environment:
- TZ=${FEEDER_TZ}
- DUMP978_RTLSDR_DEVICE=978
tmpfs:
- /run/readsb
adsbx:
image: mikenye/adsbexchange:latest
tty: true
container_name: adsbx
restart: always
depends_on:
- readsb
environment:
- BEASTHOST=readsb
- LAT=${FEEDER_LAT}
- LONG=${FEEDER_LONG}
- ALT=${FEEDER_ALT_M}m
- SITENAME=${ADSBX_SITENAME}
- UUID=${ADSBX_UUID}
- TZ=${FEEDER_TZ}
tmpfs:
- /run:exec,size=64M,uid=1000,gid=1000
- /var/log

USB-Claim 6

Hi all, when docker-compose up the following:

piaware    | [dump1090] 2022/03/02 23:08:39 rtlsdr: error opening the RTLSDR device: Device or resource busy
piaware    | [dump1090] 2022/03/02 23:08:40 Wed Mar  2 23:08:40 2022   dump1090-fa v7.1 starting up.
piaware    | [dump1090] 2022/03/02 23:08:40 rtlsdr: using device #0: Generic RTL2832U (Realtek, RTL2832U, SN 00001090)
piaware    | [dump1090] 2022/03/02 23:08:40 usb_claim_interface error -6

If I use marcelstoer/adsbexchange-feed:latest image, then everything works. Though, would prefer the image from SDR-enthusiasts as it appears the mapping has more features. Have followed various instructions to alleviate the error -6 - have used blacklists.

This is on centos 7 with a laptop not a pi

Thanks!

Remote readsb?

Hello,
I was wondering if it’s possible to use resdsb to capture data on a remote site and use a different host (same network) and use a different readsb + readsb sharing service containers to retrieve the data and push it to internet?
Assuming the remote host has a lower processing power, this could improve the performances on it?
Thanks!

autogain script issue

When in a place where a gain of 49.6 so overloads the SDR that it gets not messages at all, the script will keep sitting at the highest value and not progress.
The obvious solution would seem to be to pass in a lower value for AUTOGAIN_MAX_GAIN_VALUE, but that's insufficient when then simply restarting the readsb container as it just continues on the value that it already started on.

As a hackish workaround I documented in the GitBook that one can simply overwrite the /run/autogain/autogain_current_value with something like

docker exec -it readsb sh -c "/bin/echo 34 > /run/autogain/autogain_current_value"
docker restart readsb

but it would be nicer if this, too, could be handled via changes to the environment variable.

Docker Container is not starting properly

Hey, I created a news Docker Container as explained here. But when I start the container it hangs and I see the following output in the log of portainer:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
,[s6-init] ensuring user provided files have correct perms...exited 0.
,[fix-attrs.d] applying ownership & permissions fixes...
,[fix-attrs.d] done.
,[cont-init.d] executing container initialization scripts...
,[cont-init.d] 01-timezone: executing...
,[cont-init.d] 01-timezone: exited 0.
,[cont-init.d] 02-sanity-check: executing...
,[cont-init.d] 02-sanity-check: exited 0.
,[cont-init.d] 03-initialise-gain: executing...
,[cont-init.d] 03-initialise-gain: exited 0.
,[cont-init.d] 04-telegraf: executing...
,[cont-init.d] 04-telegraf: exited 0.
,[cont-init.d] 05-rtlsdr-biastee: executing...
,[cont-init.d] 05-rtlsdr-biastee: exited 0.
,[cont-init.d] done.
,[services.d] starting services
,[collectd] 2021/11/25 00:24:59 [2021-11-25 00:25:00] plugin_load: plugin "logfile" successfully loaded.
,[services.d] done.
,[autogain] 2021/11/25 00:24:59 Container restart detected, resuming auto-gain state 'init' with gain 49.6 dB
,[readsb] 2021/11/25 00:24:59 Thu Nov 25 00:24:59 2021 CET Mictronics v4.0.2 starting up.
,[readsb] 2021/11/25 00:24:59 rtlsdr: using device #0: Generic RTL2832U OEM (Realtek, RTL2838UHIDIR, SN 00000001)
,[readsb] 2021/11/25 00:25:00 Found Rafael Micro R820T tuner
,[lighttpd] 2021/11/25 00:25:00 2021-11-25 00:24:59: (server.c.1464) server started (lighttpd/1.4.53)
,[readsb] 2021/11/25 00:25:00 rtlsdr: tuner gain set to 49.6 dB
,[graphs] 2021/11/25 00:25:59 Initialising graphs
,[autogain] 2021/11/25 01:40:05 Insufficient messages received for accurate measurement, extending runtime of gain 49.6 dB.
,[autogain] 2021/11/25 02:40:10 Insufficient messages received for accurate measurement, extending runtime of gain 49.6 dB.
,[autogain] 2021/11/25 03:40:15 Insufficient messages received for accurate measurement, extending runtime of gain 49.6 dB.
,[autogain] 2021/11/25 04:40:19 Insufficient messages received for accurate measurement, extending runtime of gain 49.6 dB.
,[autogain] 2021/11/25 05:40:23 Insufficient messages received for accurate measurement, extending runtime of gain 49.6 dB.

When I test the container, as mentioned in the readme with:

„docker exec -it readsb viewadsb“

I got this:

Beast TCP input: Connection to 127.0.0.1 port 30005 failed: 111 (Connection refused)

Thats all, more is not happening even if I wait a long time.

I‘m running docker and portainer on a Raspberry 4 if this is important.

Any idea what I can do?

Regards wir43

riscv64 Heads-up

I'm just playing with my new VisionFive-2 SBC (review) It's currently running ArchLinux riscv64 which is bleeding edge of course. However it does mostly work although I'm not sure about drivers. There's a repo of core, community and extra packages.

Start here: Arch Linux Image for VisionFive 2

Support is beginning on Armbian although no luck booting it myself. Ubuntu also claims to support it but I could only find support for VisionFive not VisionFive-2

Something to think about :-)

Feature Request: Prometheus

I know you currently have InfluxDB support but with that in mind it'd be really nice to get prometheus intregration. Based on the current support for influxdb I wouldn't expect this would be too bad to add.

Influxdb reconnection failures

Seems like I'm having the issue as described over here: influxdata/telegraf#5905 I tried to run the container using the environment parameter through docker but that wasn't a success :(

I'm wondering in which file I should add this GODEBUG=http2client=0 parameter to test if this solves the issue with influxdb reconnecting behind a proxy like traefik

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.