Multiple communication interfaces on Node-red

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

Hi and welcome to the forum.

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

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

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.

Hello Steve,

Below is my ipconfig and route output on raspberry Pi
image

image

bdw, I tried removing the default gateway for 'eth0' interface and guess what, it worked! :smiley: 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)

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