Modbus TCP Client not connecting via Pi

Hi All,

I am trying to connect a my modbus client on Pi to my server on my S7. I initially set the modbus client up on my node red on my laptop which was working. I copied over the flow to my Pi and installed it into node red , exact same set up.

Im getting no response whatsoever just reconnecting after 2000 msec. Im not sure how to troubleshoot this as the setting havent been changed at all. The Pi is set up using wifi but Im concerned that potentially there is a block on IP ethernet connections.. which I dont know how to solve.

When I ping the ip of the server device from rasp pi cmd I get

PING ( 56(84) bytes of data.

Normally if I ping something it repeats this message as data is transferred constantly. Here all it does is show the one line then loading.... which suggests to me it could be to do with the actual ethernet setting on the Pi... any thoughts anyone?

Thank you in advance!

Not really a node-red question but the obvious questions...

  • Does pi have an IP in the same range with the same subnet mask?
    • i.e. does PI and PLC both have 192.168.10.x addresses and the same subnet mask?
  • Are the 2 devices connected to the same physical network?

Slightly different question - why use modbus and not S7 protocol?

  1. Yes I believe so , but how could I check this?

  2. Yes they are.

  3. Because for other functions I am using the PLC for I need to use Modbus

You can get the ip address of the pi using
ip addr

yes so the ip of the pi is but the server is on the ip address which is connected on the physical network as explained. I believe its down to the configuration of the ethernet connections on the pi

Can you ping the device from your laptop? Not all devices will respond to ping.
Can you ping the laptop from the Pi

A default Raspbian install would not block access but if you can ping the pi from the laptop but not the other way round then I think you must be correct.

1 Like

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