# Multiple communication interfaces on Node-red

**URL:** <https://discourse.nodered.org/t/multiple-communication-interfaces-on-node-red/55877>\
**Category:** General\
**Tags:** modbus, mqtt\
**Created:** [30 December 2021 08:49 UTC](https://discourse.nodered.org/t/multiple-communication-interfaces-on-node-red/55877 "2021-12-30T08:49:37Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rohitgdt](https://avatars.discourse-cdn.com/v4/letter/r/8c91f0/32.png) [@rohitgdt](https://discourse.nodered.org/u/rohitgdt)\
**Post date:** [30 December 2021 08:49 UTC](https://discourse.nodered.org/t/multiple-communication-interfaces-on-node-red/55877/1 "2021-12-30T08:49:37Z")

</div>

Hello everyone,

I'm trying to set up my Raspberry Pi to read data from a PLC over Modbus TCP and sending this data over to cloud using MQTT. Now, I'm able to read the data from PLC and send the same to the cloud using MQTT separately. However, when I try to do both the things i.e. reading data over MB and sending over MQTT, it doesn't work. Could anyone help me with this, please?

Here's a configuration of my setup:

1. PLC (192.168.0.113)- MB TCP Slave
2. RP Ethernet (192.168.0.120) - MB TCP Master  
RP WiFi (192.168.1.170)
3. Wifi Router (192.168.1.254) - connected to Internet

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [30 December 2021 08:55 UTC](https://discourse.nodered.org/t/multiple-communication-interfaces-on-node-red/55877/2 "2021-12-30T08:55:23Z")

</div>

Hi and welcome to the forum.

> [@rohitgdt](#):
>
> I'm able to read the data from PLC and send the same to the cloud using MQTT separately. However, when I try to do both the things i.e. reading data over MB and sending over MQTT, it doesn't work

This sentence seems contradictory - could you try to clarify please?

---

<div class="post-metadata">

**Author:** ![rohitgdt](https://avatars.discourse-cdn.com/v4/letter/r/8c91f0/32.png) [@rohitgdt](https://discourse.nodered.org/u/rohitgdt)\
**Post date:** [30 December 2021 09:16 UTC](https://discourse.nodered.org/t/multiple-communication-interfaces-on-node-red/55877/3 "2021-12-30T09:16:26Z")

</div>

Thanks Steve for your response!

1. when I connect Ethernet cable b/n PLC and Raspberry Pi - I can read PLC data via Modbus
2. when I disconnect the Ethernet cable - MQTTout node sends the data to cloud. It shows status as 'Connected'
3. when I connect the Ethernet cable back - I can read PLC data via Modbus but MQTTout node turns to 'Disconnected' status and stops the comm with the cloud

So, in short when I try to do both (Modbus and MQTT) connections at a time, MQTTout node loses it's connection with the Cloud. Hope, I explained it clearly

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [30 December 2021 11:31 UTC](https://discourse.nodered.org/t/multiple-communication-interfaces-on-node-red/55877/4 "2021-12-30T11:31:24Z")

</div>

I guessed that was the issue but you omitted the info (and I didn't want to assume)

You issue is most likely not with node-red but with networking.

Can you show us what `ifconfig` and `route` outputs?

PS: If you are using the Ethernet/LAN for a single subnet, you can remove the default gateway from it and everything should just work.

---

<div class="post-metadata">

**Author:** ![rohitgdt](https://avatars.discourse-cdn.com/v4/letter/r/8c91f0/32.png) [@rohitgdt](https://discourse.nodered.org/u/rohitgdt)\
**Post date:** [30 December 2021 16:08 UTC](https://discourse.nodered.org/t/multiple-communication-interfaces-on-node-red/55877/5 "2021-12-30T16:08:39Z")

</div>

Hello Steve,

Below is my ipconfig and route output on raspberry Pi  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/a/aacfbaf81ab08aa71367d90811a039de310deacf.png)

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/7/5720d88dcdb9f150579a13949c45f4bca9e6fb13.png)

bdw, I tried removing the default gateway for 'eth0' interface and guess what, it worked! 😃 I'm grateful for your support, Thanks a lot!  
But I still don't understand, having different subnets for 'wlan0' and 'eth0', it should work just fine. How does removing default gateway can help? (sorry for a network specific question on this forum, but I'm kind of newbie in this area)

---

<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:** [17 January 2022 09:42 UTC](https://discourse.nodered.org/t/multiple-communication-interfaces-on-node-red/55877/6 "2022-01-17T09:42:36Z")

</div>

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