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

"include/zcl/esp_zigbee_zcl_thermostat.h" (TZ-981) #379

Open
3 tasks done
petermeter69 opened this issue Jun 29, 2024 · 1 comment
Open
3 tasks done

"include/zcl/esp_zigbee_zcl_thermostat.h" (TZ-981) #379

petermeter69 opened this issue Jun 29, 2024 · 1 comment
Labels

Comments

@petermeter69
Copy link

petermeter69 commented Jun 29, 2024

Answers checklist.

  • I have read the documentation ESP Zigbee SDK Programming Guide and tried the debugging tips, the issue is not addressed there.
  • I have updated ESP Zigbee libs (esp-zboss-lib and esp-zigbee-lib) to the latest version, with corresponding IDF version, and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

IDF version.

ESP-IDF v5.1.4+

esp-zigbee-lib version.

1.0.1

esp-zboss-lib version.

1.0.1

Espressif SoC revision.

ESP32-H2

What is the expected behavior?

I am coming from the Arduino IDE forum espressif/arduino-esp32#9951, but I was advised to report this here.
As opposed to the other 3 examples, I was not able to compile the 4th default example (zigbee_thermostat).

What is the actual behavior?

This is the error:
`In file included
from C:\Users.../include/espressif__esp-zigbee-lib/include/zcl/esp_zigbee_zcl_common.h:38,
from C:\Users.../include/esp_zigbee_attribute.h:14,
from C:\Users.../include/esp_zigbee_core.h:16,
from C:\Users...\Zigbee_Thermostat.ino:33:
C:\Users...\Zigbee_Thermostat.ino: In function 'void esp_zb_task(void*)':
C:\Users.../include/zcl/esp_zigbee_zcl_thermostat.h:180:63: error: narrowing conversion of '65535' from 'int' to 'int16_t' {aka 'short int'} [-Wnarrowing]
180 | #define ESP_ZB_ZCL_THERMOSTAT_LOCAL_TEMPERATURE_DEFAULT_VALUE 0xffff
| ^~~~~~
C:\Users.../include/ha/esp_zigbee_ha_standard.h:329:38: note: in expansion of macro 'ESP_ZB_ZCL_THERMOSTAT_LOCAL_TEMPERATURE_DEFAULT_VALUE'
329 | .local_temperature = ESP_ZB_ZCL_THERMOSTAT_LOCAL_TEMPERATURE_DEFAULT_VALUE,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users...\Zigbee_Thermostat.ino:479:44: note: in expansion of macro 'ESP_ZB_DEFAULT_THERMOSTAT_CONFIG'
479 | esp_zb_thermostat_cfg_t thermostat_cfg = ESP_ZB_DEFAULT_THERMOSTAT_CONFIG();
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

exit status 1

Compilation error: exit status 1`

Steps to reproduce.

Pressing compile button in IDE.

More Information.

By changing this line in "include/zcl/esp_zigbee_zcl_thermostat.h", it compiles:
From:
#define ESP_ZB_ZCL_THERMOSTAT_LOCAL_TEMPERATURE_DEFAULT_VALUE 0xffff
To:
#define ESP_ZB_ZCL_THERMOSTAT_LOCAL_TEMPERATURE_DEFAULT_VALUE 0x7fff

@github-actions github-actions bot changed the title "include/zcl/esp_zigbee_zcl_thermostat.h" "include/zcl/esp_zigbee_zcl_thermostat.h" (TZ-981) Jun 29, 2024
@lpy4105
Copy link

lpy4105 commented Jul 10, 2024

Hi @petermeter69

I failed to reproduce the issue on Linux (tested by gcc/clang/arduino-esp). It seems to be an issue related to the compiler behaviour.

On the other hand, the ZCL specification defines the default value of local temperature attribute to be FF. It's not correct to change the value to 0x7fff.

Does espressif/arduino-esp32#9951 (comment) works for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants