Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ESP32-C6-GEEK Virtual Smart PC

A virtual smart home device using the Waveshare ESP32-C6-GEEK that can be turned ON and OFF from smartphones and smart home ecosystems via the Matter protocol. You can verify the operation with real-time LCD state animations without connecting any physical PC hardware.


Features

  • Matter Protocol Compatible — Native support for Apple Home, Google Home, Amazon Alexa, and Home Assistant.
  • Real-Time LCD Display — Animated 20 fps screen showing ON/OFF state, WiFi connection status, and assigned IP address.
  • Automatic Backlight Dimming — Illuminates at full brightness for 10 seconds on events, then smoothly fades out over 22 seconds.
  • Virtual / Physical Mode Switch — Seamlessly toggle between virtual software simulation and actual PC power button control (via optocoupler GPIO) with a single configuration line.
  • OTA Update Support — Firmware can be updated over-the-air.

Hardware

Component Model
Microcontroller Waveshare ESP32-C6-GEEK
LCD Display ST7789 (Integrated 135×240px)

Note: Physical hardware mode (PC_VIRTUAL_MODE 0) requires an external optocoupler circuit (e.g. PC817).


Software Requirements

Tool Version
ESP-IDF v5.4.1
ESP-Matter Latest (GN build tool required)
Python 3.12.3+
LovyanGFX Bundled in components/

Setup & Build

1. Configure WiFi Credentials

Edit main/wifi_creds.h:

#define WIFI_SSID     "your-ssid"      // WiFi SSID
#define WIFI_PASSWORD "your-password"  // WiFi Password

2. Export Environment and Build

# Export ESP-IDF & ESP-Matter environment
source /path/to/esp-idf/export.sh
source /path/to/esp-matter/export.sh

# Build project
idf.py build

3. Flash to ESP32-C6-GEEK

idf.py -p /dev/ttyACM0 flash

Matter Pairing Instructions

  1. Power on the device and wait until the LCD displays Ready (the assigned IP address will appear in the footer).

  2. Open your smart home app (Apple Home, Google Home, etc.) and select "Add Device".

  3. Scan the QR code displayed on screen (short-press the boot button on GPIO 9 to toggle QR display), or enter the 11-digit manual pairing code:

    34970112332
    

You can also check pairing info via serial monitor:

idf.py -p /dev/ttyACM0 monitor

Look for the Manual pairing code: line in the startup logs.


LCD State Flow

Boot
 └─ connecting...   (Connecting to WiFi)
      └─ Ready      (IP acquired, waiting for Matter commands)
           ├─ ON    (Received ON command from Matter)
           └─ OFF   (Received OFF command from Matter)

The footer displays the device's IP address and connection status.


Configuration

Virtual Mode vs. Physical Mode

In main/pc_control.h:

#define PC_VIRTUAL_MODE 1   // 1 = Virtual Mode (default), 0 = Physical GPIO Control

When set to 0 (Physical Mode), the board controls the PC power button via an optocoupler on GPIO 20.

Backlight Dimming

In main/lcd_display.cpp:

#define BL_MAX          220   // Brightness immediately after event (0-255)
#define BL_HOLD_MS    10000   // Duration to hold full brightness [ms]
#define BL_FADE_STEP_MS 100   // Fade step interval [ms] (smaller = faster)

Project Structure

Virtualdev/
├── CMakeLists.txt
├── partitions.csv              Custom partition table with OTA support
├── sdkconfig.defaults          Default build configurations
├── sdkconfig.defaults.esp32c6  ESP32-C6 specific configurations
├── main/
│   ├── app_main.cpp            Matter node init and event callbacks
│   ├── lcd_display.cpp/hpp     LovyanGFX LCD rendering & backlight control
│   ├── pc_control.c/h          Virtual / physical power state management
│   ├── qr_code.h               Commissioning QR bitmap
│   └── wifi_creds.h            WiFi credentials configuration
├── components/
│   └── LovyanGFX/              High-performance graphics library
├── managed_components/         ESP-IDF managed components
└── doc/
    ├── readme.md               Documentation copy
    └── BUILD_INSTRUCTIONS.md   Detailed build & troubleshooting instructions

License

This project is licensed under the Apache License 2.0. Third-party components:

  • ESP-IDF, ESP-Matter: Apache License 2.0
  • LovyanGFX: MIT License

Acknowledgments

  • ESP-Matter — Official Espressif Matter SDK
  • LovyanGFX — High-performance graphics driver library

About

Virtual Smart PC & Home Device using ESP32-C6-GEEK with Matter protocol and real-time LCD display

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages