Skip to content

bitaxeorg/BAP-GT-TOUCH

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

45 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Bitaxe GT Touch - 4.3" LCD Display with Touch Interface

ESP32-S3 ST7701 GT911 LVGL ESP-IDF

A sophisticated touchscreen display addon for Bitaxe miners, featuring a 4.3-inch ST7701 RGB LCD with GT911 capacitive touch controller. This is the first official addon to utilize the Bitaxe Accessory Port (BAP) for seamless integration with Bitaxe hardware.

🌟 Key Features

  • 4.3" High-Resolution Display: 800x480 RGB LCD with ST7701 controller
  • Capacitive Touch Interface: GT911 multi-touch controller for intuitive navigation
  • BAP Integration: First-class support for the new Bitaxe Accessory Port protocol
  • Real-time Mining Dashboard: Live hashrate, temperature, power consumption monitoring
  • Advanced Brightness Control: PWM-based backlight with TPS61161 driver (0-100% range)
  • WiFi Configuration: Touch-friendly network setup interface
  • Settings Management: Hardware configuration, display preferences, mining parameters
  • Smooth UI: LVGL-powered interface with custom fonts and graphics
  • Power Efficient: Optimized for continuous operation with mining hardware

πŸ”§ Hardware Specifications

Display Module

  • LCD Controller: ST7701 (RGB 16-bit interface)
  • Touch Controller: GT911 (I2C capacitive touch)
  • Resolution: 800x480 pixels
  • Size: 4.3 inches diagonal
  • Color Depth: 16-bit RGB565
  • Backlight: PWM-controlled via TPS61161 driver
  • Viewing Angle: 170Β° (H) / 170Β° (V)

Microcontroller

  • Chip: ESP32-S3R8 (8MB PSRAM)
  • CPU: Dual-core Xtensa LX7 @ 240MHz
  • Flash: 8MB
  • RAM: 512KB + 8MB PSRAM
  • WiFi: 802.11 b/g/n 2.4GHz
  • GPIO: Dedicated pins for RGB interface and touch I2C

Connectivity

  • Primary: Bitaxe Accessory Port (BAP) via UART
  • Secondary: I2C for touch controller
  • Wireless: WiFi for network configuration

πŸ“‹ Pin Configuration

RGB LCD Interface (ST7701)

Data Pins:    GPIO14, GPIO38, GPIO18, GPIO17, GPIO10, GPIO39, 
              GPIO0, GPIO45, GPIO48, GPIO47, GPIO21, GPIO1, 
              GPIO2, GPIO42, GPIO41, GPIO40
Control Pins: PCLK(GPIO7), HSYNC(GPIO46), VSYNC(GPIO3), DE(GPIO5)
Power:        DISP_EN(GPIO12), BL_PWM(GPIO15)
Reset:        RST(GPIO13)

Touch Interface (GT911)

I2C:          SDA(GPIO8), SCL(GPIO9)
I2C Speed:    400kHz
Address:      0x5D (default)

BAP Communication

UART:         Standard ESP32-S3 UART pins (configured in bap_uart.h)
Protocol:     Custom BAP protocol for Bitaxe communication

πŸš€ Getting Started

Prerequisites

  • ESP-IDF 5.4.1: Installation Guide
  • Compatible Bitaxe: Any Bitaxe model with BAP support
  • Hardware: Assembled Bitaxe GT Touch display module

Quick Start

  1. Clone the repository:

    git clone https://github.com/bitaxeorg/BAP-GT-TOUCH.git
    cd 4.3LCD-ST7262-GT911
  2. Set ESP32-S3 target:

    idf.py set-target esp32s3
  3. Configure the project:

    idf.py menuconfig

    Navigate to Example Configuration for display and touch settings.

  4. Build and flash:

    idf.py build flash monitor
  5. First boot: The device will show a loading screen followed by the main dashboard.

πŸ–₯️ User Interface

Main Dashboard (home.c)

The primary screen displays real-time mining information:

  • Hashrate Display: Current mining speed with trend indicators
  • Temperature Monitoring: ASIC and ambient temperature readings
  • Power Consumption: Real-time power usage and efficiency metrics
  • Pool Status: Connection status and mining pool information
  • Hardware Info: Device model, ASIC type, fan speed
  • Navigation Cards: Touch-friendly access to all features

