1

I'd like to get the states of the relays on the board from the relay, but I can get only ACK back.

I have two XBee modules, one is connected to a computer with USB, and acts as a Serial device, the other is connected to a TOSR0X-T relay. I am planning to add more XBee modules to the network with more relays later, so I am using API mode, not the simple AT mode, because I need to address them separately.

I am sending TX frames with 64bit address to the remote XBee to open or close relays. That works fine, I get the ACK response frames properly. However if I send a message to get the relay states by sending 0x5B, I get back an ACK only, and I can find no way to get the actual data back indicating the relay states.

I am using node-serialport and the X-CTU software, but could not read the data, and the only example I found used both XBees connected to the same machine - that way an RX appeared on the destination XBee - but I need to get that remotely somehow.

TOSR0X-T documentation here only tells me about talking to it via TX messages, so I have no clue if I can achieve anything with commands (and how to do that).

István Rábel
  • 462
  • 4
  • 13

2 Answers2

1

The ACK you're seeing is likely the network-layer ACK, telling you that the remote XBee module received your packet. You need to use "AT mode" on the XBee connected to the TOSR0X-T, and address your TX API frames correctly for that mode (cluster 0x0011 of endpoint 0xE8).

If you've configured the XBee on your computer as the coordinator, the default settings of 0 for DH and DL on the relay's XBee module will result in all received serial bytes getting relayed back to the XBee on your computer, and coming through as RX frames.

tomlogic
  • 11,489
  • 3
  • 33
  • 59
  • But will that be possible to use more then two XBees in AT mode? Having one coordinator attached to a computer, and two others attached to relays. When I am sending an open message, I want to specify which XBee's relay should open. Will TX packet with 16 or 64 bit addressing work in such case? - Can you ellaborate more on addressing the frames - or guide me to some documentation? – István Rábel Jul 12 '16 at 06:53
  • Yes, you can have multiple XBee modules in AT mode. They'll send their data back to the coordinator, and you'll receive frames that include the address of the remote device, so you'll know who sent the data. And your TX packets can use either the 16-bit or 64-bit address of the remote module, just as you're doing now. And I believe the cluster and endpoint information are only used in the "transmit explicit" frame, so I don't think you need to do much more on your coordinator end. – tomlogic Jul 12 '16 at 07:03
  • That sounds great! I'll check it out later today when I got home. Thank you very much. – István Rábel Jul 12 '16 at 07:36
  • I think I am missing something vital here. I can not make it work. Now I have a coordinator attached to the computer in API mode, and an endpoint attached to the relays in AP (not API) mode. I am sending TX frames (0x00) to the 64 bit address with the byte value for command, and the same happening. Cluster and Endpoint you mentioned are only coming up with 0x10 and 0x11 type frames (Transmit request and Explicit Addressing Command Frame) but they are not even an option for 802.15.4 protocol according to XCTU. Can you by any chance drop me some sample frames I should try? – István Rábel Jul 12 '16 at 17:02
0

After some experiments I could solve my problem.

Considering the CH (Channel) and ID (PAN ID) are matching - that is a requirement to be able to set up the network, I set up my XBees like this:

The Coordinator XBee (the one attached to the computer):

CE = 1 (for being coordinator)
MY = 0001
DH = 0
DL = 0
AP = 1 (in API mode)

The first End Point (the one attached to the TOSR0X-T):

CE = 0 (for being an endpoint)
MY = 000A (whatever you want), use FFFF for 64 bit responses
DH = 0
DL = 0001 (This is one I missed. It should be the Coordinator's MY)
AP = 0 (in AP mode)

So basically I did everything right, except the DH/DL addressing. For the Endpoint the DL must be set to the MY of the Coordinator. I read some articles where using FFFF and FFFE and things like that to set broadcasting, and I think I was confused by those informations.

István Rábel
  • 462
  • 4
  • 13