Home/Support/Support Forum/XBee3 micropython uart communication

XBee3 micropython uart communication

0 votes
Hi,

I am using XBee3 to communicate with a meter through RS485. Refer to https://www.digi.com/resources/documentation/Digidocs/90002219/#reference/r_uart_constants.htm?TocPath=Access%2520the%2520primary%2520UART%257C_____1, I access the uart via stdout.buffer.write() and stdin.buffer.read(). The meter able to receive modbus request that sent from XBee but the modbus response is not what I expected. I transmit the response to coordinator XBee to console out the reading as XBee3 modules only have one uart available. So I suspect by using stdin.buffer.read() method to read from uart is not safe as stdin stream will also contain other information that redirect to that stream. Am I correct?
asked Jan 13 in MicroPython by KhorCJ New to the Community (1 point)

Please log in or register to answer this question.

1 Answer

0 votes
No, these functions should work properly.
answered Jan 14 by mvut Veteran of the Digi Community (15,156 points)
Refer to this post's accepted answer https://www.digi.com/support/forum/74098/xbee3-access-serial-with-micropython-for-simplified-serial?show=76976#a76976 , it stated that stdout is unsafe. So the stdin response probably mess up due to this?
That would depend on which XBee 3 product you are working with. If you are using the XBee 3 Cellular, and you use the Micro Python UART, then no it is not an issue.
...