# Subflow problem

**URL:** https://discourse.nodered.org/t/subflow-problem/12771
**Category:** General
**Created:** [1 July 2019 06:50 UTC](https://discourse.nodered.org/t/subflow-problem/12771 "2019-07-01T06:50:55Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![iungo](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/iungo/32/8099_2.png) [@iungo](https://discourse.nodered.org/u/iungo)
#### Post date: [1 July 2019 06:50 UTC](https://discourse.nodered.org/t/subflow-problem/12771/1 "2019-07-01T06:50:55Z")

</div>

I have a problem with i2c ADC in the subflow.

If I add a subflow with i2c device in flow, the first time it works fine, but after I remove the subflow and deploy, i2c still works.

Further - worse. If I add and remove subflow second time, I see have 2 subflows works simultaneously without any subflows in flow.

I made a small video with timeline comments to show the problem:

Hardware:  
Raspberry Pi zero W.  
Software:  
Node-RED version: v0.20.6  
Node.js version: v10.16.0  
Linux 4.19.42+ arm LE  
ncd-red-ads1115 v.1.2.6

Does anybody know how to solve this problem?

---

<div class="post-metadata">

### Author: ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)
#### Post date: [1 July 2019 07:17 UTC](https://discourse.nodered.org/t/subflow-problem/12771/2 "2019-07-01T07:17:29Z")

</div>

As it is most likely a problem with the contrib-node you are using ncd-red-ads1115, I would suggest opening an issue on the nodes github page ( you can follow a link from the nodes page on [flows.nodered.org](http://flows.nodered.org)). You can then communicate the issue directly with the author.

---

<div class="post-metadata">

### Author: ![iungo](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/iungo/32/8099_2.png) [@iungo](https://discourse.nodered.org/u/iungo)
#### Post date: [1 July 2019 07:21 UTC](https://discourse.nodered.org/t/subflow-problem/12771/3 "2019-07-01T07:21:53Z")

</div>

The problem is - why this node works if I haven't it in any flow?  
And why it stop work after restart node-red?

---

<div class="post-metadata">

### Author: ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)
#### Post date: [1 July 2019 07:22 UTC](https://discourse.nodered.org/t/subflow-problem/12771/4 "2019-07-01T07:22:45Z")

</div>

Which sounds like something the author should hear about...

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [1 July 2019 07:28 UTC](https://discourse.nodered.org/t/subflow-problem/12771/5 "2019-07-01T07:28:12Z")

</div>

It sounds like the node isn't closing correctly. When you hit deploy the node should stop running... but it doesn't appear to be doing that. So when the deploy starts another one - you then have two... etc. So yes please tell the author.

---

<div class="post-metadata">

### Author: ![iungo](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/iungo/32/8099_2.png) [@iungo](https://discourse.nodered.org/u/iungo)
#### Post date: [1 July 2019 07:42 UTC](https://discourse.nodered.org/t/subflow-problem/12771/6 "2019-07-01T07:42:13Z")

</div>

Ok, I will write author. Thank you

---

<div class="post-metadata">

### Author: ![iungo](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/iungo/32/8099_2.png) [@iungo](https://discourse.nodered.org/u/iungo)
#### Post date: [1 July 2019 09:44 UTC](https://discourse.nodered.org/t/subflow-problem/12771/7 "2019-07-01T09:44:38Z")

</div>

One more strange thing, if I add node ncd ads1115 directly to flow, all work fine and node closing correctly. (I deleted node from flow at 0:18 and after that I2C communication stops)

The problem is arise only when I add node to subflow.

Why does this happen?
