-
Notifications
You must be signed in to change notification settings - Fork 98
Description
My Code is
from digi.xbee.devices import XBeeDevice
from digi.xbee.util import utils
def my_data_received_callback(xbee_message):
address = xbee_message.remote_device.get_64bit_addr()
data = xbee_message.data.decode("utf8")
print("Received data from %s: %s" % (address, data))
try:
device = XBeeDevice("/dev/ttyAMA0", 9600)
device.open()
device.set_parameter("CE", utils.int_to_bytes(1))
device.add_data_received_callback(my_data_received_callback)
except XBeeException as error:
print "Error" + str(error)
I am getting this error
Traceback (most recent call last): File "poc.py", line 1, in <module> from digi.xbee.devices import XBeeDevice File "/usr/local/lib/python2.7/dist-packages/digi/xbee/devices.py", line 21, in <module> import serial File "/usr/local/lib/python2.7/dist-packages/digi/xbee/serial.py", line 15, in <module> from serial import Serial, EIGHTBITS, STOPBITS_ONE, PARITY_NONE ImportError: cannot import name Serial
Please help.
I have installed digi-xbee and pyserial but still having an issue.