Connecting xbee with Beaglebone green


I want to use Pybbio library with xbee library to receive data through UART pins.

Is there any one who can help me for this.

I tried something like

from bbio import *
from xbee import XBee

def setup():

def loop():
if Serial2.available():

xbee= XBee(

z= xbee.wait_read_frame()
print z
run(setup, loop)