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

Add another cluster to zigbee multi sensor example

Hi. I tried to add rel_humidity_measurement cluster to multisensor example. New cluster is visible , but i cant get humidity data report  I used cli exemple, here are logs:

zigbee.report: Received value updates from the remote node 0x07EF
zigbee.report: Profile: 0x0104 Cluster: 0x0402 Attribute: 0x0000 Type: 41 Value: 4000
zigbee.report: Received value updates from the remote node 0x07EF

zcl subscribe on f4ce361cf4681e64 10 0405 0104 0 41
Error: Unable to configure attribute 0 reporting. Status: 141
Error: One or more attributes reporting were not configured successfully

Here is my code ZB_MULTI_SENSOR.H

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#ifndef ZB_MULTI_SENSOR_H__
#define ZB_MULTI_SENSOR_H__
#include "zboss_api.h"
#include "zboss_api_addons.h"
#include "zb_zcl_pressure_measurement.h"
#include "zb_zcl_rel_humidity_measurement.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Basic cluster attributes initial values. For more information, see section 3.2.2.2 of the ZCL specification. */
#define SENSOR_INIT_BASIC_APP_VERSION 01 /**< Version of the application software (1 byte). */
#define SENSOR_INIT_BASIC_STACK_VERSION 10 /**< Version of the implementation of the Zigbee stack (1 byte). */
#define SENSOR_INIT_BASIC_HW_VERSION 11 /**< Version of the hardware of the device (1 byte). */
#define SENSOR_INIT_BASIC_MANUF_NAME "Custom" /**< Manufacturer name (32 bytes). */
#define SENSOR_INIT_BASIC_MODEL_ID "Multisensor" /**< Model number assigned by the manufacturer (32-bytes long string). */
#define SENSOR_INIT_BASIC_DATE_CODE "20200603" /**< Date provided by the manufacturer of the device in ISO 8601 format (YYYYMMDD), for the first 8 bytes. The remaining 8 bytes are manufacturer-specific. */
#define SENSOR_INIT_BASIC_POWER_SOURCE ZB_ZCL_BASIC_POWER_SOURCE_DC_SOURCE /**< Type of power source or sources available for the device. For possible values, see section 3.2.2.2.8 of the ZCL specification. */
#define SENSOR_INIT_BASIC_LOCATION_DESC "House" /**< Description of the physical location of the device (16 bytes). You can modify it during the commisioning process. */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

main.c

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/**
* Copyright (c) 2018 - 2020, Nordic Semiconductor ASA
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form, except as embedded into a Nordic
* Semiconductor ASA integrated circuit in a product or a software update for
* such product, must reproduce the above copyright notice, this list of
* conditions and the following disclaimer in the documentation and/or other
* materials provided with the distribution.
*
* 3. Neither the name of Nordic Semiconductor ASA nor the names of its
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

zb_zcl_rel_humidity_measurement.c

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "zboss_api.h"
#include "zb_zcl_rel_humidity_measurement.h"
#include "app_error.h"
#include "nrf_log.h"
static zb_ret_t check_value_rel_humidity_measurement(zb_uint16_t attr_id, zb_uint8_t endpoint, zb_uint8_t * p_value)
{
zb_ret_t ret = ZB_FALSE;
zb_int16_t val = ZB_ZCL_ATTR_GETS16(p_value);
NRF_LOG_DEBUG("Pre-validating value %hi of Humidity attribute %d", val, attr_id);
switch(attr_id)
{
case ZB_ZCL_ATTR_REL_HUMIDITY_MEASUREMENT_VALUE_ID:
/* Check if the value is unknown. */
if (val != ZB_ZCL_ATTR_REL_HUMIDITY_MEASUREMENT_VALUE_UNKNOWN)
{
/* Check if the value is higher than the minimal allowed. */
zb_zcl_attr_t * p_attr_min_desc = zb_zcl_get_attr_desc_a(endpoint,
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

What i am doing wrong?