I'm currently doing a project and trying to read some data from a MCU. The XBee I'm using is XBee3 Cellular LTE-M/NB-IoT.
The general process should be as follow:
1. xbee send 0x05 to MCU to wake up the MCU, and MCU will send 0x06 back.
2. xbee send a command to request some data from MCU and MCU will send a 9-byte data back.
this is the code I'm testing:
if ack!= None:
link = sys.stdin.read()
if link!= None:
send_com() is used to send a bytearray to MCU.
The first read is fine and I got ack = '\x06' as it supposed to be.
The second read should give me '\x01 0 0 \x03 F 0 5 3 \x04' but I got link = 'F 0 5 3 \x04' instead.
When I reduce the sleep time after 'send_com(L_E)', I got link = '\x01 0 0'.
I think I probably have some misunderstanding about the buffer. Can someone tell me where I did wrong? Or any helpful documentation recommend?
I appreciate for any answer.