Skip to content

t-ogura/prospector-zmk-module

Β 
Β 

Repository files navigation

Prospector ZMK Module

Version: 1.1.0
License: MIT
Status: Stable Release

License: MIT ZMK Compatible Version

Prospector ZMK Module provides advanced status monitoring capabilities for ZMK keyboards, enabling real-time BLE advertisement of keyboard status and professional scanner-based display functionality.

πŸš€ For End Users - Start Here!

⚠️ This is a ZMK module - you need the complete scanner configuration!

πŸ‘‰ Go to the main project: zmk-config-prospector

The main repository contains:

  • βœ… Complete scanner firmware with automated GitHub Actions builds
  • βœ… Step-by-step setup guide for keyboards and scanner devices
  • βœ… Hardware wiring diagrams and component specifications
  • βœ… Configuration examples for all keyboard types (split, regular, etc.)
  • βœ… Troubleshooting guide and comprehensive user documentation

πŸ“¦ What's Included

πŸ–₯️ Scanner Mode Components

  • Status Advertisement: BLE broadcasting system for keyboard status
  • Scanner Display: Independent status monitor with YADS-style UI
  • Multi-Keyboard Support: Monitor multiple keyboards simultaneously
  • Professional Widgets: Battery, layer, modifier, and connection status

πŸ”Œ Dongle Mode Components (Legacy)

  • Traditional Dongle: Keyboard β†’ Dongle β†’ PC connectivity
  • Basic Status Display: Layer roller and peripheral information
  • Legacy Support: Compatible with original Prospector hardware

πŸ—οΈ Architecture

Scanner Mode (Current - Recommended)

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    BLE Advertisement    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚             β”‚ ─────────────────────→ β”‚   Prospector     β”‚
β”‚  Keyboard   β”‚    26-byte Protocol    β”‚   Scanner        β”‚
β”‚             β”‚                        β”‚   (USB Powered)  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
       β”‚
       β”œβ”€β”€ PC (BLE/USB)
       β”œβ”€β”€ Tablet 
       β”œβ”€β”€ Phone
       └── ... (up to 5 devices)

Dongle Mode (Legacy)

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    BLE Connection    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    USB/BLE    β”Œβ”€β”€β”€β”€β”€β”
β”‚  Keyboard   β”‚ ──────────────────→ β”‚   Prospector     β”‚ ──────────→ β”‚ PC  β”‚
β”‚ (Peripheral)β”‚                      β”‚   Dongle         β”‚              β””β”€β”€β”€β”€β”€β”˜
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                      β”‚  (Central)       β”‚
                                     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸš€ Quick Start

For Scanner Mode

1. Add to Your Keyboard

Add to your keyboard's config/west.yml:

manifest:
  remotes:
    - name: zmkfirmware
      url-base: https://github.com/zmkfirmware
    - name: prospector
      url-base: https://github.com/t-ogura
  projects:
    - name: zmk
      remote: zmkfirmware
      revision: main
      import: app/west.yml
    - name: prospector-zmk-module
      remote: prospector
      revision: v1.1.0
      path: modules/prospector-zmk-module

Add to your keyboard's .conf file:

# Enable status advertisement
CONFIG_ZMK_STATUS_ADVERTISEMENT=y
CONFIG_ZMK_STATUS_ADV_KEYBOARD_NAME="MyBoard"

# v1.1.0 enhanced power optimization (15x improvement)
CONFIG_ZMK_STATUS_ADV_ACTIVITY_BASED=y
CONFIG_ZMK_STATUS_ADV_ACTIVE_INTERVAL_MS=100    # 10Hz active
CONFIG_ZMK_STATUS_ADV_IDLE_INTERVAL_MS=30000    # 0.03Hz idle

# Split keyboard support (if applicable)
CONFIG_ZMK_SPLIT_BLE_CENTRAL_BATTERY_LEVEL_FETCHING=y

2. Build Scanner Device

Use the companion repository: zmk-config-prospector

For Dongle Mode (Legacy)

Add to your build.yaml:

include:
  - board: seeeduino_xiao_ble
    shield: [YOUR_KEYBOARD]_dongle prospector_adapter

πŸ“‘ Status Advertisement Protocol

BLE Advertisement Format (26 bytes)

The module broadcasts keyboard status using this efficient protocol:

Bytes Field Description Example
0-1 Manufacturer ID 0xFF 0xFF (Local use) FF FF
2-3 Service UUID 0xAB 0xCD (Prospector) AB CD
4 Protocol Version Current: 0x01 01
5 Battery Level 0-100% (main/central) 5A (90%)
6 Active Layer Current layer 0-15 02 (Layer 2)
7 Profile Slot BLE profile 0-4 01
8 Connection Count Connected devices 0-5 03
9 Status Flags USB/BLE/Caps/Charging 05
10 Device Role Split role indicator 01 (Central)
11 Device Index Split device index 00
12-14 Peripheral Batteries Left/Right/Aux levels 52 00 00
15-20 Layer Name Layer identifier 4C3000...
21-24 Keyboard ID Hash of keyboard name 12345678
25 Modifier Flags CSAG key states 05

