ESP32 part of esp32-sysmon-* project;
Desktop part of this project - requiered to collect metrics for this display
It is possible, that with changes to source code ESP32's without exact requiered fetures will also work
- Native USB
- Xtensa CPU
- ~4MB flash
ESP32-S3 - without changes to code/build - you can flash right away!
ESP32-S2 - with small changes to Cargo.toml and .cargo/config.toml. These changes will be discussed later in this README. Support is theoretical, not tested
It is possible, that with changes to source code other peripherals will also work
KY-012 active buzzer (optional)
128x160 ST7735 SPI screen
Remark about screen birghtness
I have built this firmware without PWM screen brightness, so brightness is always 100%.
This repository includes STL files for a printable case:
- sysmon.stl - main case body
- st7735s Top.stl - top cover for the ST7735 screen
| Display pin | ESP32-S3 pin | Notes |
|---|---|---|
| VCC | 3.3V | Power |
| GND | GND | Ground |
| SCL / SCK | GPIO12 | SPI clock |
| SDA / MOSI | GPIO11 | SPI data |
| RES / RST / RESET | GPIO2 | Reset |
| DC / A0 | GPIO7 | Data/command |
| CS | GPIO1 | Chip select |
| BLK / LED | 3.3V | Backlight, if present |
| Buzzer pin | ESP32-S3 pin | Notes |
|---|---|---|
| S | GPIO4 | Signal |
| + / VCC | 3.3V | Power |
| - / GND | GND | Ground |
Note: Release firmware is made only for ESP32-S3 with suggested wiring
If you want to change the firmware to suit your wiring or preferences, you should flash from source
Prerequisites:
espflash
Download latest release
Flash the firmware
espflash write-bin --chip esp32s3 0x0 display.binPrerequisites:
This repository targets ESP32-S3 and uses the esp toolchain declared in rust-toolchain.toml.
Install espup and the Espressif Rust toolchain:
cargo install espup --locked
espup installInstall espflash:
cargo install espflashLinux and macOS: load the environment exported by espup:
. $HOME/export-esp.shDebian/Ubuntu:
sudo apt install llvm-dev libclang-dev clangmacOS:
brew install llvmClone this repository:
git clone https://github.com/c4ff0e/esp32-sysmon-display
cd esp32-sysmon-displayThis project is currently configured for ESP32-S3 in .cargo/config.toml.
Build, flash, and open the serial monitor:
cargo run --releaseBuild only:
cargo build --releaseBuild and generate release image:
cargo build --release
espflash save-image --chip esp32s3 --merge target/xtensa-esp32s3-none-elf/release/display display.binThe release bin file will be generated at project root
If you are using different hardware and/or wiring, or have personal preferences, update the configuration in Cargo.toml, .cargo/config.toml, main.rs, frame_mgr.rs before building.
You need to flash from source to perform these changes
main.rs
Display configuration:
// change frequency if you see visual artifacts
let display_config = Config::default()
.with_frequency(Rate::from_mhz(40))
.with_mode(Mode::_0);
// change GPIO pins to match your wiring
let cs = Output::new(
peripherals.GPIO1, // here
Level::High,
OutputConfig::default()
);
let reset = Output::new(
peripherals.GPIO2, // here
Level::High,
OutputConfig::default()
);
let dc = Output::new(
peripherals.GPIO7, // here
Level::Low,
OutputConfig::default()
);
let spi_bus = Spi::new(peripherals.SPI2, display_config).unwrap()
.with_sck(peripherals.GPIO12) // here
.with_mosi(peripherals.GPIO11); // here
let rgb = true; // set to false if red and blue are swapped
let inverted = false; // set to true if colors look invertedBuzzer configuration:
let mut beeper = Output::new(
peripherals.GPIO4, // change this GPIO pin to match your wiring
Level::Low,
OutputConfig::default(),
);
// if you don't want to hear beeps at all, or you don't have a buzzer, change both values to false
const BEEP_ON_UNSUPPORTED: bool = true; // unsupported desktop hardware detected
const BEEP_ON_FAILURES: bool = true; // server unavailable or wrong USB portYou need to flash from source to perform these changes
To flash this firmware to ESP32-S2 change all contents of Cargo.toml to this:
[package]
edition = "2024"
name = "display"
rust-version = "1.88"
version = "1.0.0"
[[bin]]
name = "display"
path = "./src/bin/main.rs"
[dependencies]
esp-hal = { version = "~1.0", features = ["esp32s2", "log-04", "unstable"] }
esp-bootloader-esp-idf = { version = "0.4.0", features = ["esp32s2", "log-04"] }
log = "0.4.27"
critical-section = "1.2.0"
esp-backtrace = { version = "0.18.1", features = [
"esp32s2",
"panic-handler",
"println",
] }
esp-println = { version = "0.16.1", features = ["esp32s2", "log-04"] }
usb-device = "0.3.2"
usbd-serial = "0.2.2"
postcard = {version = "1.1.3", default-features = false}
serde = { version = "1.0.188", default-features = false, features = ["derive"] }
heapless = {version = "0.9.2", features = ["serde"]}
st7735-lcd ="0.10.0"
embedded-graphics = "0.8.2"
embedded-hal-bus = "0.3.0"
profont = "0.7.0"
[profile.dev]
# Rust debug is too slow.
# For debug builds always builds with some optimization
opt-level = "s"
[profile.release]
codegen-units = 1 # LLVM can perform better optimizations using a single thread
debug = 2
debug-assertions = false
incremental = false
lto = 'fat'
opt-level = 's'
overflow-checks = false[target.xtensa-esp32s2-none-elf]
runner = "espflash flash --monitor --chip esp32s2"
[env]
ESP_LOG="info"
[build]
rustflags = [
"-C", "link-arg=-nostartfiles",
]
target = "xtensa-esp32s2-none-elf"
[unstable]
build-std = ["core"]Metric panel appearance is defined in frame_mgr.rs.
You can adjust:
- CPU, GPU, and RAM border colors and enable fill
- text colors
- font styles
Example:
const CPU_TEXT_STYLE: MonoTextStyle<'_, Rgb565> =
MonoTextStyle::new(&PROFONT_12_POINT, Rgb565::CSS_STEEL_BLUE);
// you can change text color and font sizeYou are connected to COM port
Switch port
You have connected device to the wrong USB port, if there are two of them. Connect device to the other port.
Your [something] is unsupported
Server has reported that something from your desktop hardware is not supported by it. Display will continue to work, but unsupported hardware metrics will not be shown.
No data
Check server
Desktop server didn't send any metrics/metrics are stale. Check whether it crashed/exited/lost connection or using the wrong port.