Settings Interface (settings.c)

Comprehensive configuration options:

  • Display Settings: Brightness control (0-100%), screen timeout
  • Mining Parameters: Frequency, voltage, fan control
  • Network Config: WiFi SSID/password setup
  • Hardware Control: ASIC voltage, automatic fan control
  • System Info: Firmware version, hardware details

WiFi Setup (wifi.c)

Touch-optimized network configuration:

  • Network Scanning: Automatic WiFi network detection
  • Password Entry: On-screen keyboard for credentials
  • Connection Status: Real-time connection feedback
  • Signal Strength: Visual indicator for network quality

Night Mode

Night friendly mode with reduced brightness and eye-friendly colors

  • Hashrate: Live hashrate over the past 5 minutes.

πŸ”Œ BAP Protocol Integration

Bitaxe Accessory Port (BAP)

This project implements the complete BAP protocol stack:

  • bap_protocol.c/h: Core protocol implementation
  • bap_client.c/h: High-level client interface
  • bap_parser.c/h: Message parsing and validation
  • bap_uart.c/h: UART communication layer

Available BAP Commands

// Subscription to real-time data
bap_client_subscribe("hashRate");
bap_client_subscribe("temperature");
bap_client_subscribe("power");

// Configuration commands
bap_client_send_frequency_setting(500.0);  // Set frequency in MHz
bap_client_send_fan_speed(75);             // Set fan speed (0-100%)
bap_client_send_asic_voltage(1200);        // Set ASIC voltage in mV

// Network configuration
bap_client_send_ssid("MyNetwork");
bap_client_send_password("MyPassword");

// System requests
bap_client_request("systemInfo");
bap_client_request("poolInfo");

Connection Management

// Check BAP connection status
bool connected = bap_client_is_connected();

// Reset connection on failure
if (!connected) {
    bap_client_reset_connection_state();
}

πŸ’‘ Advanced Features

Brightness Control System

Sophisticated PWM-based brightness control using TPS61161 driver:

// Set brightness (0-100%)
lcd_backlight_set_brightness(75);

// Smooth fade transitions
lcd_backlight_fade_to(50, 2000);  // Fade to 50% over 2 seconds

// Get current brightness
uint8_t current = lcd_backlight_get_brightness();

Technical Details:

  • PWM Frequency: 25kHz (optimal for TPS61161)
  • Resolution: 10-bit (1024 levels)
  • Hardware: GPIO15 β†’ TPS61161 CTRL pin
  • Display Enable: GPIO12 (always HIGH)

Custom Font System

Multiple custom fonts included:

  • Nevan_RUS_96: Large display font for primary metrics
  • angelwish_16/24/36/48/96: Stylized fonts for UI elements
  • untyped_96: Monospace font for technical data

Touch Interface

GT911 capacitive touch controller features:

  • Multi-touch Support: Up to 5 simultaneous touch points
  • Touch Gestures: Tap, swipe, pinch detection
  • Calibration: Automatic touch calibration on startup
  • Responsiveness: Sub-10ms touch response time

πŸ”§ Development & Customization

Project Structure

β”œβ”€β”€ main/                      # Application source code
β”‚   β”œβ”€β”€ main.c                # Application entry point
β”‚   β”œβ”€β”€ home.c/h              # Main dashboard UI
β”‚   β”œβ”€β”€ settings.c/h          # Settings interface
β”‚   β”œβ”€β”€ wifi.c/h              # WiFi configuration
β”‚   β”œβ”€β”€ loading.c/h           # Boot loading screen
β”‚   β”œβ”€β”€ night.c/h             # Night hashrate screen
β”‚   β”œβ”€β”€ bap_*.c/h             # BAP protocol implementation
β”‚   β”œβ”€β”€ waveshare_rgb_lcd_port.c/h  # LCD/touch drivers
β”‚   β”œβ”€β”€ lvgl_port.c/h         # LVGL porting layer
β”‚   β”œβ”€β”€ assets/               # Images and icons
β”‚   └── *.c                   # Custom font files
β”œβ”€β”€ components/               # ESP-IDF components
β”‚   β”œβ”€β”€ lvgl__lvgl/          # LVGL graphics library
β”‚   β”œβ”€β”€ espressif__esp_lcd_touch/  # Touch driver
β”‚   └── espressif__esp_lcd_touch_gt911/  # GT911 specific
β”œβ”€β”€ CMakeLists.txt           # Build configuration
β”œβ”€β”€ sdkconfig.defaults       # Default ESP-IDF configuration
└── partitions.csv          # Flash partition table