Status Flags (Byte 9)

Bit 0: USB HID Ready
Bit 1: BLE Connected
Bit 2: BLE Bonded  
Bit 3: Caps Word Active
Bit 4: Charging Status
Bit 5-7: Reserved

Modifier Flags (Byte 25)

Bit 0/4: Left/Right Ctrl
Bit 1/5: Left/Right Shift
Bit 2/6: Left/Right Alt
Bit 3/7: Left/Right GUI

🎨 Display Features

YADS-Style UI Components

Battery Widget

  • Color Coding: Green (>60%), Yellow (20-60%), Red (<20%)
  • Split Support: Shows both central and peripheral battery levels
  • Visual Bar: Animated progress indicator

Layer Widget

  • Pastel Colors: Each layer has unique color identity
  • Large Numbers: Easy-to-read layer indicators (0-6)
  • Active Highlighting: Current layer prominently displayed
  • Inactive Dimming: Non-active layers in consistent gray

Modifier Widget

  • NerdFont Symbols: Professional modifier key icons
    • Ctrl: 󰘴, Shift: 󰘢, Alt: 󰘡, GUI: 󰘳
  • Real-time Updates: Instant modifier state changes
  • Multiple Key Support: Shows multiple active modifiers

Connection Widget

  • USB Status: Red (not ready) / White (ready)
  • BLE Status: Green (connected) / Blue (bonded) / White (open)
  • Profile Display: Shows active BLE profile (0-4)
  • Multi-Device: Indicates total connected device count

βš™οΈ Configuration Options

Advertisement Settings

# Basic configuration
CONFIG_ZMK_STATUS_ADVERTISEMENT=y
CONFIG_ZMK_STATUS_ADV_KEYBOARD_NAME="YourBoard"  # Keyboard identifier (any length)

# Power management
CONFIG_ZMK_STATUS_ADV_ACTIVITY_BASED=y
CONFIG_ZMK_STATUS_ADV_ACTIVE_INTERVAL_MS=200
CONFIG_ZMK_STATUS_ADV_IDLE_INTERVAL_MS=1000
CONFIG_ZMK_STATUS_ADV_ACTIVITY_TIMEOUT_MS=2000

# Split keyboard support
CONFIG_ZMK_SPLIT_BLE_CENTRAL_BATTERY_LEVEL_FETCHING=y

Scanner Device Settings

# Core scanner features
CONFIG_PROSPECTOR_MODE_SCANNER=y
CONFIG_PROSPECTOR_MAX_KEYBOARDS=2
CONFIG_PROSPECTOR_USE_AMBIENT_LIGHT_SENSOR=y

# Display customization
CONFIG_PROSPECTOR_FIXED_BRIGHTNESS=80
CONFIG_PROSPECTOR_ROTATE_DISPLAY_180=n

# Font support
CONFIG_LV_FONT_MONTSERRAT_18=y
CONFIG_LV_FONT_MONTSERRAT_28=y
CONFIG_LV_FONT_UNSCII_16=y

Legacy Dongle Settings

CONFIG_PROSPECTOR_USE_AMBIENT_LIGHT_SENSOR=y
CONFIG_PROSPECTOR_FIXED_BRIGHTNESS=50
CONFIG_PROSPECTOR_LAYER_ROLLER_ALL_CAPS=n

πŸ”‹ Power Management

Activity-Based Broadcasting

The module implements intelligent power management:

  • Active Mode: 5Hz (200ms) during typing for instant responsiveness
  • Idle Mode: 1Hz (1000ms) after 2 seconds of inactivity
  • Automatic Transitions: Seamless switching based on keyboard activity
  • Power Impact: ~25% increase in keyboard battery consumption

Implementation

// Automatic interval adjustment based on activity
static void update_advertisement_interval(bool active) {
    if (active) {
        // High frequency for immediate response
        schedule_next_update(CONFIG_ZMK_STATUS_ADV_ACTIVE_INTERVAL_MS);
    } else {
        // Lower frequency for battery conservation
        schedule_next_update(CONFIG_ZMK_STATUS_ADV_IDLE_INTERVAL_MS);
    }
}

πŸ› οΈ Hardware Support

Supported Boards

  • Seeeduino XIAO BLE (nRF52840) - Primary target
  • nice!nano v2 (nRF52840) - Compatible
  • Other nRF52840 boards - Should work with proper pin configuration

Display Compatibility

  • ST7789V (240x280) - Primary support
  • ILI9341 (320x240) - Legacy support
  • Custom displays - Possible with driver modifications

Sensor Support

  • APDS9960 - Ambient light sensor for auto-brightness
  • Optional sensors - Extensible architecture for additional sensors

πŸ§ͺ Development

Building Locally

# Clone the module
git clone https://github.com/t-ogura/prospector-zmk-module
cd prospector-zmk-module

