Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 

Repository files navigation

Buy me a cofee: https://ko-fi.com/noscoding

Pico2Fetch

PicoFetch is a high-performance system monitoring solution designed for the Raspberry Pi Pico and the Waveshare 1.3" LCD (240x240). It leverages the fastfetch utility to capture comprehensive host metrics and streams them over a serial connection to a dedicated hardware dashboard.

Overview

The system consists of two primary components:

  1. Host Script: A Python-based utility that gathers system data (CPU, RAM, GPU, Battery, and Thermals) using fastfetch and transmits it via USB Serial.
  2. Pico Firmware: A MicroPython-based driver and UI engine that renders the data in real-time across four distinct, selectable themes.

Key Features

  • Real-Time Telemetry: Low-latency monitoring of CPU usage, memory allocation, and GPU performance.
  • Multi-Theme Interface: Integrated UI themes (Terminal, Hacker, macOS, and Windows Light Mode) with specific color palettes and layout behaviors.
  • Hardware Controls: Physical theme cycling using the onboard "Key A" (GP15) button.
  • Thermal & Power Management: Integrated tracking of CPU/GPU temperatures and host battery percentage.
  • Robust Connection Handling: A built-in 15-second watchdog timer that triggers a visual alert upon signal loss.
  • Optimized Rendering: Customized FrameBuffer implementation for the ST7789 driver with instant theme switching.

Hardware Requirements

  • Microcontroller: Raspberry Pi Pico or Pico 2W.
  • Display: Waveshare 1.3" LCD Module (240x240 resolution, ST7789 driver).
  • Host: Linux, macOS, or Windows machine with Python 3.

Installation

1. Host Machine Setup

Ensure fastfetch is installed and accessible via your system PATH.

  1. Install the required Python library:
    pip install pyserial
  2. Launch the host sync utility:
    python host/picofetch_host.py

2. Pico Firmware Setup

  1. Flash the Raspberry Pi Pico with the latest MicroPython firmware.
  2. Upload pico/main.py to the root directory of the Pico.
  3. Reset the Pico or reconnect the USB cable to initiate the monitor.

Usage

  • Switching Themes: Press the physical Key A (GP15) button on the LCD HAT to cycle through the UI modes.
  • Connection Monitoring: The display will automatically show a "OFFLINE" warning if the host script stops transmitting data for more than 15 seconds.

Hardware Pinout (Waveshare 1.3" LCD)

Signal GPIO Function
MOSI 11 SPI Master Out Slave In
SCLK 10 SPI Clock
CS 9 Chip Select (Active Low)
DC 8 Data / Command Control
RST 12 Hardware Reset
BL 13 Backlight Control (PWM)
Key A 15 Theme Selection Button

Technical Implementation

  • Data Protocol: JSON-encoded strings terminated by a newline character.
  • Baud Rate: 115200 bps over USB CDC.
  • Refresh Rate: Metrics are updated every 3 seconds to balance host performance and readability.
  • Color Space: 16-bit RGB565 (Optimized for ST7789).

Troubleshooting

  • No Data Displayed: Verify that fastfetch is installed by running fastfetch -v in your host terminal.
  • Serial Connection Failed: Ensure no other application (like a serial monitor or IDE) is currently occupying the Pico's COM/TTY port.
  • Inverted Colors: The firmware uses 0x21 for display inversion as required by the Waveshare 1.3" ST7789 module.

About

Fetch your system info, send it to Pico, Pico2Fetch is a MicroPython script that works as a system monitor over pyserial and fastfetch.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors