# How to connect a ttl to rs485 generic adapter with a raspberry pi 4 and node red (modbus)

**URL:** <https://discourse.nodered.org/t/how-to-connect-a-ttl-to-rs485-generic-adapter-with-a-raspberry-pi-4-and-node-red-modbus/69702>\
**Category:** General\
**Created:** [28 October 2022 02:30 UTC](https://discourse.nodered.org/t/how-to-connect-a-ttl-to-rs485-generic-adapter-with-a-raspberry-pi-4-and-node-red-modbus/69702 "2022-10-28T02:30:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![vra](https://avatars.discourse-cdn.com/v4/letter/v/e95f7d/32.png) [@vra](https://discourse.nodered.org/u/vra)\
**Post date:** [28 October 2022 02:30 UTC](https://discourse.nodered.org/t/how-to-connect-a-ttl-to-rs485-generic-adapter-with-a-raspberry-pi-4-and-node-red-modbus/69702/1 "2022-10-28T02:30:16Z")

</div>

Hi all, how are you?

I'm trying to connect a raspberry pi to a motogenerator controller through rs485 using a generic ttl to rs485 converter, this converter has 4 input pins on the ttl side: DE, RE, DI and RO, DE and RE are the pins to control direction of the data but I can't see any configuration on the modbus nodes to assign those pins to any gpio on the raspberry pi.

Is anything that I can use to confugure those signals or is better to buy a usb to rs485 adapter?

Thanks in advance for the help.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [28 October 2022 06:23 UTC](https://discourse.nodered.org/t/how-to-connect-a-ttl-to-rs485-generic-adapter-with-a-raspberry-pi-4-and-node-red-modbus/69702/2 "2022-10-28T06:23:57Z")

</div>

Welcome to the forum @vra

Unless the device comes with instructions for setting up on a pi then it would certainly be easier to use a usb adaptor, which should just work.

---

<div class="post-metadata">

**Author:** ![edje11](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/edje11/32/572_2.png) [@edje11](https://discourse.nodered.org/u/edje11)\
**Post date:** [28 October 2022 06:37 UTC](https://discourse.nodered.org/t/how-to-connect-a-ttl-to-rs485-generic-adapter-with-a-raspberry-pi-4-and-node-red-modbus/69702/3 "2022-10-28T06:37:54Z")

</div>

And if you choose for an other RS485 have a look for one that has automatic switch between RX and TX.

---

<div class="post-metadata">

**Author:** ![vra](https://avatars.discourse-cdn.com/v4/letter/v/e95f7d/32.png) [@vra](https://discourse.nodered.org/u/vra)\
**Post date:** [28 October 2022 11:06 UTC](https://discourse.nodered.org/t/how-to-connect-a-ttl-to-rs485-generic-adapter-with-a-raspberry-pi-4-and-node-red-modbus/69702/4 "2022-10-28T11:06:41Z")

</div>

Thanks @edje11 and @Colin for the help, in fact I was viewing a rs485 hat for a raspberry and they use a secondary and dip switches to enable/desable write/read on the interface.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [27 December 2022 11:07 UTC](https://discourse.nodered.org/t/how-to-connect-a-ttl-to-rs485-generic-adapter-with-a-raspberry-pi-4-and-node-red-modbus/69702/5 "2022-12-27T11:07:15Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
