Skip to content

TCP multiplexer for MicroADSB (picADSB) USB receivers to share ADS-B data with multiple clients. Works as standalone Python app or Docker container.

License

Notifications You must be signed in to change notification settings

smkrv/picadsb-multiplexer

Repository files navigation

ADS-B Multiplexer for MicroADSB | adsbPIC by Sprut

MicroADSB | adsbPIC by SprutMicroADSB | adsbPIC by SprutMicroADSB | adsbPIC by SprutMicroADSB | adsbPIC by Sprut

A Docker-based TCP multiplexer for MicroADSB (adsbPIC) USB receivers that allows sharing ADS-B data with multiple clients (like dump1090).

β“˜ Can also be used without Docker as a system service using Python environment only, instructions available here.

If you have a USB ADS-B receiver like this, you can easily contribute aircraft data to various flight tracking services like FlightRadar24, FlightAware, ADSBHub, OpenSky Network, ADS-B Exchange, ADSB.lol and many others. Despite its age and simplicity, MicroADSB / adsbPIC by Sprut often outperforms many cheap RTL-SDR dongles in ADS-B reception quality and stability.

The device works perfectly on Raspberry Pi and other Unix-based systems, making it an excellent choice for feeding data to popular aggregators.

Features

  • Supports MicroADSB USB receivers (microADSB / adsbPIC)
  • Implements Beast Binary Format v2.0 for maximum compatibility
  • Advanced message validation using pyModeS library:
    • Reliable CRC computation and verification
    • Robust error detection
  • Dual-mode operation:
    • TCP server for multiple client connections
    • TCP client for forwarding data to remote servers
  • High-performance message processing:
    • Up to 500 messages/sec on 1 GHz CPU
    • Optimized CRC calculation
    • Efficient memory usage (~5 MB/1k connections)
  • Real-time statistics and monitoring
  • Configurable TCP ports and device settings
  • Docker support with automatic builds
  • Proper device initialization and error handling
  • Automatic reconnection on device errors

Protocol Support

Beast Binary Format

  • Full implementation of Beast Binary Format v2.0
  • Supports all message types:
    • Mode-S Short (DF17, 7 bytes)
    • Mode-S Long (14 bytes)
    • Mode-A/C with MLAT
  • Features:
    • 6-byte precision timestamps
    • CRC-24 validation
    • Proper escape sequence handling
    • Compatible with dump1090 and other tools

Device Specifications

  • Original adsbPIC creator: Joerg Bredendiek β€” Sprut
  • Device: MicroADSB USB receiver (β‰ˆ2010-20??)
  • Manufacturer: Miroslav Ionov
    • MicroADSB.com (website no longer available), last archived copy on WebArchive: September 18, 2024
    • Anteni.net (active as of Feb 2025)
  • Microcontroller: PIC18F2550
  • Firmware: Joerg Bredendiek β€” Sprut
  • Maximum theoretical frame rate: 200,000 fpm
  • Practical maximum frame rate: β‰ˆ6,000 fpm
  • Communication: USB CDC (115200 baud)
  • Message format: ASCII, prefixed with '*', terminated with ';'

Requirements

  • Docker
  • Docker Compose (optional)
  • USB port for the MicroADSB device
  • Linux system with udev support

Quick Start

β“˜ Set DIP switch 1 to ON position, while keeping others OFF:

 1   2   3   4  
β”Œβ”€β” β”Œβ”€β” β”Œβ”€β” β”Œβ”€β”  
β”‚β–ˆβ”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚  
β”‚ β”‚ β”‚β–ˆβ”‚ β”‚β–ˆβ”‚ β”‚β–ˆβ”‚  
β””β”€β”˜ β””β”€β”˜ β””β”€β”˜ β””β”€β”˜  
ON  OFF OFF OFF

Using Docker Compose

  1. Create a docker-compose.yml:
services:
  picadsb-multiplexer:
    image: ghcr.io/smkrv/picadsb-multiplexer:latest
    container_name: picadsb-multiplexer
    restart: unless-stopped
    devices:
      - /dev/ttyACM0:/dev/ttyACM0
    ports:
      - "31002:31002"
    environment:
      - ADSB_TCP_PORT=31002
      - ADSB_DEVICE=/dev/ttyACM0
      - ADSB_LOG_LEVEL=INFO
      - ADSB_REMOTE_HOST= # Indicate if required
      - ADSB_REMOTE_PORT= # Indicate if required
    volumes:
      - ./logs:/app/logs
  1. Start the service:
docker-compose up -d

Using Docker Run

