Page 1 of 1

XBee Problematic 2-way Comms

Posted: Wed Dec 20, 2017 3:58 am
by ojc
I've been stuck trying to find the solution to this problem for quite a while even though it's a simple fix:

Problem – I can send messages to my PC ok, however my Beaglebone doesn’t register any messages I try to send to it. When I try I get weird behaviour : the xbee attached to the PC seems to receive the messages it sent - this is from the XCTU console on the PC:

hello this is BBB
hello this is BBB

hello this is PC

hello this is PC

I’m running x2 XBee Pro S1’s
XBee_PC is attached to my PC via a sparkfun Xbee Explorer
XBee_BBB is attached to the UART2 port on my Beaglebone Black rev C by x4 wires – RX, TX, GND, 3.3V (setup includes decoupling cap)
Xbee Settings:
CH - Channel C C
ID - Pan ID 123 123
DH 0 0
DL 2 1
MY 1 2
CE End Device [0] Coordinator [1]

The program on the Beaglebone is as shown below – it pauses at ‘waiting for message’ even when I send messages to it from XCTU ( doesn't return anything either)

Code: Select all

import Adafruit_BBIO.UART as UART
import serial
from time import sleep

ser = serial.Serial(port="/dev/ttyO2", baudrate=9600)

msg = 'hello this is BBB \n'
print 'attempting to send message... '
for i in range(2):

while True:
     print 'waiting for message... '
          data = ser.readline()
          print data
     except Exception as e: print(e)
     except KeyboardInterrupt: