Initial commit: ESP32-C6 Zigbee simple light controller
This commit is contained in:
3
main/CMakeLists.txt
Normal file
3
main/CMakeLists.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
idf_component_register(SRCS "main.c"
|
||||
INCLUDE_DIRS "."
|
||||
REQUIRES nvs_flash driver espressif__esp-zigbee-lib espressif__esp-zboss-lib)
|
18
main/idf_component.yml
Normal file
18
main/idf_component.yml
Normal file
@@ -0,0 +1,18 @@
|
||||
## IDF Component Manager Manifest File
|
||||
dependencies:
|
||||
## Required IDF version
|
||||
idf:
|
||||
version: '>=4.1.0'
|
||||
# # Put list of dependencies here
|
||||
# # For components maintained by Espressif:
|
||||
# component: "~1.0.0"
|
||||
# # For 3rd party components:
|
||||
# username/component: ">=1.0.0,<2.0.0"
|
||||
# username2/component2:
|
||||
# version: "~1.0.0"
|
||||
# # For transient dependencies `public` flag can be set.
|
||||
# # `public` flag doesn't have an effect dependencies of the `main` component.
|
||||
# # All dependencies of `main` are public by default.
|
||||
# public: true
|
||||
espressif/esp-zboss-lib: '*'
|
||||
espressif/esp-zigbee-lib: '*'
|
27
main/main.c
Normal file
27
main/main.c
Normal file
@@ -0,0 +1,27 @@
|
||||
#include <stdio.h>
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include "freertos/task.h"
|
||||
#include "driver/gpio.h"
|
||||
#include "esp_log.h"
|
||||
#include "nvs_flash.h"
|
||||
#include "ha/esp_zigbee_ha_standard.h"
|
||||
|
||||
static const char *TAG = "SIMPLE_LIGHT_CONTROLLER";
|
||||
|
||||
void app_main(void)
|
||||
{
|
||||
// Print startup banner to serial monitor
|
||||
ESP_LOGI(TAG, "=== Simple Light controller for Zigbee & HA ===");
|
||||
|
||||
// === INITIALIZE STORAGE SYSTEM ===
|
||||
// NVS = Non-Volatile Storage
|
||||
// Saves Zigbee network info so device remembers which network it joined
|
||||
ESP_ERROR_CHECK(nvs_flash_init()); // ESP_ERROR_CHECK = crash if this fails
|
||||
|
||||
esp_zb_platform_config_t config = {
|
||||
.radio_config = ESP_ZB_DEFAULT_RADIO_CONFIG(), // Set up 2.4GHz radio settings
|
||||
.host_config = ESP_ZB_DEFAULT_HOST_CONFIG(), // Set up processor settings
|
||||
};
|
||||
|
||||
ESP_ERROR_CHECK(esp_zb_platform_config(&config)); // Apply the configuration
|
||||
}
|
Reference in New Issue
Block a user