# Node Red server connection lost connecting IOT2040 to S7-1200

**URL:** https://discourse.nodered.org/t/node-red-server-connection-lost-connecting-iot2040-to-s7-1200/35637
**Category:** Industrial
**Created:** [9 November 2020 23:06 UTC](https://discourse.nodered.org/t/node-red-server-connection-lost-connecting-iot2040-to-s7-1200/35637 "2020-11-09T23:06:27Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Dedoyler](https://avatars.discourse-cdn.com/v4/letter/d/f0a364/32.png) [@Dedoyler](https://discourse.nodered.org/u/Dedoyler)
#### Post date: [9 November 2020 23:06 UTC](https://discourse.nodered.org/t/node-red-server-connection-lost-connecting-iot2040-to-s7-1200/35637/1 "2020-11-09T23:06:27Z")

</div>

Hi Guys,

I'm having problems with a simple flow reading data from my non-optimized DB1,WORD0 using an S7 1200 with V14 SP1. I am using the S7 In node connected to a debug node (Msg.Payload).

When my string is deployed the indicator on the "S7 In" node turns yellow(connecting) then a message appears "Lost connection to server". I have deleted the flow numerous times from the IOT2040 and set it up again but I kept having the same problem.

On a previous test program I had no connection problems and communication was fine, I was able to send and receive data to the PLC. I have also tried to change the IP address, to no avail.  
I have tried a factory reset on the PLC, created new program and reuploaded the image for the IOT and installed the S7 library, but I still have the same issue as seen in the log report below. I have also changed cables and switch ports.

In order to access node red again i have to delete the flows.

See script and Node red log below.  
I'm very new to this so any help is much appreciated.  
Regards.

[{"id":"10146917.7654c7","type":"s7 in","z":"b469084f.726ab8","endpoint":"4d278213.c75a8c","mode":"single","variable":"OUT","diff":true,"name":"","x":110,"y":80,"wires":[["2f3e1868.683a68"]]},{"id":"4d278213.c75a8c","type":"s7 endpoint","z":"","transport":"iso-on-tcp","address":"192.168.0.3","port":"102","rack":"0","slot":"1","localtsaphi":"01","localtsaplo":"00","remotetsaphi":"01","remotetsaplo":"00","connmode":"rack-slot","adapter":"","busaddr":"2","cycletime":"5000","timeout":"2

Node Red Log:  
9 Nov 22:11:02 - [info] Starting flows  
9 Nov 22:11:02 - [info] Started flows  
9 Nov 22:18:05 - [info] Stopping flows  
9 Nov 22:18:05 - [info] Stopped flows  
9 Nov 22:18:05 - [info] Starting flows  
9 Nov 22:18:06 - [info] Started flows  
9 Nov 22:18:06 - [error] [s7 out:bde46f5e.59633] Error: Not connected  
9 Nov 22:18:06 - [red] Uncaught Exception:  
9 Nov 22:18:06 - TypeError: stream.off is not a function  
at ISOOnTCPClient.isoOnTcp.createConnection (/usr/lib/node\_modules/node-red- contrib-s7/node\_modules/@st-one-io/nodes7/src/s7endpoint.js:207:24)  
at Object.onceWrapper (events.js:313:30)  
at emitNone (events.js:106:13)  
at ISOOnTCPClient.emit (events.js:208:7)  
at process.nextTick (/usr/lib/node\_modules/node-red-contrib-s7/node\_modules/ iso-on-tcp/src/client.js:193:45)  
at \_combinedTickCallback (internal/process/next\_tick.js:132:7)  
at process.\_tickCallback (internal/process/next\_tick.js:181:9)

---

<div class="post-metadata">

### Author: ![machadotiago](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/machadotiago/32/23776_2.png) [@machadotiago](https://discourse.nodered.org/u/machadotiago)
#### Post date: [10 November 2020 01:31 UTC](https://discourse.nodered.org/t/node-red-server-connection-lost-connecting-iot2040-to-s7-1200/35637/2 "2020-11-10T01:31:33Z")

</div>

Hello,  
a few questions:

- can you ping the PLC from yout IOT2040?
- is the Put/Get checkbox enabled in the PLC?
- did you configure Rack 0 Slot 1 in your node-red flow?

Could you please post your flow again here? It seems that the flow you pasted here is not complete.

---

<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 November 2020 07:13 UTC](https://discourse.nodered.org/t/node-red-server-connection-lost-connecting-iot2040-to-s7-1200/35637/3 "2020-11-10T07:13:45Z")

</div>

Also can you show the start of the node red startup log please.

---

<div class="post-metadata">

### Author: ![Dedoyler](https://avatars.discourse-cdn.com/v4/letter/d/f0a364/32.png) [@Dedoyler](https://discourse.nodered.org/u/Dedoyler)
#### Post date: [10 November 2020 20:29 UTC](https://discourse.nodered.org/t/node-red-server-connection-lost-connecting-iot2040-to-s7-1200/35637/4 "2020-11-10T20:29:46Z")

</div>

Hi Guys,  
The problem is resolved.  
I installed the S7 node via "Manage Palette" in which it installs the version 3.0.0-beta.3. There must some problem with this.  
I re-uploaded the image and installed V2.2.1 through the terminal with "npm install -g node-red-contrib-s7@2.2.1" and I'm back in business.  
I had also posted the problem on the Siemens forum and one the technical experts assisted me.

Regardless, thank you for taking the time to respond to my query.

---

<div class="post-metadata">

### Author: ![machadotiago](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/machadotiago/32/23776_2.png) [@machadotiago](https://discourse.nodered.org/u/machadotiago)
#### Post date: [12 November 2020 11:13 UTC](https://discourse.nodered.org/t/node-red-server-connection-lost-connecting-iot2040-to-s7-1200/35637/5 "2020-11-12T11:13:21Z")

</div>

Hey @Dedoyler,  
great that you manage to solve the problem!  
I'm part of ST-One, the company who developed this S7-Node. Could you please send me your Node (and Node-RED) versions number?  
I see that you are running this on a IoT2040 and we only support users of our own hardware ([ST-One](https://st-one.io/st-one)), not generic hardwares, but anyway, we would like to simulate your problem here in our environment.

---

<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: [26 November 2020 11:13 UTC](https://discourse.nodered.org/t/node-red-server-connection-lost-connecting-iot2040-to-s7-1200/35637/6 "2020-11-26T11:13:23Z")

</div>

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