docker run -d \
    --name picadsb-multiplexer \
    --serial=/dev/ttyACM0:/dev/ttyACM0 \
    -p 31002:31002 \
    -e ADSB_TCP_PORT=31002 \
    -e ADSB_DEVICE=/dev/ttyACM0 \
    -e ADSB_LOG_LEVEL=INFO \
    -e ADSB_REMOTE_HOST=localhost \ # Indicate if required
    -e ADSB_REMOTE_PORT=30005 \ # Indicate if required
    -v $(pwd)/logs:/app/logs \
    ghcr.io/smkrv/picadsb-multiplexer:latest

Configuration

Environment Variables

Variable Description Default
ADSB_TCP_PORT TCP port for client connections 31002
ADSB_DEVICE Path to USB device /dev/ttyACM0
ADSB_LOG_LEVEL Logging level (DEBUG, INFO, WARNING, ERROR) INFO
ADSB_REMOTE_HOST Remote server host for forwarding (optional)
ADSB_REMOTE_PORT Remote server port for forwarding (optional)

TCP Server Mode

  • Accepts multiple client connections
  • Ideal for feeding multiple services simultaneously
  • Example services:
    • dump1090
    • FlightAware
    • ADSBHub
    • OpenSky Network
    • ADS-B Exchange
    • ADSB.lol

TCP Client Mode

  • Forwards data to a remote server
  • Maintains persistent connection
  • Automatic reconnection on failures
  • Example usage:
services:
  picadsb-multiplexer:
    environment:
      - ADSB_REMOTE_HOST=feed.adsbexchange.com
      - ADSB_REMOTE_PORT=30005

Performance Tuning

Memory Usage

  • Base footprint: ~5 MB
  • Per-client overhead: ~2 KB
  • Maximum recommended clients: 1000

CPU Usage

  • Idle: <1% on Raspberry Pi 3
  • Peak: ~5-10% at 500 msg/sec
  • CRC calculation: Optimized with lookup table

Device Permissions

The container needs access to the USB device. Make sure the device is properly mapped in the Docker configuration:

devices:
  - /dev/ttyACM0:/dev/ttyACM0

You might need to add udev rules on the host system:

# Create a new udev rule
echo 'SUBSYSTEM=="usb", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="000a", MODE="0666"' | \
sudo tee /etc/udev/rules.d/99-microadsb.rules

# Reload udev rules
sudo udevadm control --reload-rules
sudo udevadm trigger

Integration with dump1090

Using Docker

# Start dump1090 with network input from multiplexer
docker run -d \
    --name dump1090 \
    --network host \
    antirez/dump1090 \
    --net-only \
    --net-ri-port 31002

Using Native Installation

dump1090 --net-only --net-ri-port 31002

Building from Source

  1. Clone the repository:
git clone https://github.com/smkrv/picadsb-multiplexer.git
cd picadsb-multiplexer
  1. Build the Docker image:
docker build -t picadsb-multiplexer .

Development

Project Structure

.
β”œβ”€β”€ Dockerfile
β”œβ”€β”€ LICENSE
β”œβ”€β”€ README.md
β”œβ”€β”€ adsb_message_parser.py
β”œβ”€β”€ assets
β”‚Β Β  └── images
β”‚Β Β      β”œβ”€β”€ IMG_8767.jpg
β”‚Β Β      β”œβ”€β”€ IMG_8768.jpg
β”‚Β Β      β”œβ”€β”€ IMG_8769.jpg
β”‚Β Β      β”œβ”€β”€ IMG_8771.jpg
β”‚Β Β      └── IMG_8772.jpg
β”œβ”€β”€ docker-compose.yml
β”œβ”€β”€ entrypoint.sh
β”œβ”€β”€ picadsb-multiplexer.py
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ .dockerignore
└── .github
    └── workflows
        └── docker-publish.yml

Running Tests

# Run the multiplexer in debug mode
docker run -it --rm \
    --serial=/dev/ttyACM0:/dev/ttyACM0 \
    -e ADSB_LOG_LEVEL=DEBUG \
    picadsb-multiplexer

Monitoring

Logs

Logs are stored in the logs directory:

  • picadsb-multiplexer_YYYYMMDD_HHMMSS.log: Detailed application log
  • Container logs can be viewed with docker logs picadsb-multiplexer

Statistics

The multiplexer maintains real-time statistics:

  • Messages processed
  • Messages per minute
  • Client connections
  • Error counts

Troubleshooting

Common Issues

  1. Device not found:
# Check device presence
ls -l /dev/ttyACM*

# Check USB device
lsusb | grep "04d8:000a"
  1. Permission denied:
# Add current user to dialout group
sudo usermod -a -G dialout $USER
  1. Connection refused:
