Hi,
I have been experimenting with an Arduino hooked up to an Xbee and have had some success getting it recognised by the hub. I have performed a device announce, endpoint report and simple descriptor which then gets the device to show in smartthings as a device.
I now wish to query the device to get the state of connected things to the Arduino (such as buttons, light sensors, motion sensors etc) and I am currently using zigbee.readAttribute in my device handler.
When I call zigbee.readAttribute I get a match descriptor request, is this normal?
I was expecting to receive a read attribute request.
I’m enjoying tinkering around with this project, but as you say, the learning curve is quite steep. I guess it wouldn’t be as much fun if it was too easy
I have set up the Arduino as a switch with a single endpoint of 0x08 and cluster types of 0x0000, 0x0003 and 0x0006.
In my Device Handler, i am performing a zigbee.readAttribute(0x0006, 0x01) to see what gets sent to the Arduino.
What I receive on the Arduino is a message with the following payload:
The 78 appears to be the sequence number and changes every request.
I’m guessing the 01 00 is the 16 bit little endian version of the 0x01 I am using in the readAttribute call.
I don’t know what the previous zero byte means as it it not mentioned in the Read Attributes Command frame format.
This then throws doubt in my mind that I am even looking at the right request type in the spec and that maybe it is not a Read Attribute Command.
Mathew, can you paste the entire packet in hex like you did above but for all bytes received. When the xBee is in API mode it will send your microprocessor data through the serial port as API data frames (packets of data with a check sum at the end). They all start with the hex number 0x7E. You will have to decipher what is in these packets to figure out what is going on. For example on page 155 and 156 of the xBee manual you can see the format of two of the common RX data packets.