XBee3 Modbus RS485

is it possible to do Modbus RTU / RS485 Communication via Micropython on XBee3 Pro?

There’s the D7 (DIO7) setting that enables RS-485 communication either idle high or idle low. But I cannot find any documentation on how to send and receive the hex commands.

I assume that this must all be done via the primary UART serial line (the only one for XBee3) and using a logic level converter (for higher voltage on the slave RS-485 lines).

Been searching with combinations of “xbee, micropython, modbus rs-485”. Only thing I can find is a micropython-modbus library which requires “from machine import UART” which XBee3 doesn’t have.

Any help is appreciated. Thank you.

I don’t think you will be able to via Micro Python but via the UART it should work.

I’m currently trying via XCTU to send hex requests via UART + logic level converter. No answer.

just can’t figure out what to do with that answer.

I think you need to look at https://www.digi.com/support/knowledge-base/modbus-protocol

I would suggest using the Assemble packet function in XCTU to send your data packets with.

Actually I didn’t want to do Modbus over RF. I am thinking of the XBee as a MC that I want to use as a Modbus Master using Micropython. The results will than be pushed over the RF network.

I do not know if that is possible. You would have to create the code first and see if it is small enough to run on the XBee or not.