2

I have two XBee chips - one of them is connected to a relay switch, the other one - to my computer via USB cable.

I can configure the locally connected XBee to send its D0 value to the remote XBee, so that when I toggle the D0 line of the local XBee the remote relay switch toggles as well.

What I want to do is be able to send a command to the local XBee over its serial connection and have the local XBee send a command to the remote XBee that would toggle the relay switch without having to physically interact with the D0 line on my local XBee.

The XBees are S1, so they don't (seem to?) support ATIO command, at least my tests didn't show that working. I also tried using ATAP 1 with API command 83 as shown here but that didn't work.

The hardware setup works - attaching a button to D0 transmits its status to the remote XBee, so how do I get the same to happen with software alone?

Sten Petrov
  • 10,943
  • 1
  • 41
  • 61

2 Answers2

2

You need to send a "Remote AT Command" frame, for parameter ATD0, as described in this page on Digi's website.

Although that page is for the Series 2 radio modules, if you look at the documentation for the Series 1, you can find the frame format for a remote AT command.

And, if you're going to use C to send the command, this Open Source, portable, ANSI C XBee Host Library includes a function process_command_remote() in samples/common/_atinter.c to send a remote AT command.

tomlogic
  • 11,489
  • 3
  • 33
  • 59
  • Technically it should be working but I've been trying for a couple hours now with no success. Looking at the API console I can see a response frame (0x97) with status OK, but the remote LED doesn't change state. The LED changes state if line passing is configured – Sten Petrov Jun 12 '14 at 04:31
  • The article talks about configuring Coordinator and Router, how do I do that? – Sten Petrov Jun 13 '14 at 17:07
  • Sten, it sounds like you've established a network between your modules already, so it shouldn't be necessary to make changes to those settings. Also, the original article refers to Series 2 modules which use a different type of network configuration than the Series 1 modules you're using. I'd recommend reviewing the documentation for Series 1 and reading about "Remote AT Commands". – tomlogic Jun 15 '14 at 14:48
2

Finally figured it out, thanks for steering me in the right direction @tomlogic

The problem was that Digi's website doesn't tell you to set IA to 0xFFFF (allow all source addresses to change pin state), which by default is 0xFFFF FFFF FFFF FFFF (disable remote pin changes)

Found a better tip on this site.

This is what it looks like in XCTU for Mac: XCTU MAC

Here are all the settings that differ from defaults one I got it to work.

Transmitter: MY=7 AP=1 (API enabled) D0=3 (Pin 0 Input) IC=FF (Change detect all)

Receiver: MY=2 D0=5 (Pin 0 High Output) IU=0 (UART IO Disable) IA=0xFFFF (Allow all to change pins)

The commands I used:

7E 00 10 17 01 00 13 A2 00 AA BB CC DD FF FE 02 49 4F 00 8D - Send remote ATIO 0

7E 00 10 17 01 00 13 A2 00 AA BB CC DD FF FE 02 49 4F 01 8C - Send remote ATIO 1

Sten Petrov
  • 10,943
  • 1
  • 41
  • 61