This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Difference between AF_DATA_REQUEST and ZB_DATA_REQUEST

Other Parts Discussed in Thread: Z-STACK

Hi,

I am new in this forum, and I am new using Zigbee technologies as well. I have been reading Z-Stack Monitor and Test API, ZCL and Home Automation Profile documentation and I have some doubts about this.

I have a coordinator with Z-Stack plugged in my USB PC port. I would like to control the different messages by JAVA application manager (by sending MT_commands through the USB port)-

How can I send a messege to a Zigbee Temperature Sensor for example to request the current value? Do I have to use AF_DATA_REQUEST or  do I have to use ZB_DATA_REQUEST? What is the difference?My goal is to create a message from my JAVA application and send it to the USB port in order to send a message via RF through the coordinator.

By the way, is there any document to see examples about how to use Z-Stack Monitor and Test API?


Thank you in advance

Regards


David

 

 

  • Shockingly - I myself cannot find the "Z-Stack Monitor and Test API" document (SWRA198) here on the TI website and I see that it was not included in the Z-Stack 2.3.0 release ... shame on us (or, unfortunately, power to our competitors?). Anyway, attaching a rogue copy for your sanity-saving consumption. Also, you can study the S/W in MT.h, MT_RPC.h, and the related MT module, specifically MT_AF.c to see how your Java app should package the serial message to your ZigBee solution via MT messages. To get something special from the application that you have running, you'll probably want to code up (for instance, that "get temperature" request) as a MT_APP_MSG request with a MT_APP_RSP response.

     

     

    Z-Stack Monitor and Test API.pdf
  • Thank you very much for your answer but I have some doubt. I am sorry for this question but I am newbye in this.

    if I want to translate my "getTemperaturefromSensor" from my application to a MT_Command, since I would like to send a message to know the MeasuredValue attribute  I would create in my application a set of bytes to send as defined in APP_MSG (SREQ), where I would write the EndPoint (which is defined  by the manufacturer in my device for this cluster) , I would fix the address, and clusterID, but I do not know what I have to put in the MESSAGE FIELD (0-128 bytes) in order to ask for the MeasuredValue, what do I have to write in this field?

    By the way, what should I receive in the coordinator as answer? Since If I read Z-Stack Monitor and Test Api, MT_APP Callback is writen NONE, and on the other hand in APP_MSG (RSP) there is no field for DATA, so what should I expect from the response?

     

    Thank you in advance

     

     

  • Hello David,

    If you're using Home Automation profile, then you are using ZigBee Cluster Library. ZCL specifies data format, how data is requested, how to respond etc. I would suggest you start from there.

    Regards,

    Lasse

  • Hi Lehonkos,


    I have read ZCL commands but I do not understand how to specify a command to get the MeasuredValue from a Temperature sensor. If I use Read Attribute command and Temperature Measurement cluster, I could specify in a Read Attribute message 0x0000 in the Attribute field, but my question is, what I have to send though the serial port in order that my Coordinator (which is using Z-Stack) translate this message into a Read MeasuredValue request? I do not see any direction field or cluster identifer in the Read Attribute format so I can't understand how this traslation of messages is done and how it is possible without specifying neither a address nor a cluster field to send the request to the right place.

     

    Thank you in advance

  • Hi David,

    ZCL frames are sent in the payload of APS frames. So you still have an address, an endpoint etc. in the packet.

    I really haven't used M&T API, so I don't know how to use it. I just use UART to send my "own" commands. I don't know how much features of M&T you need, but you could just send something like "0x01 0xFE 0x12" which would mean "read information from node 0xFE12". The coordinator could generate the actual packat that is sent via the radio.

     

    Hope that helps,

    Lasse

  • Hi Lasse,

    Thank you for your answer,

    Maybe I do not need to use the MT_Commands, since  I just need a set of basic operation as written below:

    - Send a attribute request : (I guess it would be a Read Attribute message for  a sensor measurement or  Write Attrribute for Changing the value of attribute (actuators).

    - Send bind request from Coordinator:

    - Send

    Does this depend on the coordinator firmware? I mean, I thought how a coordinator interprets the data coming from the USB depended on this coordinator's firmware, isn't it so?

     

    Could you please tell me what I should send through the serial port in order to request a Temperature Measure from the sensor via a coordinator connected in USB port?

    Cluster ID : Temperature MEasurement-->0x0403

    Attribute ID: MeasuredValue --> 0x0000

    Read Attribute -> 0x00

    EndPoint -> (from my Temperature Sensor's manufacturer)--> 0x03

     

    Thank you in advance and I am sorry to do so many questions but I did not know that you could used another thing different to MT_Commands.

    David

     

     

  • Hello again,

    Yes, you are right, how the data is handled depends on the code. The solution I mentioned means that you have to decide and code yourself how the system reacts to different messages. For example simple IF:

     

     

    if ( ReceivedByte == '1')

     {

      // Initiate an End Device Bind Request (ZDP_EndDeviceBindReq)

    }

    else if (ReceivedByte == '2')

    {

    //Send a message to binded device

    }

     

     

    If you don't need to change message parameters like clusterid etc. then you can hardcode them in the coordinator, but you can also use some kind of more complex message (edit. from the pc though USB/UART). The message from pc could be something like "cmdbyte+parambyte1+parambyte2"

    But as I said, I haven't used the Monitor and Test API, so there's probably some kind of command to do these things. You have to decide which way is more convenient to you, learning to use the M&T API or doing these by hand. Edit: If you are familiar with coding for ZB chips then it's pretty fast to code a couple of simple commands and you know exactly what the command does, but the more complex system you want, the more coding you need to do... ;)

     

    Regards,

    Lasse

  • Hi Lasse,


    Since I am not able to modify the Coordinator's firmware, I think I just can use MT_Commands as the manufacturer specifies in the coordinator's documentation.Now I have to find which commnad I have to use for requesting Temperature Measurement.

    Thank you very much for your help and I will continue looking in MT documentation.


    Regards

    David

  • it is useful for me 

    thanks.