This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

zigbee: app hangs on thermostat Setpoint Raise/Lower command

Hello!


I'm trying to implement a thermostat cluster handling. I've managed to implement read/write thermostat attributes handling using zigbee device callback. The problem is that I can't get thermostat cluster's Setpoint Raise/Lower to work.

I tried to debug the application and I can see in `gdb`'s backtrace that `zb_zcl_thermostat_invoke_user_app` fails:


0x000013fe in zb_nrf52840_abort () at /home/kacper/Workspace/nRF_SDK/ThreadZB/ThreadZB_v3_0_0/external/zboss/osif/zb_nrf52840_common.c:151
151        zb_osif_serial_flush();
>>> bt
#0  0x000013fe in zb_nrf52840_abort () at /home/kacper/Workspace/nRF_SDK/ThreadZB/ThreadZB_v3_0_0/external/zboss/osif/zb_nrf52840_common.c:151
#1  0x0001476e in zb_zcl_thermostat_invoke_user_app ()
#2  0x00010912 in zb_sched_loop_iteration ()
#3  0x000046f6 in main () at ./app_zb.c:111
>>>

It is some ZBOSS internal error. I can't get device callback to be called, the application hangs in an endless loop."

EDIT:

When I don't register the device callback I can see that the application doesn't hang. It hangs on reception of Setpoint Raise/Lower command only when ZB_ZCL_REGISTER_DEVICE_CB is called.

Parents
  • After some struggling, I've managed to make it work. The problem is that the ZBOSS stack is not able to handle custom set of thermostat's cluster attributes. When I declare the attribute list for the thermostat cluster like so:

    #define JUNGLES_ZB_ZCL_DECLARE_THERMOSTAT_ATTRIB_LIST_1( \
        attr_list, local_temperature, occupied_cooling_setpoint, control_sequence_of_operation, system_mode) \
        ZB_ZCL_START_DECLARE_ATTRIB_LIST(attr_list) \
        ZB_ZCL_SET_ATTR_DESC(ZB_ZCL_ATTR_THERMOSTAT_LOCAL_TEMPERATURE_ID, (local_temperature)) \
        ZB_ZCL_SET_ATTR_DESC(ZB_ZCL_ATTR_THERMOSTAT_OCCUPIED_COOLING_SETPOINT_ID, (occupied_cooling_setpoint)) \
        ZB_ZCL_SET_ATTR_DESC(ZB_ZCL_ATTR_THERMOSTAT_CONTROL_SEQUENCE_OF_OPERATION_ID, (control_sequence_of_operation)) \
        ZB_ZCL_SET_ATTR_DESC(ZB_ZCL_ATTR_THERMOSTAT_SYSTEM_MODE_ID, (system_mode)) \
        ZB_ZCL_FINISH_DECLARE_ATTRIB_LIST


    then device hangs on the reception of Setpoint Raise/Lower ZigBee command.

    but when I use the default ZBOSS ZCL macro ZB_ZCL_DECLARE_THERMOSTAT_ATTRIB_LIST, which is declared like that:

    #define ZB_ZCL_DECLARE_THERMOSTAT_ATTRIB_LIST(attr_list,                                                \
          local_temperature, local_temperature_calibration, occupied_cooling_setpoint,                      \
          occupied_heating_setpoint, control_seq_of_operation, system_mode, start_of_week) \
      ZB_ZCL_START_DECLARE_ATTRIB_LIST(attr_list)                                                           \
      ZB_ZCL_SET_ATTR_DESC(ZB_ZCL_ATTR_THERMOSTAT_LOCAL_TEMPERATURE_ID, (local_temperature))                \
      ZB_ZCL_SET_ATTR_DESC(ZB_ZCL_ATTR_THERMOSTAT_LOCAL_TEMPERATURE_CALIBRATION_ID, (local_temperature_calibration))                        \
      ZB_ZCL_SET_ATTR_DESC(ZB_ZCL_ATTR_THERMOSTAT_OCCUPIED_COOLING_SETPOINT_ID, (occupied_cooling_setpoint))        \
      ZB_ZCL_SET_ATTR_DESC(ZB_ZCL_ATTR_THERMOSTAT_OCCUPIED_HEATING_SETPOINT_ID, (occupied_heating_setpoint))        \
      ZB_ZCL_SET_ATTR_DESC(ZB_ZCL_ATTR_THERMOSTAT_CONTROL_SEQUENCE_OF_OPERATION_ID, (control_seq_of_operation))     \
      ZB_ZCL_SET_ATTR_DESC(ZB_ZCL_ATTR_THERMOSTAT_SYSTEM_MODE_ID, (system_mode))                            \
      ZB_ZCL_SET_ATTR_DESC(ZB_ZCL_ATTR_THERMOSTAT_START_OF_WEEK_ID, (start_of_week)) \
      ZB_ZCL_FINISH_DECLARE_ATTRIB_LIST


    everything works as expected.

    The thing is that I wanted to support only Mandatory attributes. The basic attribute list, which ZBOSS supports, contains extra optional attributes:

    * local temperature calibration

    * occupied heating setpoint

    * start of the week

    And I don't want to support these extra attributes, so it is a bug.

    Please, fix this problem, because I want to support only mandatory thermostat cluster attributes.

  • Hi,

    Sorry for the late reply. I am glad you found the problem. You can declare you own custom attribute list and remove local temperature calibration and start of the week if you want to. But according to the section 6.3.2.2.2 of the Zigbee Cluster Library Specification:

    "Thermostats SHOULD implement both OccupiedCoolingSetpoint and OccupiedHeatingSetpoint attributes."

    so that's not possible to remove.

    But you could define something like this:

    #define ZB_ZCL_DECLARE_THERMOSTAT_ATTRIB_LIST_CUSTOM(attr_list,                                                \
          local_temperature, local_temperature_calibration, occupied_cooling_setpoint,                      \
          occupied_heating_setpoint, control_seq_of_operation, system_mode, start_of_week) \
      ZB_ZCL_START_DECLARE_ATTRIB_LIST(attr_list)                                                           \
      ZB_ZCL_SET_ATTR_DESC(ZB_ZCL_ATTR_THERMOSTAT_LOCAL_TEMPERATURE_ID, (local_temperature))                \
      ZB_ZCL_SET_ATTR_DESC(ZB_ZCL_ATTR_THERMOSTAT_OCCUPIED_COOLING_SETPOINT_ID, (occupied_cooling_setpoint))        \
      ZB_ZCL_SET_ATTR_DESC(ZB_ZCL_ATTR_THERMOSTAT_OCCUPIED_HEATING_SETPOINT_ID, (occupied_heating_setpoint))        \
      ZB_ZCL_SET_ATTR_DESC(ZB_ZCL_ATTR_THERMOSTAT_CONTROL_SEQUENCE_OF_OPERATION_ID, (control_seq_of_operation))     \
      ZB_ZCL_SET_ATTR_DESC(ZB_ZCL_ATTR_THERMOSTAT_SYSTEM_MODE_ID, (system_mode))                            \
      ZB_ZCL_FINISH_DECLARE_ATTRIB_LIST
    

    Best Regards,

    Marjeris

  • Hello,

    thank you for the response.

    According to the section 1.4. of the Zigbee Cluster Library Specification:

    "Should: A key word indicating the flexibility of choice with a strongly preferred alternative. Equivalent to the phrase is recommended."

    So it is recommended to handle both attributes, but not mandatory. The section you quoted contains more information, specifically:

    "*Note: "M*" designates that a server SHALL implement at least one of the attributes designated "M*." For example, a radiator valve implementing the Thermostat Cluster server would only implement the OccupiedHeatingSetpoint attribute. Thermostats SHOULD implement both OccupiedCoolingSetpoint and OccupiedHeatingSetpoint attributes. The "M*" designation allows HVAC devices to implement the portions of Thermostat cluster germane to their operation"

    So that shall be possible to remove.

  • Hi to everyone, 

    I have the same problem that KKoovalsky has. I'm working with SDK 4.0.0 so I don't see any stack level changes on this command. Is there anything new or is it not possible to do anything but declare both attributes?

    Thank you so much.

    Raffaela

  • Hi ,

    This thread is quite old. Could you please open a new ticket with your question?

Reply Children
No Data
Related