Adding Custom Screens

  1. Create new .c/.h files in main/
  2. Implement LVGL UI creation functions
  3. Add screen navigation in home.c event handlers
  4. Update CMakeLists.txt if needed

Modifying BAP Protocol

  1. Extend bap_protocol.h with new commands
  2. Implement handlers in bap_parser.c
  3. Add client functions in bap_client.c
  4. Update UI to use new BAP features

πŸ” Troubleshooting

Display Issues

Problem: Screen not visible

  • Check power connections (3.3V, GND)
  • Verify GPIO12 is HIGH for display enable
  • Ensure RGB data pins are correctly connected

Problem: Display artifacts or incorrect colors

  • Check RGB data pin connections (GPIO14-40)
  • Verify PCLK, HSYNC, VSYNC, DE signals
  • Review pixel clock timing in configuration

Touch Problems

Problem: Touch not responding

  • Check I2C connections (GPIO8-SDA, GPIO9-SCL)
  • Verify GT911 power supply (3.3V)
  • Monitor I2C communication for errors

Problem: Inaccurate touch coordinates

  • Ensure display orientation matches touch config
  • Check for electrical interference near touch sensor
  • Verify GT911 firmware version compatibility

BAP Communication

Problem: No data from Bitaxe

  • Check UART connections to BAP port
  • Verify Bitaxe has BAP support enabled
  • Monitor UART traffic for protocol errors
  • Ensure matching baud rates

Problem: Connection drops frequently

  • Check cable integrity and connections
  • Verify power supply stability
  • Monitor for electromagnetic interference

Build Issues

Problem: Compilation errors

  • Ensure ESP-IDF 5.4.1 is properly installed
  • Run idf.py clean before rebuilding
  • Check all submodules are properly initialized

Problem: Flash/upload failures

  • Verify ESP32-S3 target is set correctly
  • Check USB connection and drivers
  • Ensure sufficient flash partition sizes

πŸ“Š Performance Specifications

System Performance

  • Boot Time: ~3-5 seconds to dashboard
  • Touch Response: <10ms latency
  • BAP Update Rate: 1-5 Hz (configurable)
  • Screen Refresh: 60 FPS (limited by LCD)
  • Power Consumption: ~200-400mA @ 3.3V (varies with brightness)

Memory Usage

  • Flash: ~2-3MB (including LVGL and assets)
  • SRAM: ~100-200KB runtime usage
  • PSRAM: ~1-2MB for display buffers and UI objects

Display Specifications

  • Brightness Range: 0-100% continuous
  • Response Time: 25ms typical
  • Contrast Ratio: 500:1
  • Color Gamut: 16.7M colors (RGB565)

🀝 Contributing

We welcome contributions to the Bitaxe GT Touch project! Here's how you can help:

Bug Reports

  • Use GitHub Issues with detailed reproduction steps
  • Include system information and error logs
  • Provide photos/videos for UI-related issues

Feature Requests

  • Describe the desired functionality clearly
  • Explain the use case and benefits
  • Consider implementation complexity

Code Contributions

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Guidelines

  • Follow existing code style and conventions
  • Test thoroughly on actual hardware
  • Document new features and APIs
  • Ensure BAP protocol compatibility

πŸ“„ License

This project is open source and available under the GPL-V3 License.

πŸ™ Acknowledgments

  • Bitaxe Community: For creating the revolutionary BAP standard
  • Espressif Systems: For the powerful ESP32-S3 platform
  • LVGL Project: For the excellent embedded graphics library
  • Open Source Contributors: For components and inspiration

πŸ“ž Support & Community

  • GitHub Issues: Bug reports and feature requests
  • Bitaxe Community: Join the official Bitaxe Discord/forums
  • Documentation: Check the docs/ folder for detailed guides
  • Examples: See examples/ for usage demonstrations

Bitaxe GT Touch - Bringing professional mining monitoring to your fingertips with the power of the Bitaxe Accessory Port. Built by the community, for the community.

First BAP addon, setting the standard for future Bitaxe accessories.

About

ESP Firmware for the GT-Touch

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •