This document explains how to debug screenILI, interpret log output, and diagnose common hardware and software issues.
screenILI includes a lightweight built-in logger integrated into the
high-level Display class.
Logging is optional and disabled by default beyond warnings.
display.set_debug_level("debug")| Level | Description |
|---|---|
debug |
Very verbose, logs most operations |
info |
High-level operations (draw calls, images, text) |
warn |
Warnings only (default) |
error |
Critical failures |
none |
Completely silent |
Check current level:
display.get_debug_level()Logs are printed to the serial console:
[ILI9488][INFO] rect {'x': 10, 'y': 10, 'w': 100, 'h': 50, 'color': 65535}
Format:
[ILI9488][LEVEL] message {optional data}
Use when:
- Display does not respond
- Coordinates seem wrong
- Investigating drawing order
⚠ Very verbose and slower.
Use when:
- Verifying drawing logic
- Debugging UI layout
Use for:
- Normal development
- Catching out-of-bounds or misuse
Use when:
- Display fails to initialize
- SPI errors occur
Possible causes:
- Incorrect wiring (
CS,DC,RST) - SPI clock too high
- Wrong SPI bus
Actions:
display.set_debug_level("debug")- Verify
init:startandinit:donemessages - Lower
baudrate(e.g.40_000_000)
Possible causes:
- Image not RGB565
- Byte order incorrect
- Passing RGB tuples instead of
color565()
Check:
display.fill(color565(255, 0, 0))If red is not red → wiring or panel issue.
Cause:
- Width/height mismatch
- Wrong rotation assumptions
Fix:
- Always use
display.width/display.height - Avoid hardcoded values
Cause:
- Scroll region misconfigured
Fix:
display.set_scroll(0, 0)
display.scroll(0)Reset state before testing again.
Cause:
- SPI was deinitialized
Fix:
- Recreate the
Displayinstance - Or pass an externally managed SPI object
Checklist:
- File size =
width × height × 2 - No headers
- RGB565, big-endian
Test with known-good image first.
display.set_debug_level("debug")
display.fill(color565(255, 0, 0))
display.fill(color565(0, 255, 0))
display.fill(color565(0, 0, 255))
display.text8x8(10, 10, "DEBUG", color565(255,255,255))If this fails, the issue is not your application logic.
- Some displays require delays after reset
- Some backlights stay on even when display is off
- Poor wires = flaky SPI
When opening an issue, include:
- Board model
- Display model/link
- MicroPython or CircuitPython version
- SPI wiring
- Debug logs (
debuglevel)
- Enable logging early
- Start with simple fills
- Trust hardware scroll and rotation
- Reset state before deep debugging