espressif / arduino-esp32

Arduino core for the ESP32
GNU Lesser General Public License v2.1
13.03k stars 7.3k forks source link

Zigbee example does not compile for H2 #9951

Open petermeter69 opened 3 weeks ago

petermeter69 commented 3 weeks ago

Board

ESP32-H2 Dev module, SuperMini ESP32-H2

Device Description

devkit

Hardware Configuration

no

Version

latest master (checkout manually)

IDE Name

Arduino 2.3.2

Operating System

Win10

Flash frequency

64MHz

PSRAM enabled

yes

Upload speed

921600

Description

On the same machine, I can compile, upload and run 3 of 4 built-in examples (Light switch, light bulb, temp sensor), while unable to compile the 4th example thermostat, with it being not modified by me at all. Partition scheme and Zigbee mode are correctly set (as the working examples show).

Sketch

Unmodified Zigbee_Thermostat.ino

Debug Message

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

Other Steps to Reproduce

No response

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

petermeter69 commented 3 weeks ago

By changing this line in "_include/zcl/esp_zigbee_zclthermostat.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

P-R-O-C-H-Y commented 3 weeks ago

@petermeter69 This is something that needs to be fixed in ESP-Zigbee-SDK. Please open an issue in the repository and also include the proposed fix. If you can also ping me or link this issue there. As its only warning ([-Wnarrowing]) marked as error, you can disable "Compiler Warnings" in the Arduino IDE settings.

petermeter69 commented 3 weeks ago

@P-R-O-C-H-Y Thanks for you answer, reported there, see: https://github.com/espressif/esp-zigbee-sdk/issues/379