Skip to main content
BlueBus provides several diagnostic tools to help identify and resolve issues.

Log parser utility

The log parser (log_parser.pl) is a Perl script that translates raw BlueBus debug logs into human-readable format, making it easier to diagnose issues.

Features

  • Decodes I-Bus messages - Translates hex packets into meaningful commands and data
  • Parses Bluetooth events - Interprets BM83 and BC127 Bluetooth module messages
  • Adds timestamps - Correlates events with vehicle time (when GPS data available)
  • Filters noise - Optionally ignores high-frequency status messages
  • Statistics mode - Provides command frequency and device activity analysis

Installation

The log parser requires Perl with these modules:
# Install required Perl modules
cpan DateTime
cpan Getopt::Long
cpan Data::Dumper
The script is located at:
utility/log_parser.pl

Basic usage

./log_parser.pl your_bluebus_session.log

Command-line parameters

Time display options

--time
boolean
default:"true"
Display real-time timestamps based on vehicle clock (from IKE module)
--no-time
boolean
Disable real-time timestamp display (show only millisecond counter)
./log_parser.pl --time your_log.log        # Show local time
./log_parser.pl --no-time your_log.log     # Hide local time

Raw data options

--raw
boolean
Include original unparsed log line before each parsed message
--no-raw
boolean
default:"true"
Hide original log lines (default behavior)
./log_parser.pl --raw your_log.log         # Show original lines

Payload display

--payload
boolean
Always show raw hex payload, even for parsed commands
--no-payload
boolean
default:"true"
Show payload only for unparsed commands (default)
./log_parser.pl --payload your_log.log     # Always show hex data

Filtering options

--unprocessed
boolean
default:"true"
Include lines that can’t be parsed (debug messages, warnings)
--no-unprocessed
boolean
Hide unparsed lines (shows only I-Bus and Bluetooth messages)
./log_parser.pl --no-unprocessed your_log.log  # Clean output
--stats
boolean
Generate statistics report at end of log parsing
./log_parser.pl --stats your_log.log       # Show statistics
--ignore-commands
string
Ignore specified commands by name or hex ID (comma-separated)
# Ignore default noisy commands
./log_parser.pl -i your_log.log

# Ignore specific commands
./log_parser.pl --ignore-commands=IKE_BROADCAST_SPEED_RPM_UPDATE,RAD_TMC_REQUEST your_log.log

# Ignore by hex ID
./log_parser.pl --ignore-commands=03,18,19 your_log.log
Default ignored commands (when using -i with no arguments):
  • RAD_TMC_REQUEST / RAD_TMC_RESPONSE - Radio traffic data
  • TEL_TELEMATICS_LOCATION / TEL_TELEMATICS_COORDINATES - GPS data
  • RAD_BMW_ASSIST_DATA / TEL_BMW_ASSIST_DATA - Telematics
  • GM_RLS_STATUS / LCM_RLS_STATUS - Rain/light sensor
  • IKE_BROADCAST_SPEED_RPM_UPDATE - Speed/RPM (very frequent)
  • IKE_BROADCAST_TEMP_UPDATE - Temperature updates
  • LCM_BROADCAST_INSTRUMENT_BACKLIGHTING - Lighting status
  • LCM_BROADCAST_INDICATORS_RESP - Turn signals
  • GM_BROADCAST_DOORS_STATUS_RESP - Door status
  • IKE_BROADCAST_SENSOR_RESP - Sensor data
  • RAD_BROADCAST_STATUS_RESP - Radio status
  • BC127_AVRCP_MEDIA_RESPONSE - Media metadata
--ignore-device
string
Ignore messages from specific I-Bus devices (comma-separated)
# Ignore by device name
./log_parser.pl --ignore-device=RAD,CDC your_log.log

# Ignore by hex address  
./log_parser.pl --ignore-device=68,18 your_log.log

Advanced examples

You can parse logs in real-time as they’re generated:
# 1. Start screen with logging
screen -L /dev/tty.usbserial-XXXXXXXX 115200

# 2. In another terminal, enable instant flush
screen -r -x -p0 -X logfile flush 0

# 3. Watch live parsed logs
tail -f screenlog.0 | ./log_parser.pl -
The - argument tells the parser to read from stdin (pipe input)
# Find all messages to/from GT (Graphics Terminal)
./log_parser.pl your_log.log | grep -a --context=5 ' -> GT'

# Find all messages from IKE (Instrument Cluster)
./log_parser.pl your_log.log | grep -a 'IKE ->'

# Find broadcast messages
./log_parser.pl your_log.log | grep -a ' B '
# Show only Bluetooth events
./log_parser.pl your_log.log | grep -a 'BT\|BBUS'

# Find pairing and connection events
./log_parser.pl your_log.log | grep -Ei 'pair|connect|disconnect|open'

# Track A2DP audio connection
./log_parser.pl your_log.log | grep -a 'A2DP'
# Show only errors and warnings
./log_parser.pl your_log.log | grep -Ei 'error|warning|fail'

# Count error types
./log_parser.pl your_log.log | grep 'ERROR' | sort | uniq -c

# Find I-Bus errors with context
./log_parser.pl your_log.log | grep -a --context=10 'IBus.*ERROR'

Understanding parsed output

Output format

[timestamp] (local_time) S B SRC  -> DST  CMD_HEX COMMAND_NAME (parsed_data)
Where:
  • timestamp - Milliseconds since startup
  • local_time - Real time from vehicle clock (if available)
  • S - Self marker (* = message sent by BlueBus, = received)
  • B - Broadcast marker (B = broadcast message, = direct)
  • SRC - Source device (e.g., IKE, RAD, GT, BBUS)
  • DST - Destination device
  • CMD_HEX - Command ID in hex
  • COMMAND_NAME - Human-readable command name
  • parsed_data - Decoded parameters and values

Example output

 0: 0:00:00.000          *   BBUS -> RAD  06 RAD_CDC_REQUEST (command=CD_CHANGE)
 1: 0:00:00.010              CDC  -> RAD  39 CDC_RESPONSE (status=STOPPED, audio=STOPPED, ...)
 2: 0:00:00.125          * B IKE  -> GLO  18 IKE_BROADCAST_SPEED_RPM_UPDATE (speed=0 km/h, rpm=0)
 3: 0:00:00.250              GT   -> RAD  48 GT_BUTTON (button=NEXT, state=PRESS)

Statistics mode

When using --stats, the parser generates a report at the end:
./log_parser.pl --stats your_log.log
Statistics include:
  1. Command frequency
    • Count of each command type
    • Average payload size
    • Identifies noisy commands
  2. Device activity
    • Messages sent by each I-Bus device
    • Helps identify chatty modules
Example statistics output:
Count,  Avg sz  of non-ignored commands:
1523    4       IKE_BROADCAST_SPEED_RPM_UPDATE
892     8       GT_BUTTON
234     12      BMBT_DIAL_KNOB
156     0       CDC_REQUEST
89      16      IKE_BROADCAST_SENSOR_RESP

Count   of non-ignored devices sending packets:
1523    IKE
892     GT  
234     BMBT
156     RAD
89      GM
Use statistics mode to identify which I-Bus devices and commands are most active, helping narrow down communication issues.

Decoded I-Bus devices

The log parser recognizes these I-Bus device addresses:
AddressDeviceDescription
00GMBody module
18CDCCD Changer
3BGTGraphics driver (navigation)
44EWSImmobilizer
46CIDCentral information display
50MFLMulti-function steering wheel
5BIHKAHVAC
68RADRadio
6ADSPDigital Sound Processor
80IKEInstrument cluster
C0MIDMulti-info display
C8TELTelephone
D0LCMLight control module
E8RLSRain/light sensor
F0BMBTOn-board monitor
FFLOCLocal (BlueBus)
BFGLOGlobal broadcast

Bluetooth message types

The parser decodes two Bluetooth module types:

BC127 (older modules)

Command format:
[timestamp] (time) * BBUS -> BT   BC127_COMMAND data
[timestamp] (time)   BT   -> BBUS BC127_EVENT_RESPONSE data
Common commands:
  • BC127_LIST - List paired devices
  • BC127_STATUS - Request connection status
  • BC127_MUSIC - Media control (play/pause/next/prev)
  • BC127_AVRCP - Request track metadata

BM83 (newer modules)

Packet format:
[timestamp] (time) * BBUS -> BT   CMD_HEX BM83_CMD_Name (parsed_params)
[timestamp] (time)   BT   -> BBUS EVT_HEX BM83_EVT_Name (parsed_params)
Command examples:
  • BM83_CMD_Music_Control - Playback control
  • BM83_CMD_MMI_Action - Phone actions (accept/reject call)
  • BM83_CMD_Profiles_Link_Back - Reconnect last device
  • BM83_CMD_AVC_Vendor_Dependent_Cmd - AVRCP metadata requests
Event examples:
  • BM83_EVT_BTM_Status - Connection status changes
  • BM83_EVT_Call_Status - Phone call state
  • BM83_EVT_AVC_Specific_Rsp - Metadata responses
  • BM83_EVT_Read_Linked_Device_Information_Reply - Device details

Firmware update tools

BlueBus includes Python-based firmware update utilities.

Console firmware tool

Location: utility/console_firmware_tool.py Usage:
python3 console_firmware_tool.py --port /dev/ttyUSB0 --file firmware.hex
Parameters:
  • --port - Serial port (e.g., /dev/ttyUSB0, COM3)
  • --file - Firmware hex file to flash
  • --bt-mode - Enter Bluetooth module update mode
  • --read-sn - Read device serial number
  • --read-build - Read firmware build date
