Can't get SSC-32U to communicate properly with XBee

I am having trouble communicating with my SSC-32U board while using a pair of XBee S2C Pro devices. One XBee is connected to my Windows PC while the other is connected directly to the SSC-32U. I have attached a picture of my setup. It’s not complicated.

I used the XCTU utility to configure my XBee devices and they communicate between themselves when they are both connected to the USB port of my windows machine using XBee Explorer devices. I have written python code using the XBee Python Library and this works fine. I have only tested the simplest read and write functionality, as well as network discovery and the things like that.

Now for my problem. I have worked on this for many hours coming at it from many different directions. I suspect the problem is in how I have configured the XBee devices but I just don’t know. The following code snippet captures the issue:

device = XBeeDevice("COM7", 9600)
device.open()
xnet = device.get_network()
xnet.start_discovery_process()
while xnet.is_discovery_running():
    time.sleep(0.5)
    print("Discovering XBee Network!")
devices = xnet.get_devices()
print("Network discovered! There are ", len(devices), " devices.")

device.send_data(devices[0], "#1P2400T1000\r")
time.sleep(2)
device.send_data(devices[0], "#1P600T1000\r")
time.sleep(2)
answer = device.send_data(devices[0], "Q\r")
response = device.read_data(timeout=2)

device.close()

This works perfectly up until the query in the third last line. My servos move as expected. However, I’m not sure if the send_data command is received at the far end because the read_data command times out. This is just an example of my problem. To summarize:

I can write to the XBee connected to my computer, and the XBee connected to my SSC-32U receives the information perfectly and executes the command. However, the XBee on the SSC-32U never responds by sending any data back.

By the way, if I remove the XBee devices and connect through USB directly to the SSC-32U, the queries are always answered.

Let me know if you need any additional information.
thanks!

1 Like

Hey @D_Hertz!

Lets see if we can figure this one out…
First, we should go over some assumptions about the situation:

  1. Both XBee carrier boards are working and configured for 9600 baud rate. They are also configured to the same network. When used on a USB breakout with a XBee socket they can communicate with each other (how is that verified? Putty or some other terminal utility connected to each virtual port?)
  2. The SSC-32U is powered appropriately.
  3. The XBee on the SSC-32U can receive commands and transfer them successfully to the SSC-32U. This is confirmed by the RC servomotor on channel 1 moving from said commands.
  4. When trying to read a reply from the SSC-32U to a query (“Q” command), no reply is obtained (timeout after 2 s ?).

Here’s a few ideas to try out and see if you get different results:

  1. After line response = device.read_data(timeout=2), add another command to send out, such as #1P1500T1000 and see if the RC servomotor on channel 1 moves as expected.
  2. Swap the two XBees from SSC-32U and USB adapter. Try the sample code again and see if that changes the results.
  3. Check in XCTU the following settings: PAN ID, channel, source and destination (and any other addressing related settings). What are the values currently set? Please post screenshots for each.
  4. With XCTU can you use the XBee on the USB breakout board to detect the XBee on the SSC-32U? If so, please post a screenshot of this.
  5. With XCTU enter the “terminal” mode so you can send and receive commands from your USB breakout XBee and send a few commands to control the RC servomotor on channel 1. Does it moves as expected? If this works, then send a few query commands such as “VER”, “Q”, “VA”, etc. and see if you receive replies in the XCTU terminal interface.

Please let me know if I made any false assumptions (or forgot something important! :smiley: ) and if I didn’t (and everything seems complete) try the 5 steps above and post your results.

Sincerely,

1 Like

Thanks for the quick reply.

I started addressing the points within your response and it gave me a couple of ideas to try. It turned out that this was all that was required. I had set up my XBee devices in API mode so I could use the digi-python libraries. Once I converted them to AT mode, all was well. Everything now works as expected.

Can you confirm for me that the XBee devices must be operated in AT mode? If so, I’ll quit trying API.

thanks again!!

1 Like

Ah, interesting.

I have not personally used the API mode in any of my projects, so I couldn’t say. It may be possible that it works in API mode (clearly you were able to send data to the SSC-32U properly) but maybe some settings / methods were not setup right for it to allow receiving the data back.

I recommend that you look online for more examples. I have a strong feeling it should work but you are simply missing a small detail.

No problem and good luck!

Sincerely,

1 Like