# Test scanner build
west init -l test/scanner_build_test
west update
west build -s zmk/app -b seeeduino_xiao_ble -- -DSHIELD=prospector_scanner

# Test dongle build
west build -s zmk/app -b seeeduino_xiao_ble -- -DSHIELD=corne_dongle_prospector_adapter

Module Structure

prospector-zmk-module/
β”œβ”€β”€ boards/shields/
β”‚   β”œβ”€β”€ prospector_scanner/        # Scanner mode implementation
β”‚   β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”‚   β”œβ”€β”€ scanner_display.c         # Main display logic
β”‚   β”‚   β”‚   β”œβ”€β”€ scanner_battery_widget.c  # Battery visualization
β”‚   β”‚   β”‚   β”œβ”€β”€ connection_status_widget.c # USB/BLE status
β”‚   β”‚   β”‚   β”œβ”€β”€ layer_status_widget.c     # Layer indicators
β”‚   β”‚   β”‚   β”œβ”€β”€ modifier_status_widget.c  # Modifier keys
β”‚   β”‚   β”‚   └── brightness_control.c      # Auto-brightness
β”‚   β”‚   └── fonts/
β”‚   β”‚       β”œβ”€β”€ NerdFonts_Regular_20.c    # Modifier symbols
β”‚   β”‚       └── NerdFonts_Regular_40.c    # Large modifier symbols
β”‚   └── prospector_adapter/        # Legacy dongle mode
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ status_advertisement.c     # BLE broadcasting
β”‚   └── status_scanner.c          # Advertisement reception
β”œβ”€β”€ include/zmk/
β”‚   β”œβ”€β”€ status_advertisement.h
β”‚   └── status_scanner.h
└── Kconfig                        # Configuration options

API Reference

Advertisement API

// Initialize status advertisement
int zmk_status_advertisement_init(void);

// Start broadcasting
int zmk_status_advertisement_start(void);

// Update keyboard status
int zmk_status_advertisement_update(void);

Scanner API

// Initialize scanner
int zmk_status_scanner_init(void);

// Start scanning for advertisements
int zmk_status_scanner_start(void);

// Register event callback
int zmk_status_scanner_register_callback(zmk_status_scanner_callback_t callback);

// Get keyboard status
struct zmk_keyboard_status *zmk_status_scanner_get_keyboard(int index);

πŸ› Debugging

Common Issues

Build Errors

  • Font not found: Enable required fonts in config
  • Shield not found: Check module path in west.yml
  • Kconfig errors: Verify option names and values

Runtime Issues

  • No advertisement: Check CONFIG_ZMK_STATUS_ADVERTISEMENT=y
  • Scanner not detecting: Verify BLE advertisement is working
  • Display blank: Check display wiring and power

Debug Tools

BLE Verification

# Use nRF Connect app to verify advertisements
# Look for manufacturer data: FF FF AB CD ...

Logging

# Enable detailed logging
CONFIG_LOG=y
CONFIG_ZMK_LOG_LEVEL_DBG=y

🧾 Credits and Attribution

Original Inspiration

This project builds upon the innovative Prospector hardware platform:

  • Original Prospector Project: prospector by carrefinho
  • Original Firmware: prospector-zmk-module
  • Hardware Design: Seeeduino XIAO BLE + Waveshare 1.69" Round LCD concept
  • Community: ZMK ecosystem contributors and hardware designers

Key Third-Party Integrations

YADS (Yet Another Dongle Screen)

  • License: MIT License
  • Source: zmk-dongle-screen
  • Attribution: UI widget design patterns, NerdFont modifier symbols, LVGL implementation inspiration
  • Usage: Professional display widget architecture

ZMK Firmware Framework

  • License: MIT License
  • Source: ZMK Project
  • Usage: Core firmware platform, BLE APIs, configuration system

NerdFonts

  • License: MIT License
  • Source: NerdFonts
  • Usage: Modifier key symbols (󰘴󰘢󰘡󰘳)

Development Attribution

  • Lead Development: OpenAI Claude (Sonnet)
  • Hardware Integration: Community feedback and real hardware testing
  • Documentation: Comprehensive user guides and technical specifications

Font Licenses

  • Montserrat: SIL Open Font License 1.1
  • Unscii: Public Domain

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

Disclaimer

This project is an independent development that evolved from hardware concepts in the broader ZMK/Prospector ecosystem. While inspired by existing work, the software implementation, features, and documentation represent significant original development efforts.

🀝 Contributing

Contributions welcome! Areas for improvement:

  • New widgets: Additional status displays
  • Hardware support: More boards and displays
  • Protocol extensions: Enhanced data formats
  • Power optimizations: Better battery management
  • UI improvements: Themes and customization

Development Process

  1. Fork the repository
  2. Create feature branch
  3. Test thoroughly
  4. Submit pull request
  5. Follow code review process

πŸ“ž Support


Prospector ZMK Module - Professional status display for ZMK keyboards.

Built with ❀️ for the ZMK community.

About

ZMK module for the Prospector dongle

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 99.8%
  • CMake 0.2%