0

I am using XBee module to communicate between a PC and a Raspberry Pi. I wrote following code:

PC:

import serial
ser=serial.Serial(1) #opened COM2
ser.baudrate=9600
ser.open()
ser.write('hello')

Raspberry Pi:

import serial
ser=serial.Serial('/dev/ttyAMA0',9600)
ser.open()
ser.read()

I can see that transmission led on the XBee on PC side is glowing and detecting the network, and if I short Tx, Rx on RasPi side I get the loopback, but I don't get any values when I run the second code on RasPi. I am using AT mode, both configured as routers.

1 Answer 1

2

I made a silly mistake. I should have connected Rx(of receiver) to Rx of Pi and Tx also in the same way. It was my fault.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.