# Check if port is open
netstat -tuln | grep 31002

Debug Mode

Enable debug logging:

docker-compose up -d -e ADSB_LOG_LEVEL=DEBUG

Performance Metrics

Messages/sec: 500
Beast conversion: 99.9%
CRC validation: 99.9%
Buffer usage: 2%
Active clients: 5
Remote connection: Connected

ADS-B Message Monitor (adsb_message_parser.py)

A real-time monitoring tool for ADS-B messages that provides a formatted display of aircraft surveillance data.

Features

  • Real-time display of ADS-B messages in a structured table format
  • Message type identification and description
  • Statistical analysis of received messages
  • Support for various ADS-B message formats (DF0, DF4, DF5, DF17, DF20)
  • Filtering of keep-alive messages
  • Session statistics with message type distribution

Usage

python3 adsb_message_parser.py [--host HOST] [--port PORT]

Arguments

  • --host: Server host address (default: localhost)
  • --port: Server port number (default: 31002)

Example Output

ADS-B Message Monitor
Connected to localhost:31002

Timestamp               | Type     | Message                     | Description
------------------------------------------------------------------------------------------
2025-02-14 15:03:00.012 | 28       | *28000000000000;            | Extended Squitter (DF5)

A real-time monitoring tool for ADS-B messages that provides a formatted display of aircraft surveillance data. Designed for quick testing and debugging of ADS-B receivers with human-readable output, message type identification, and live statistics tracking.


Direct Python Installation and Usage (Without Docker)

Quick Start

  1. Clone the repository:
git clone https://github.com/smkrv/picadsb-multiplexer/tree/main
cd picadsb-multiplexer
  1. Install required dependency:
pip3 install pyserial

Device Setup (Recommended)

Create persistent device name with udev rule:

sudo nano /etc/udev/rules.d/99-picadsb.rules

Add rule for automatic device recognition:

SUBSYSTEM=="tty", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="000a", SYMLINK+="ttyACM0"

Apply new rule:

sudo udevadm control --reload-rules

Usage

Basic Operation

Start the multiplexer:

python3 picadsb-multiplexer.py --port 31002 --serial /dev/ttyACM0

Testing Reception

Verify data flow using included test client:

python3 adsb_message_parser.py [--host localhost] [--port 31002]

Integration with dump1090

Connect to multiplexer using dump1090:

dump1090 --net-only --net-ri-port 31002

Running as System Service

Service Setup

  1. Create systemd service file:
sudo nano /etc/systemd/system/picadsbmultiplexer.service
  1. Configure service:
[Unit]
Description=picadsbmultiplexer TCP Bridge
After=network.target

[Service]
ExecStart=/usr/bin/python3 /path/to/picadsb-multiplexer.py --port 31002 --serial /dev/ttyACM0
WorkingDirectory=/path/to/script/directory
StandardOutput=append:/var/log/picadsbmultiplexer.log
StandardError=append:/var/log/picadsbmultiplexer.error.log
Restart=always
User=your_username

[Install]
WantedBy=multi-user.target

Service Management

Enable and start:

sudo systemctl daemon-reload
sudo systemctl enable picadsbmultiplexer
sudo systemctl start picadsbmultiplexer

Check status:

sudo systemctl status picadsbmultiplexer

Monitoring

Log Access

Service logs:

sudo journalctl -u picadsbmultiplexer -f

Application logs:

tail -f logs/adsb_muxer_*.log

Contributing

  1. Fork the repository
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

Acknowledgments

  • Original adsbPIC creator & firmware by Joerg Bredendiek β€” Sprut
  • Original MicroADSB device by Miroslav Ionov
  • dump1090 project for ADS-B decoding
  • pyModeS The Python ADS-B/Mode-S Decoder

Legal Disclaimer and Limitation of Liability

Software Disclaimer

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT.

IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

πŸ“ License

Author: SMKRV CC BY-NC-SA 4.0 - see LICENSE for details.

πŸ’‘ Support the Project

The best support is:

  • Sharing feedback
  • Contributing ideas
  • Recommending to friends
  • Reporting issues
  • Star the repository

If you want to say thanks financially, you can send a small token of appreciation in USDT:

USDT Wallet (TRC10/TRC20): TXC9zYHYPfWUGi4Sv4R1ctTBGScXXQk5HZ

Open-source is built by community passion! πŸš€


Made with ❀️ for the Aviation & Radio Enthusiasts Community

Report Bug Β· Request Feature

About

TCP multiplexer for MicroADSB (picADSB) USB receivers to share ADS-B data with multiple clients. Works as standalone Python app or Docker container.

Topics

Resources

License

Stars

Watchers

Forks

Packages