-
Notifications
You must be signed in to change notification settings - Fork 153
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
Using a suitable cluster and attribute for the battery voltage help (CON-1295) #1044
Comments
@pavel808 two things,
|
@jadhavrohit924 Thanks for your reply. I am updating the attribute after the Matter starts. Just before I attempt to update that Voltage attribute, I update a Temperature attribute as below and it works fine.
How to use chip lock exactly? I have a suspicion that the
|
@pavel808 Please provide me the backtrace of the crash in the file. |
Hi @jadhavrohit924 . Attached are my logs from the application, with multiple crashes. Thanks. |
There is no backtrace in the logs!!! Please redirect the crash to either uart or partition and generate the backtrace using https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-guides/core_dump.html. |
@jadhavrohit924 Ah yes. Attached is my core dump file. The crash was re-directed over UART. Thanks. |
@pavel808 The core dump you shared is encrypted. The one having ELF can only decrypt it. You can use the command Did you make any changes on top of any standard esp-matter example app? If you do, can you please share it with me to debug. |
@jadhavrohit924 Apologies. Here is the decoded core dump file attached. I have made changes to an esp-matter example app. I took the light example more or less and customized it. Everything is working fine up to the point where I try to update that Voltage attribute. I have attached my |
Hi @pavel808, the crash is caused by using a different thread to update the attribute. If you join the thread you can avoid the crash. |
I think the problem is that you are updating the cluster attribute 0x90 (electricalpowermeasurement) with endpoint 1 (which corresponds to light). You have to use the electrical_power_measurement endpoint (I think it's 2) |
It is an error when copying the example code from light, in the line:
light_endpoint_id where electrical_power_measurenment_endpoint_id is the variable that saves the end point of the created cluster |
@JoseAntonioMG If you check the app_main attached above, @pavel808 has created only one endpoint and added the |
Indeed you are right. The main thread wasn't waiting for the other thread :-/. The crash is no longer there. Thanks. |
@jadhavrohit924 @JoseAntonioMG Exactly. I am only using one endpoint here and don't want to use more. Some code is emitted here , but basically, what i'm trying to do :
Then from another separate thread later after things are set up :
Now I get that the attribute is not supported : ?
|
@pavel808 Looks like you have not created a Voltage attribute. It is optional in Matter Spec so you have to create it in your application. |
Hi @jadhavrohit924 I'm not sure if I understand fully. The Voltage attribute is there in Attributes.h :
|
@pavel808 The above code is from connectedhomeip, right? If you are using ESP-Matter SDK, you have to create attributes/commands/events that are optional in Matter Specification that you need in your application. ESP-Matter only creates mandatory things by default. Please take a look at esp-matter-componets for better understanding. |
@jadhavrohit924 Yes, that code was from connectedhomeip. Ah ok I understand now. I have successfully managed to create a new attribute for the
I try to read the attribute using chip-tool as follows :
However, I get the following error in the response that it doesn't know how to log the attribute.
I believe that I am still missing something, not sure what, but almost there. Many thanks for your help. |
To create a new voltage attribute, you have to do it like this: int64_t Voltage = 0; |
I am creating an application for the ESP32-C6. One of the functions is to monitor the connected battery voltage through a GPIO pin and ADC, and update a matter attribute which can be read from a client such as chip-tool.
I am trying to use the
electrical_power_measurement cluster
and itsvoltage
attribute for this as follows :On trying to update he attribute as above, I get the following runtime error and crash. Any idea what is wrong here? Thanks in advance.
The text was updated successfully, but these errors were encountered: