# XBee3 Modbus RS485

**URL:** <https://forums.digi.com/t/xbee3-modbus-rs485/23139>\
**Category:** XBee - 802.15.4\
**Tags:** micropython, modbus, rs-485\
**Created:** [June 29, 2022, 9:27am UTC](https://forums.digi.com/t/xbee3-modbus-rs485/23139 "2022-06-29T09:27:17Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![lambu0815](https://avatars.discourse-cdn.com/v4/letter/l/b9e5f3/32.png) [@lambu0815](https://forums.digi.com/u/lambu0815)\
**Post date:** [June 29, 2022, 9:27am UTC](https://forums.digi.com/t/xbee3-modbus-rs485/23139/1 "2022-06-29T09:27:17Z")

</div>

Hi,  
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.

---

<div class="post-metadata">

**Author:** ![mvut](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.digi.com/mvut/32/31_2.png) [@mvut](https://forums.digi.com/u/mvut)\
**Post date:** [June 29, 2022, 1:12pm UTC](https://forums.digi.com/t/xbee3-modbus-rs485/23139/2 "2022-06-29T13:12:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![lambu0815](https://avatars.discourse-cdn.com/v4/letter/l/b9e5f3/32.png) [@lambu0815](https://forums.digi.com/u/lambu0815)\
**Post date:** [June 30, 2022, 8:06am UTC](https://forums.digi.com/t/xbee3-modbus-rs485/23139/3 "2022-06-30T08:06:23Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![lambu0815](https://avatars.discourse-cdn.com/v4/letter/l/b9e5f3/32.png) [@lambu0815](https://forums.digi.com/u/lambu0815)\
**Post date:** [June 30, 2022, 8:05am UTC](https://forums.digi.com/t/xbee3-modbus-rs485/23139/4 "2022-06-30T08:05:39Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mvut](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.digi.com/mvut/32/31_2.png) [@mvut](https://forums.digi.com/u/mvut)\
**Post date:** [June 30, 2022, 8:11am UTC](https://forums.digi.com/t/xbee3-modbus-rs485/23139/5 "2022-06-30T08:11:25Z")

</div>

I think you need to look at [https://www.digi.com/support/knowledge-base/modbus-protocol](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.

---

<div class="post-metadata">

**Author:** ![lambu0815](https://avatars.discourse-cdn.com/v4/letter/l/b9e5f3/32.png) [@lambu0815](https://forums.digi.com/u/lambu0815)\
**Post date:** [June 30, 2022, 9:07am UTC](https://forums.digi.com/t/xbee3-modbus-rs485/23139/6 "2022-06-30T09:07:47Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![mvut](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.digi.com/mvut/32/31_2.png) [@mvut](https://forums.digi.com/u/mvut)\
**Post date:** [June 30, 2022, 9:17am UTC](https://forums.digi.com/t/xbee3-modbus-rs485/23139/7 "2022-06-30T09:17:28Z")

</div>

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.
