Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zigbee: Function to get the response from gateway after report #11038

Open
1 task done
michapr opened this issue Mar 4, 2025 · 6 comments
Open
1 task done

Zigbee: Function to get the response from gateway after report #11038

michapr opened this issue Mar 4, 2025 · 6 comments
Assignees
Labels
Area: Zigbee Issues and Feature Request about Zigbee Status: To be implemented Selected for Development

Comments

@michapr
Copy link

michapr commented Mar 4, 2025

Board

ESP32C6, ESP32H2

Device Description

ESP32C6 dev kit

Hardware Configuration

nothing more connected

Version

v3.1.2

IDE Name

Arduino IDE

Operating System

Win 11

Flash frequency

80MHz

PSRAM enabled

no

Upload speed

921600

Description

When sending a report user must be sure that report was received at gateway.
For this the gateway is sending a response to the device.

I cannot find a method to check the response from Gateway - it can be interesting for switches - but also for some important sensor values.
It should therefore be possible to query the status and repeat the transmission if necessary.
(If it is not necessary as sample for some sensors, it is possible to save energy and end the waiting process prematurely - even if this is certainly not in line with the Zigbee standard... ;) ...)

Maybe this function is anywhere - but could not find it ;)

Sketch

Sample temperature sketch from 
https://github.com/espressif/arduino-esp32/issues/10746
(enabled all debugging, set delay before deep sleep to 900 for debugging)

Debug Message

20:23:26.407 -> [  2030][V][ZigbeeTempSensor.cpp:58] setTemperature(): Updating temperature sensor value...
20:23:26.407 -> [  2031][D][ZigbeeTempSensor.cpp:60] setTemperature(): Setting temperature to 1000
20:23:26.407 -> [  2033][V][ZigbeeTempSensor.cpp:99] setHumidity(): Updating humidity sensor value...
20:23:26.407 -> [  2035][D][ZigbeeTempSensor.cpp:101] setHumidity(): Setting humidity to 1000
20:23:26.407 -> [  2036][V][ZigbeeTempSensor.cpp:80] reportTemperature(): Temperature report sent
20:23:26.407 -> [  2041][V][ZigbeeTempSensor.cpp:122] reportHumidity(): Humidity report sent
20:23:26.407 -> Reported temperature: 10.00°C, Humidity: 10.00%
20:23:26.407 -> Going to sleep now
20:23:26.669 -> [  2299][V][ZigbeeHandlers.cpp:393] zb_cmd_default_resp_handler(): Received default response: from address(0x0), src_endpoint(1) to dst_endpoint(10), cluster(0x402) with status 0x0
20:23:26.669 -> [  2310][V][ZigbeeHandlers.cpp:393] zb_cmd_default_resp_handler(): Received default response: from address(0x0), src_endpoint(1) to dst_endpoint(10), cluster(0x405) with status 0x0

Other Steps to Reproduce

No response

I have checked existing issues, online documentation and the Troubleshooting Guide

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.
@michapr michapr added the Status: Awaiting triage Issue is waiting for triage label Mar 4, 2025
@P-R-O-C-H-Y P-R-O-C-H-Y self-assigned this Mar 5, 2025
@P-R-O-C-H-Y P-R-O-C-H-Y added Area: Zigbee Issues and Feature Request about Zigbee Status: To be implemented Selected for Development and removed Status: Awaiting triage Issue is waiting for triage labels Mar 5, 2025
@P-R-O-C-H-Y
Copy link
Member

Hi @michapr, I guess just from a quick look it's about implementing a callback for zb_cmd_default_resp_handler() in ZigbeeEP class so it can be user in the user app code. I am correct or is there any other response handlers that can be used if you know :)

@michapr
Copy link
Author

michapr commented Mar 5, 2025

Really?
I have no idea how to do this right now... of course, this may also have something to do with my experience...

I see that the static esp_err_t zb_cmd_default_resp_handler(const esp_zb_zcl_cmd_default_resp_message_t *message) return only ESP_OK, but not as sample the cluster number....

Maybe you could show here a code fragment how to use it? We should know the received status of each transmitted value.

EDIT: sorry,... misunderstanding... I read it too quickly (skimmed it) - you mean it can be realized with this - that's correct :)

@P-R-O-C-H-Y
Copy link
Member

Will post a PR with the callback implemented and If you would please you can give it a try and help with testing I will appreciate it :)

@def1149
Copy link

def1149 commented Mar 8, 2025

I agree. We need some way to confirm data was delivered not just using a delay

@michapr
Copy link
Author

michapr commented Mar 14, 2025

@P-R-O-C-H-Y is here also any progress? ;)

@P-R-O-C-H-Y
Copy link
Member

@michapr its in my backlog. Will start on this soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Zigbee Issues and Feature Request about Zigbee Status: To be implemented Selected for Development
Projects
None yet
Development

No branches or pull requests

3 participants