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

Zigbee Attribute request and response

Hi and happy new year everyone,

I am a developer for Raytheon Anschütz GmbH in Kiel Germany and working on a Zigbee mesh sensor network. Unfortunately I am an absolute beginner for Zigbee and have a lot of basic questions I can not figure out the the documentation. 

My goal is to provide temperature and voltage level from a router to the coordinator. The coordinator should request the values within an interval. 

I took the Zigbee light switch example as a base and included the temp_measurement zcl for the router. What I understood from the zcl documentation a general attribute request is needed to receive the values. 

I created a readTemp() function where I set up the read attribute request according to the documentation here https://www.nordicsemi.com/DocLib/Content/SDK_Doc/Thread_SDK/v2-0-0/group__read__attr__command

Unfortunately I am not sure if I did everything correct as I do not receive any data. For example I do not understand what the cmd_ptr. is for. Should I fill it or is it filled the the response. Did I call the ZB_ZCL_CLUSTER_ID_TEMP_MEASUREMENT_SERVER_ROLE_INIT()  and ZB_ZCL_CLUSTER_ID_TEMP_MEASUREMENT_CLIENT_ROLE_INIT(), correctly?

For the el_measurement zcl I wonder how to add the DC_Volt attribute to the attribute list as the Makro ZB_ZCL_DECLARE_ELECTRICAL_MEASUREMENT_ATTRIB_LIST contains only the measurement_type and dcpower attribute. 

I attached the code for the router and coordinator and hope you can help me with a simple request as I am stucked and do not know how I can solve it on my own. 

Thank you in advance for your help. 

Best regards

Marco Runge

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/**
* Copyright (c) 2018, 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
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/**
* Copyright (c) 2018, 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
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX