Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# ESP-IDF build artifacts
build/
sdkconfig
sdkconfig.old
*.pyc

# Managed components (automatically downloaded dependencies)
managed_components/
dependencies.lock*
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# The following lines of boilerplate have to be in your project's
# CMakeLists in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.16)

# Enable per-target dependency lock files (best practice for multi-target projects)
idf_build_set_property(DEPENDENCIES_LOCK dependencies.lock.${IDF_TARGET})

include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(zigrid)
62 changes: 62 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,65 @@ A Zigbee-based illuminated button grid array.
## Overview

This project implements a grid of illuminated buttons controlled wirelessly via Zigbee, enabling flexible input and visual feedback applications.

## Development Setup

### Hardware Target

- **ESP32-C6**: RISC-V based SoC with Zigbee 3.0, Thread, and Matter support
- Supports 2.4 GHz Wi-Fi 6, Bluetooth 5 (LE), and 802.15.4 protocol

### Build System

This project uses [ESP-IDF](https://docs.espressif.com/projects/esp-idf/en/stable/esp32c6/get-started/index.html) (Espressif IoT Development Framework) as the build system and development framework.

**Prerequisites:**
- ESP-IDF v5.3.2 or later (required for ESP32-C6 support)
- CMake 3.16+
- Python 3.8+

**Installation:** Follow the [ESP-IDF Getting Started Guide](https://docs.espressif.com/projects/esp-idf/en/stable/esp32c6/get-started/index.html) to set up the toolchain.

### Dependency Management

Dependencies are managed using the [IDF Component Manager](https://docs.espressif.com/projects/esp-idf/en/stable/esp32c6/api-guides/tools/idf-component-manager.html). Components are defined in `main/idf_component.yml` and automatically downloaded during build.

**Browse components:** https://components.espressif.com/

**Add dependencies:**
```bash
idf.py add-dependency "namespace/name==version"
```

### Building and Flashing

```bash
# Configure project for ESP32-C6 target
idf.py set-target esp32c6

# Build the project
idf.py build

# Flash to device and monitor output
idf.py -p PORT flash monitor
```

Replace `PORT` with your serial port (e.g., `/dev/ttyACM0` on Linux, `COM3` on Windows).

### Project Structure

```
zigrid/
├── CMakeLists.txt # Top-level build configuration
├── sdkconfig.defaults # ESP32-C6 default configuration
└── main/
├── CMakeLists.txt # Main component build rules
├── idf_component.yml # Component dependencies
└── main.c # Application entry point
```

## Documentation

- [ESP-IDF Programming Guide](https://docs.espressif.com/projects/esp-idf/en/stable/esp32c6/index.html)
- [ESP32-C6 Technical Reference](https://www.espressif.com/sites/default/files/documentation/esp32-c6_technical_reference_manual_en.pdf)
- [IDF Component Manager](https://docs.espressif.com/projects/esp-idf/en/stable/esp32c6/api-guides/tools/idf-component-manager.html)
2 changes: 2 additions & 0 deletions main/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
idf_component_register(SRCS "main.c"
INCLUDE_DIRS ".")
18 changes: 18 additions & 0 deletions main/idf_component.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## IDF Component Manager Manifest File
##
## This file defines dependencies for the main component.
## Dependencies are automatically downloaded during the CMake configuration step.
##
## To add dependencies, use: idf.py add-dependency "namespace/name==version"
## Browse available components at: https://components.espressif.com/

dependencies:
# Zigbee dependencies will be added here when needed
# Example:
# espressif/esp-zigbee-lib: "^1.0.0"

# LED control dependencies
# espressif/led_strip: "^2.0.0"

# Other dependencies as needed
# espressif/button: "^3.0.0"
24 changes: 24 additions & 0 deletions main/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Zigrid - Zigbee-based illuminated button grid array
* Main application entry point
*/

#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_log.h"
#include "esp_system.h"

static const char *TAG = "zigrid";

void app_main(void)
{
ESP_LOGI(TAG, "Zigrid firmware starting...");
ESP_LOGI(TAG, "ESP32-C6 Zigbee-based button grid");

// Main application loop will be implemented here
while (1) {
ESP_LOGI(TAG, "Zigrid running");
vTaskDelay(pdMS_TO_TICKS(5000));
}
}
20 changes: 20 additions & 0 deletions sdkconfig.defaults
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Zigrid ESP32-C6 Default Configuration

# ESP32-C6 Target
CONFIG_IDF_TARGET="esp32c6"

# Enable USB Serial/JTAG Console
CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG=y

# Zigbee configuration (to be enabled when Zigbee is integrated)
# CONFIG_ZB_ENABLED=y
# CONFIG_ZB_RADIO_NATIVE=y

# FreeRTOS configuration
CONFIG_FREERTOS_HZ=1000

# Log level
CONFIG_LOG_DEFAULT_LEVEL_INFO=y

# Compiler options
CONFIG_COMPILER_OPTIMIZATION_SIZE=y