# Raspberry pi stops sending data to influxdb when ethernet cable is disconnected

**URL:** https://discourse.nodered.org/t/raspberry-pi-stops-sending-data-to-influxdb-when-ethernet-cable-is-disconnected/58275
**Category:** General
**Created:** [13 February 2022 18:24 UTC](https://discourse.nodered.org/t/raspberry-pi-stops-sending-data-to-influxdb-when-ethernet-cable-is-disconnected/58275 "2022-02-13T18:24:44Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![Mufika](https://avatars.discourse-cdn.com/v4/letter/m/7ba0ec/32.png) [@Mufika](https://discourse.nodered.org/u/Mufika)
#### Post date: [13 February 2022 18:24 UTC](https://discourse.nodered.org/t/raspberry-pi-stops-sending-data-to-influxdb-when-ethernet-cable-is-disconnected/58275/1 "2022-02-13T18:24:44Z")

</div>

I have a sensor mounted on my raspberry pi (rpi) [64bit OS] and I use node red to collect data from the rpi serial port and send it to influxdb database installed on the rpi through a docker container. I've noticed that when I unplug the ethernet cable from the rpi, it stops the sending of data to influxdb. I see another post with a similar problem where it was recommended to put "localhost" in the influxdb node. I did as per below:

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/c/9ca30e53ac1810e1dec62e94319046d089be2130.png)

But then I get this error:

"FetchError: request to [http://localhost:8086/api/v2/query?org=Home](http://localhost:8086/api/v2/query?org=Home) failed, reason: connect ECONNREFUSED 127.0.0.1:8086".

I also notice that after running node red on the rpi for a while, my house network slows down considerably. The node red graphical UI also stops working. But when I disconnect the ethernet network cable from the rpi, the network is back up again.

---

<div class="post-metadata">

### Author: ![Mufika](https://avatars.discourse-cdn.com/v4/letter/m/7ba0ec/32.png) [@Mufika](https://discourse.nodered.org/u/Mufika)
#### Post date: [13 February 2022 18:26 UTC](https://discourse.nodered.org/t/raspberry-pi-stops-sending-data-to-influxdb-when-ethernet-cable-is-disconnected/58275/2 "2022-02-13T18:26:39Z")

</div>

Please note that I'm using the stachero influxdb v2 node.

---

<div class="post-metadata">

### Author: ![ghayne](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ghayne/32/39_2.png) [@ghayne](https://discourse.nodered.org/u/ghayne)
#### Post date: [13 February 2022 18:51 UTC](https://discourse.nodered.org/t/raspberry-pi-stops-sending-data-to-influxdb-when-ethernet-cable-is-disconnected/58275/3 "2022-02-13T18:51:26Z")

</div>

Why do you need to unplug the Ethernet cable?

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [13 February 2022 19:33 UTC](https://discourse.nodered.org/t/raspberry-pi-stops-sending-data-to-influxdb-when-ethernet-cable-is-disconnected/58275/4 "2022-02-13T19:33:53Z")

</div>

> [@Mufika](#):
>
> after running node red on the rpi for a while, my house network slows down

???

Have you done any analysis on what is using network traffic? Also, what do you mean - the network from the Pi slows down or ALL traffic on the network slows down?

> [@Mufika](#):
>
> But when I disconnect the ethernet network cable from the rpi, the network is back up again.

Then you need to look at what is happening on the network. I've run multiple instances of Node-RED on different platforms for years now without any network issues at all.

> [@Mufika](#):
>
> a docker container

Have you checked to make sure it isn't Docker causing issues?

> [@Mufika](#):
>
> it was recommended to put "localhost"

There shouldn't be any difference really between "localhost" and 127.0.0.1, they are the same thing.

> [@Mufika](#):
>
> reason: connect ECONNREFUSED 127.0.0.1:8086".

If InfluxDB is in a different Docker container then it won't be localhost, it will be something else depending on the Docker configuration.

---

<div class="post-metadata">

### Author: ![Mufika](https://avatars.discourse-cdn.com/v4/letter/m/7ba0ec/32.png) [@Mufika](https://discourse.nodered.org/u/Mufika)
#### Post date: [13 February 2022 19:34 UTC](https://discourse.nodered.org/t/raspberry-pi-stops-sending-data-to-influxdb-when-ethernet-cable-is-disconnected/58275/5 "2022-02-13T19:34:11Z")

</div>

The cable was actually unplugged [by mistake] in the morning. When I came back in the afternoon I could not connect and realised it was unplugged. I then noticed that data was not captured during the day. I plugged it back but 30min little later, I realised that my home network slowed down significantly. I also kept on loosing connection to the rpi as well. I intuitively unplugged the ethernet cable and my home network was up again. So for some reason the rpi is routing the data through the LAN ...

---

<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: [13 February 2022 21:37 UTC](https://discourse.nodered.org/t/raspberry-pi-stops-sending-data-to-influxdb-when-ethernet-cable-is-disconnected/58275/6 "2022-02-13T21:37:07Z")

</div>

What did you change it _from_ when you set it to localhost?

---

<div class="post-metadata">

### Author: ![Mufika](https://avatars.discourse-cdn.com/v4/letter/m/7ba0ec/32.png) [@Mufika](https://discourse.nodered.org/u/Mufika)
#### Post date: [13 February 2022 22:48 UTC](https://discourse.nodered.org/t/raspberry-pi-stops-sending-data-to-influxdb-when-ethernet-cable-is-disconnected/58275/7 "2022-02-13T22:48:57Z")

</div>

I changed it from 192.168.8.142

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [13 February 2022 23:00 UTC](https://discourse.nodered.org/t/raspberry-pi-stops-sending-data-to-influxdb-when-ethernet-cable-is-disconnected/58275/8 "2022-02-13T23:00:06Z")

</div>

> [@Mufika](#):
>
> 192.168.8.142

That is probably the lan address of your Pi. That's why your InfluxDB goes offline.

If it is running on the same Pi, you should be using localhost.

---

<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: [14 February 2022 06:54 UTC](https://discourse.nodered.org/t/raspberry-pi-stops-sending-data-to-influxdb-when-ethernet-cable-is-disconnected/58275/9 "2022-02-14T06:54:07Z")

</div>

With influx running in Docker is there something that has to be done to allow local access as localhost? Or does the container have an IP address?

---

<div class="post-metadata">

### Author: ![Mufika](https://avatars.discourse-cdn.com/v4/letter/m/7ba0ec/32.png) [@Mufika](https://discourse.nodered.org/u/Mufika)
#### Post date: [14 February 2022 10:43 UTC](https://discourse.nodered.org/t/raspberry-pi-stops-sending-data-to-influxdb-when-ethernet-cable-is-disconnected/58275/10 "2022-02-14T10:43:14Z")

</div>

Hey Colin. You are right. Good tip. Docker composer has created a network linking the various containers each with its own IP address. I put in the IP address of the influxdb container and it is now working. I can unplug my cable and no issues, it carries on recording. Problem solved.

---

<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: [14 February 2022 10:58 UTC](https://discourse.nodered.org/t/raspberry-pi-stops-sending-data-to-influxdb-when-ethernet-cable-is-disconnected/58275/11 "2022-02-14T10:58:35Z")

</div>

if you are using compose then it should also create it's own local dns lookup based on the name of the image - so you should be able to use that as well - in case the ip does change for some reason.

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [14 February 2022 17:09 UTC](https://discourse.nodered.org/t/raspberry-pi-stops-sending-data-to-influxdb-when-ethernet-cable-is-disconnected/58275/12 "2022-02-14T17:09:57Z")

</div>

That's what I told you in my first post.

---

<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: [15 April 2022 17:09 UTC](https://discourse.nodered.org/t/raspberry-pi-stops-sending-data-to-influxdb-when-ethernet-cable-is-disconnected/58275/13 "2022-04-15T17:09:59Z")

</div>

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