I have made a small setup on a Raspberry pi 1B (RPI), where I read a temperature from a DS18B20 and using Node-red, I store it in an Influx DB. I have also installed Grafana to display the collected data from a computer.
I have set a static ip for my RPI.
Inside the influxdb node, I had entered the database address as the static IP I have set for my RPI.
Everything was working well until I disconnected the ethernet cable. After connecting again a day later, I realised that no data had been stored while the ethernet cable had been disconnected.
In the RPI cmdLine I checked node-red-log and it generates the following error when unplugging the ethernet cable:
10 Sep 13:00:56 - [error] [influxdb out:543e9e17.2a674] Error: connect ENETUNREACH 10.0.0.200:8086 - Local (0.0.0.0:0)
I have now replaced the ip address in the Influxdb node with "localhost" and everything works.
My newbie question here is: Should I avoid filling in the static IP and always just use localhost for InfluxDB, Node-red and Grafana? Or is the IP the "correct" way to go (except in the Influxdb-node
Thanks for any advice