Portfolio_Detail
All_Items

Benshi Dash

Tech: Flutter
Screenshots
Main project screenshot
Project_Details

What is BenshiDash?

BenshiDash is a sophisticated Android application designed to function as a full-featured head unit for specific amateur and GMRS radios that use the proprietary Benshi protocol for Bluetooth communication.

Built with Flutter, it transforms a standard Android tablet into a powerful, touch-friendly interface for controlling the radio, visualizing data, and managing its programming.

The application goes beyond simple remote control by integrating:

  • Live mapping for APRS (Automatic Packet Reporting System)
  • Web service integration for finding local repeaters
  • Advanced scanning tools

Together, these features create a centralized command center for in-vehicle radio operations.


How It Works: Core Architecture

BenshiDash is built around a central controller that manages the state of the connected radio.
The UI is composed of several specialized screens that interact with this controller to display data and send commands.


1. Radio Communication (radio_controller.dart)

This class is the heart of the application, handling all communication and state management.

  • Bluetooth Connection
    Uses the flutter_bluetooth_serial package to establish and maintain two Bluetooth RFCOMM connections:

    • Channel 3 → commands
    • Channel 4 → audio
  • Protocol Handling
    All data exchanged with the radio is wrapped in a GAIA frame.
    The controller uses _parseGaiaFrameFromBuffer to read the incoming byte stream, identify complete GAIA frames, and extract payloads.

  • Message Parsing
    Each GAIA frame’s payload is a Benshi protocol message, parsed by Message.fromBytes.
    These are converted into structured Dart objects representing commands, replies, or asynchronous events.

  • State Management
    Properties like deviceInfo, status, settings, and gps reflect the radio’s state.
    Events such as HT_STATUS_CHANGED automatically trigger UI updates via ChangeNotifier.

  • Command Execution
    UI commands are routed through _sendCommandExpectReply, which waits for specific replies while handling timeouts and errors.


2. The Benshi Protocol Implementation (benshi/protocol/)

BenshiDash includes a from-scratch implementation of the Benshi protocol to construct and parse the binary messages used by the radio.

  • Data Models (data_models.dart)
    Core classes like Channel, Settings, and Position parse binary data into objects (fromBytes) and serialize back (toBytes).

  • Bit-Level Manipulation (utils.dart)
    The protocol isn’t byte-aligned, so ByteReader and ByteWriter work at the bit level for precise parsing and serialization.

  • Command Structure (command_bodies.dart, message.dart)
    Numeric command IDs are mapped to Dart enums for readability.
    Each command has a corresponding “body” class for handling its unique data payload.


3. Key Functionalities

APRS Decoding and Mapping

BenshiDash can function as a TNC (Terminal Node Controller) for APRS without extra hardware.

  1. Radio receives an APRS packet and sends it as a DATA_RXD event.
  2. The RadioController reassembles fragmented TncDataFragment pieces.
  3. Once complete, raw AX.25 frame bytes are passed to AprsPacket.fromAX25Frame.
  4. The packet is decoded into source, destination, path, GPS coordinates, comments, and symbols.
  5. The AprsPacket is added to the controller’s list, updating the APRS map (flutter_map) with a new station marker.

RepeaterBook Integration

The app integrates with the RepeaterBook.com API for easy travel programming.

  1. From the Channels Screen, user triggers GPS Import.
  2. RepeaterBookService fetches the current location (from the radio or tablet GPS).
  3. Location is reverse-geocoded to determine the current state (e.g., Ohio).
  4. The RepeaterBook API is queried for repeaters in that state.
  5. Results are filtered to 2m and 70cm bands, then the closest 32 repeaters are selected.
  6. Each Repeater object is converted to a Channel object and written into the radio’s memory.

Like_What_You_See?

I'm available for similar projects. Let's discuss how I can help you achieve your goals.

View My Services