# Modbus TCP Client not connecting via Pi

**URL:** <https://discourse.nodered.org/t/modbus-tcp-client-not-connecting-via-pi/42414>\
**Category:** General\
**Created:** [10 March 2021 13:43 UTC](https://discourse.nodered.org/t/modbus-tcp-client-not-connecting-via-pi/42414 "2021-03-10T13:43:59Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![edwardr](https://avatars.discourse-cdn.com/v4/letter/e/e0b2c6/32.png) [@edwardr](https://discourse.nodered.org/u/edwardr)\
**Post date:** [10 March 2021 13:44 UTC](https://discourse.nodered.org/t/modbus-tcp-client-not-connecting-via-pi/42414/1 "2021-03-10T13:44:00Z")

</div>

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.

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

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

PING 192.168.10.120 (192.168.10.120) 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!

---

<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:** [10 March 2021 13:53 UTC](https://discourse.nodered.org/t/modbus-tcp-client-not-connecting-via-pi/42414/2 "2021-03-10T13:53:21Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![edwardr](https://avatars.discourse-cdn.com/v4/letter/e/e0b2c6/32.png) [@edwardr](https://discourse.nodered.org/u/edwardr)\
**Post date:** [10 March 2021 14:03 UTC](https://discourse.nodered.org/t/modbus-tcp-client-not-connecting-via-pi/42414/3 "2021-03-10T14:03:38Z")

</div>

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

---

<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:** [10 March 2021 15:09 UTC](https://discourse.nodered.org/t/modbus-tcp-client-not-connecting-via-pi/42414/4 "2021-03-10T15:09:26Z")

</div>

You can get the ip address of the pi using  
`ifconfig`  
or  
`ip addr`

---

<div class="post-metadata">

**Author:** ![edwardr](https://avatars.discourse-cdn.com/v4/letter/e/e0b2c6/32.png) [@edwardr](https://discourse.nodered.org/u/edwardr)\
**Post date:** [10 March 2021 15:12 UTC](https://discourse.nodered.org/t/modbus-tcp-client-not-connecting-via-pi/42414/5 "2021-03-10T15:12:12Z")

</div>

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

---

<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:** [10 March 2021 15:21 UTC](https://discourse.nodered.org/t/modbus-tcp-client-not-connecting-via-pi/42414/6 "2021-03-10T15:21:17Z")

</div>

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.

---

<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:** [9 May 2021 15:21 UTC](https://discourse.nodered.org/t/modbus-tcp-client-not-connecting-via-pi/42414/7 "2021-05-09T15:21:46Z")

</div>

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