Slacki
(Hans Dampf)
September 1, 2023, 3:18pm
1
Hi there,
is there anyone who has seccessfull connected a ESP32-C6 to OH anc can use it as a switch (for example) ?
Or has some Links/HowTos ?
Exactly de model C6? Or any Esp32? Because I have some of them using ESPHOME and connecting through MQTT.
Ruben
Slacki
(Hans Dampf)
September 1, 2023, 4:58pm
3
C6, becouse it has hardware zigbee support.
okey, mqtt may be a workarround, thanks for the tip.
but i would realy prefer zigbee. now when esp32 provides it
I have one working as a toggle switch. But it is very EARLY.
Slacki
(Hans Dampf)
September 4, 2023, 6:12am
5
oh cool. congratulations !
which example did you used and what did you changed ?
i use the ha-light example. OH sees the ESP, but at this moment, ESP-Log says: network steering error (something like this).
can add the ESP to Things-List in OH, but with error: could not be discovered
The network steering error means its not connecting to the network.
I used the esp_HA_customized_switch. And changed esp_HA_customized_switch.c per
ESP32-C6 Unable to join zigbee network (IDFGH-9286) · Issue #10662 · espressif/esp-idf · GitHub adding modelid[] and manufname[]
This let zigbee2mqtt see it. And add this as a custom converter to zigbee2mqtt
const fz = require('zigbee-herdsman-converters/converters/fromZigbee');
const tz = require('zigbee-herdsman-converters/converters/toZigbee');
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const reporting = require('zigbee-herdsman-converters/lib/reporting');
const extend = require('zigbee-herdsman-converters/lib/extend');
const e = exposes.presets;
const ea = exposes.access;
const definition = {
zigbeeModel: ['ESP32C6.Light'],
model: 'ESP32C6.Light', // works leftover from trying light exampes
vendor: 'Espressif',
description: 'light_bulb',
fromZigbee: [fz.on_off],
toZigbee: [tz.on_off],
exposes: [e.switch()],
// The configure method below is needed to make the device reports on/off state changes
// when the device is controlled manually through the button on it.
configure: async (device, coordinatorEndpoint, logger) => {
const endpoint = device.getEndpoint(1);
await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff']);
await reporting.onOff(endpoint);
},
};
module.exports = definition;
It’s a start. when the arudino support is released the c6 and H2 are going to be very cool. Cheap DIY zigbee stuff.
Slacki
(Hans Dampf)
September 4, 2023, 3:02pm
7
okey, thanks. for the code.
but do i understand right? its only for “mqtt”, not a native zigbee3 handled by OH ?
Yes I use zigbee2mqtt. I am on OH 1.8 so I do not use the OH zigbee.
Tokn59
(Tokn59)
December 12, 2023, 3:04pm
9
Hi, can you tell us how you compiled this code for the C6 ? What board definition did you use ? Arduino IDE ? Thanks !!!
I used VS code with the ESP-IDE plugin. And used these edits-
opened 07:53AM - 31 Jan 23 UTC
closed 02:53AM - 13 Feb 23 UTC
Type: Bug
Status: Done
Resolution: Done
### Answers checklist.
- [X] I have read the documentation [ESP-IDF Programming… Guide](https://docs.espressif.com/projects/esp-idf/en/latest/) and the issue is not addressed there.
- [X] I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
- [X] I have searched the issue tracker for a similar issue and not found a similar issue.
### IDF version.
v5.1-dev-3066-g236fa5e669
### Operating System used.
Linux
### How did you build your project?
Command line with idf.py
### If you are using Windows, please specify command line type.
None
### Development Kit.
ESP32-C6-DevKitC-1
### Power Supply used.
USB
### What is the expected behavior?
I have two boards, run HA_on_off_light and HA_on_off_switch respectively, and then I use zigbee sniffer to get their incoming packets, but I can't get anything.
### What is the actual behavior?
I can't get the Beacon Request message when I use Ubiqua.
![image](https://user-images.githubusercontent.com/46518962/215698821-1f7838e1-d608-4b4a-883d-91c2e6326ee3.png)
### Steps to reproduce.
1. cd examples/zigbee/light_sample/HA_on_off_switch
2. idf.py --preview set-target esp32c6
3. idf.py build
4. idf.py flash
5. cd examples/zigbee/light_sample/HA_on_off_light
6. idf.py --preview set-target esp32c6
7. idf.py build
8. idf.py flash
### Debug Logs.
```plain
Executing action: monitor
Running idf_monitor in directory /home/lewin/esp/esp-idf-v5.0/examples/zigbee/light_sample/HA_on_off_switch
Executing "/home/lewin/.espressif/python_env/idf5.1_py3.8_env/bin/python /home/lewin/esp/esp-idf-v5.0/tools/idf_monitor.py -p /dev/ttyUSB1 -b 115200 --toolchain-prefix riscv32-esp-elf- --target esp32c6 --decode-panic backtrace /home/lewin/esp/esp-idf-v5.0/examples/zigbee/light_sample/HA_on_off_switch/build/light_switch.elf -m '/home/lewin/.espressif/python_env/idf5.1_py3.8_env/bin/python' '/home/lewin/esp/esp-idf-v5.0/tools/idf.py' '-p' '/dev/ttyUSB1'"...
--- idf_monitor on /dev/ttyUSB1 115200 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
ESP-ROM:esp32c6-20220919
Build:Sep 19 2022
rst:0x1 (POWERON),boot:0xc (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:2
load:0x4086c610,len:0xc98
load:0x4086e610,len:0x2a0c
load:0x40875720,len:0x17b0
entry 0x4086c610
I (23) boot: ESP-IDF v5.1-dev-3066-g236fa5e669 2nd stage bootloader
I (24) boot: compile time Jan 31 2023 15:42:51
I (24) boot: chip revision: v0.0
I (28) boot.esp32c6: SPI Speed : 40MHz
I (33) boot.esp32c6: SPI Mode : DIO
I (38) boot.esp32c6: SPI Flash Size : 2MB
I (42) boot: Enabling RNG early entropy source...
W (48) bootloader_random: bootloader_random_enable() has not been implemented yet
I (56) boot: Partition Table:
I (59) boot: ## Label Usage Type ST Offset Length
I (67) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (74) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (82) boot: 2 factory factory app 00 00 00010000 00089800
I (89) boot: 3 zb_storage Unknown data 01 81 0009a000 00020000
I (97) boot: 4 zb_fct Unknown data 01 81 000ba000 00000400
I (104) boot: End of partition table
I (108) esp_image: segment 0: paddr=00010020 vaddr=42060020 size=0a250h ( 41552) map
I (125) esp_image: segment 1: paddr=0001a278 vaddr=40800000 size=05da0h ( 23968) load
I (131) esp_image: segment 2: paddr=00020020 vaddr=42000020 size=5cbb0h (379824) map
I (206) esp_image: segment 3: paddr=0007cbd8 vaddr=40805da0 size=06008h ( 24584) load
I (212) esp_image: segment 4: paddr=00082be8 vaddr=4080bdb0 size=01538h ( 5432) load
I (217) boot: Loaded app from partition at offset 0x10000
I (218) boot: Disabling RNG early entropy source...
W (224) bootloader_random: bootloader_random_enable() has not been implemented yet
I (243) cpu_start: Pro cpu up.
W (252) clk: esp_perip_clk_init() has not been implemented yet
W (258) CACHE_ERR: esp_cache_err_int_init() has not been implemented yet
I (259) cpu_start: Pro cpu start user code
I (259) cpu_start: cpu freq: 160000000 Hz
I (264) cpu_start: Application information:
I (269) cpu_start: Project name: light_switch
I (274) cpu_start: App version: v5.1-dev-3066-g236fa5e669
I (281) cpu_start: Compile time: Jan 31 2023 15:42:44
I (287) cpu_start: ELF file SHA256: 6a2fee3c1530ebe6...
I (293) cpu_start: ESP-IDF: v5.1-dev-3066-g236fa5e669
I (299) cpu_start: Min chip rev: v0.0
I (304) cpu_start: Max chip rev: v0.99
I (309) cpu_start: Chip rev: v0.0
I (314) heap_init: Initializing. RAM available for dynamic allocation:
I (321) heap_init: At 40812E10 len 00069800 (422 KiB): D/IRAM
I (327) heap_init: At 4087C610 len 00002F54 (11 KiB): STACK/DRAM
I (334) heap_init: At 50000010 len 00003FF0 (15 KiB): RTCRAM
I (341) spi_flash: detected chip: gd
I (345) spi_flash: flash io: dio
W (348) spi_flash: Detected size(8192k) larger than the size in the binary image header(2048k). Using the size in the binary image header.
I (362) app_start: Starting scheduler on CPU0
I (367) main_task: Started on CPU0
I (367) main_task: Calling app_main()
I (377) gpio: GPIO[9]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:2
I (377) phy_init: phy_version 101,587adde,Dec 20 2022,14:21:21
I (457) main_task: Returned from app_main()
I (467) ESP_ZB_ON_OFF_SWITCH: ZDO signal: 23, status: -1
I (467) ESP_ZB_ON_OFF_SWITCH: Zigbee stack initialized
I (497) ESP_ZB_ON_OFF_SWITCH: Start network formation
I (42757) ESP_ZB_ON_OFF_SWITCH: send 'on_off toggle' command
I (42757) ESP_ZB_ON_OFF_SWITCH: ZDO signal: 60, status: 0
I (43297) ESP_ZB_ON_OFF_SWITCH: send 'on_off toggle' command
I (43297) ESP_ZB_ON_OFF_SWITCH: ZDO signal: 60, status: 0
I (44187) ESP_ZB_ON_OFF_SWITCH: send 'on_off toggle' command
I (44187) ESP_ZB_ON_OFF_SWITCH: ZDO signal: 60, status: 0
I (44847) ESP_ZB_ON_OFF_SWITCH: send 'on_off toggle' command
I (44847) ESP_ZB_ON_OFF_SWITCH: ZDO signal: 60, status: 0
I (45167) ESP_ZB_ON_OFF_SWITCH: send 'on_off toggle' command
I (45167) ESP_ZB_ON_OFF_SWITCH: ZDO signal: 60, status: 0
I (45417) ESP_ZB_ON_OFF_SWITCH: send 'on_off toggle' command
I (45417) ESP_ZB_ON_OFF_SWITCH: ZDO signal: 60, status: 0
I (45717) ESP_ZB_ON_OFF_SWITCH: send 'on_off toggle' command
I (45717) ESP_ZB_ON_OFF_SWITCH: ZDO signal: 60, status: 0
I (45977) ESP_ZB_ON_OFF_SWITCH: send 'on_off toggle' command
I (45977) ESP_ZB_ON_OFF_SWITCH: ZDO signal: 60, status: 0
I (46247) ESP_ZB_ON_OFF_SWITCH: send 'on_off toggle' command
I (46247) ESP_ZB_ON_OFF_SWITCH: ZDO signal: 60, status: 0
I (46507) ESP_ZB_ON_OFF_SWITCH: send 'on_off toggle' command
I (46507) ESP_ZB_ON_OFF_SWITCH: ZDO signal: 60, status: 0
I (46827) ESP_ZB_ON_OFF_SWITCH: send 'on_off toggle' command
I (46827) ESP_ZB_ON_OFF_SWITCH: ZDO signal: 60, status: 0
I (48077) ESP_ZB_ON_OFF_SWITCH: send 'on_off toggle' command
I (48077) ESP_ZB_ON_OFF_SWITCH: ZDO signal: 60, status: 0
I (50417) ESP_ZB_ON_OFF_SWITCH: send 'on_off toggle' command
I (50417) ESP_ZB_ON_OFF_SWITCH: ZDO signal: 60, status: 0
I (50677) ESP_ZB_ON_OFF_SWITCH: send 'on_off toggle' command
I (50677) ESP_ZB_ON_OFF_SWITCH: ZDO signal: 60, status: 0
I (50937) ESP_ZB_ON_OFF_SWITCH: send 'on_off toggle' command
I (50937) ESP_ZB_ON_OFF_SWITCH: ZDO signal: 60, status: 0
```
### More Information.
_No response_
Also see this one-
prinz
(WP)
December 16, 2023, 10:54am
11
I’m running a lot of ESP32 or ESP 8266 with attached sensors and I can recommend the Tasmota firmware. It supports almost all sensors out of the box and has a built in feature to distribute sensor values via mqtt.
1 Like
I also use a lot of diy ESP’s. The new C6 is zigbee so all the advantages of zigbee and zigbee2mqtt.
supersjel
(Michel)
December 28, 2023, 9:46am
13
I have a lot of ESP (several types ESP8266 and ESP32 depending on requirements). I wrote a little library to provide for json webservices, logging, file usage, command processing, html pages, updating, etc.
Connection to openHAB is either by http binding to one of the services or the device pushes values by using the openHAB API to change items. The API is already present, does the job and easier than setting up MQTT.
If you’re not familiar with programming than tasmota or esphome is easier.
Funny I’ve been looking at this device too. But so far couldn’t find a good usecase for it.
The C6 now has Arduino support. I have 2 zigbee running now 1 on the garage door now running for 4 days with no crashes and 1 with get this a lux senser using a Adafruit driver. So this one both sends and receives commands.