Features:
  • Automatic platform detection
  • Flash erase and verification
  • Progress indication
  • Error recovery
Never disconnect power during firmware update. The bootloader will protect against bricking, but interrupted updates must be restarted.

GUI firmware tool

Location: utility/gui_firmware_tool.py Features:
  • Graphical interface for firmware updates
  • Automatic serial port detection
  • Progress bar with status updates
  • Platform compatibility verification
Requirements:
pip install pyserial intelhex tk-tools
Supported bootloaders:
  • BLUEBUS_BOOTLOADER_1_3 through 2_3
  • Automatic version detection

Update process

  1. Enter bootloader mode
    • Connect BlueBus via USB
    • Power on with ignition
    • Device should identify as bootloader
  2. Platform detection
    • Tool sends PROTOCOL_CMD_PLATFORM_REQUEST
    • Bootloader responds with version
    • Compatibility verified
  3. Flash erase
    • Application memory erased (0x1800 to 0xAA800)
    • Bootloader memory protected
    • Takes ~10 seconds
  4. Write firmware
    • Firmware written in 246-byte chunks
    • Each packet acknowledged
    • Checksum verified
  5. Start application
    • Bootloader jumps to application code
    • BlueBus boots normally
The bootloader always remains functional, allowing recovery from failed firmware updates.

Serial debugging

You can connect directly to BlueBus for live debugging.

Connection settings

  • Baud rate: 115200
  • Data bits: 8
  • Parity: None (or Odd for bootloader)
  • Stop bits: 1
  • Flow control: None

Terminal software

screen /dev/ttyUSB0 115200

Debug log levels

BlueBus outputs these log levels:
  • DEBUG - Detailed I-Bus and Bluetooth packet traces
  • INFO - Status messages and state changes
  • WARNING - Non-critical issues (retryable errors)
  • ERROR - Critical failures requiring attention

Enabling debug logging

Log verbosity is controlled via EEPROM settings:
// Log sources (can be enabled/disabled individually)
LOG_SOURCE_SYSTEM    // System events
LOG_SOURCE_IBUS      // I-Bus messages
LOG_SOURCE_BT        // Bluetooth events  
LOG_SOURCE_UI        // UI updates
Access via: Settings > System > Debug Logging
Enable only the log sources you need. Excessive logging can impact performance and make finding relevant information difficult.

Common log patterns

Normal operation

[100] INFO: System: BlueBus v1.x.x starting
[150] DEBUG: IBus: Detected GT Version: MKIV
[200] INFO: BT: Module ready
[250] DEBUG: BT: Power state: ON
[500] DEBUG: IBus: IKE -> Ignition: POS_2
[1000] INFO: BT: Device connected
[1050] DEBUG: BT: A2DP link opened
[1100] DEBUG: BT: AVRCP link opened

Bluetooth connection

[1000] DEBUG: BT: Link back to last device
[1200] INFO: BT: Device connected - MAC: XXXXXXXXXXXX
[1250] DEBUG: BT: HFP profile opened
[1300] DEBUG: BT: A2DP profile opened  
[1350] DEBUG: BT: AVRCP profile opened
[1400] INFO: Handler: Device fully connected

Profile error recovery

[5000] WARNING: BT: OPEN_ERROR AVRCP
[5001] INFO: Handler: Set pairing error for AVRCP
[10000] DEBUG: Handler: Resolve pairing error
[10100] INFO: BT: Retry AVRCP connection
[12000] DEBUG: BT: AVRCP profile opened
[12001] INFO: Handler: Pairing error resolved

I-Bus error

[50000] ERROR: IBus: RX Invalid Length [45 - 0x2D]: 68 05 FF 2A 01 ...
[50001] DEBUG: IBus: Buffer reset
[50100] DEBUG: IBus: Normal operation resumed

Generating diagnostic reports

When reporting issues, include:
  1. Hardware information
    • BlueBus hardware version
    • Bluetooth module type (BC127/BM83)
    • Vehicle make/model/year
    • Display type (BMBT/MID/CD53)
  2. Firmware version
    • Application version
    • Bootloader version
    • Build date
  3. Parsed logs
    # Generate comprehensive diagnostic log
    ./log_parser.pl --time --stats raw_log.log > diagnostic_report.txt
    
  4. Configuration settings
    • Audio settings (DAC gain, DSP mode)
    • Bluetooth settings
    • UI preferences
  5. Problem description
    • When issue occurs (startup, during operation, specific trigger)
    • Frequency (always, intermittent, once)
    • Steps to reproduce
Sanitize logs before sharing publicly - they may contain paired device MAC addresses and phone numbers from caller ID.

Build docs developers (and LLMs) love