EMFILE Error with Influxdb

#1

Hi

I am trying to write some data to an influxdb database but I am getting an EMFILE error which I cant seem to understand. Does anyone have any ideas?

Here is a screenshot of the relevant parts of my flows along with the error showing from the debug node (I have blanked out the IP address of the server running the database other than the port number which is 8086).

I know influxdb expects a very specific format for input which I think I have correct so I suspect it has something to do with trying to connect to the database (which happens to run on a google cloud compute engine instance).

Regards
Gavin

0 Likes

#3

That error means that you have tried to open too many files/sockets. What could be the cause of that I don't know.
I would start by looking at the node-red startup log to see what is there.

0 Likes

#4

by the startup log I understand that I should stop node red and then start it again and see what comes up on the command line screen....correct?

0 Likes

#5

Yes, it starts with the Welcome to node-RED message.
Post it here if there isn't anything obvious. You can copy from the terminal using Ctrl-Shift-C

0 Likes

#6

Here is the start up log:

Starting as a systemd service.
Started Node-RED graphical event wiring tool.
3 Mar 16:45:58 - [info]
Welcome to Node-RED

3 Mar 16:45:58 - [info] Node-RED version: v0.19.5
3 Mar 16:45:58 - [info] Node.js version: v10.15.0
3 Mar 16:45:58 - [info] Linux 4.14.79-v7+ arm LE
3 Mar 16:45:59 - [info] Loading palette nodes
3 Mar 16:46:04 - [info] Dashboard version 2.13.0 started at /ui
3 Mar 16:46:04 - [info] Settings file : /home/pi/.node-red/settings.js
3 Mar 16:46:04 - [info] Context store : 'default' [module=memory]
3 Mar 16:46:04 - [info] User directory : /home/pi/.node-red
3 Mar 16:46:04 - [warn] Projects disabled : editorTheme.projects.enabled=false
3 Mar 16:46:04 - [info] Flows file : /home/pi/.node-red/flows_raspberrypi.json
3 Mar 16:46:05 - [info] Server now running at http://127.0.0.1:1880/
3 Mar 16:46:05 - [warn]

Your flow credentials file is encrypted using a system-generated key.
If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.
You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.

3 Mar 16:46:05 - [info] Starting flows
3 Mar 16:46:05 - [info] [worldmap:GavMap] Serving /home/pi/.node-red/node_modules/node-red-contrib-web-worldmap as /worldmap
3 Mar 16:46:05 - [info] [tcp in:MySensors Gateway] connecting to 192.168.1.20:5003
3 Mar 16:46:05 - [info] Started flows
3 Mar 16:46:06 - [info] [mqtt-broker:Gavin GPS] Connected to broker: mqtt://m15.cloudmqtt.com:16063
gpx2json@0.0.5 ../../tmp/d-11923-5364-8q3aln.v287c/node_modules/gpx2json
└── xml2js@0.4.19 (sax@1.2.4, xmlbuilder@9.0.7)
3 Mar 16:46:09 - [info] [npm:80697789.8115b8] Downloaded and installed NPM module: gpx2json
gpx2json@0.0.5 ../../tmp/d-11923-5364-8q3aln.v287c/node_modules/gpx2json
└── xml2js@0.4.19 (sax@1.2.4, xmlbuilder@9.0.7)
3 Mar 16:46:09 - [info] [npm:62c2daea.5f0cb4] Downloaded and installed NPM module: gpx2json

0 Likes

#7

I don't see the error there.

0 Likes

#8

Sorry...I didnt run the flows...here it is:

3 Mar 16:48:18 - [info] [tcp in:MySensors Gateway] Error: connect ETIMEDOUT 192.168.1.20:5003
3 Mar 16:48:18 - [info] [tcp in:MySensors Gateway] connection lost to 192.168.1.20:5003
3 Mar 16:48:28 - [info] [tcp in:MySensors Gateway] connecting to 192.168.1.20:5003
3 Mar 16:50:10 - [warn] [function:Format track] [object Object]
3 Mar 16:50:10 - [warn] [function:Format track] [object Object]
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:37 - [error] [influxdb batch:Influx] Error: connect EMFILE 35.246.101.154:8086 - Local (undefined:undefined)
3 Mar 16:50:41 - [info] [tcp in:MySensors Gateway] Error: connect ETIMEDOUT 192.168.1.20:5003
3 Mar 16:50:41 - [info] [tcp in:MySensors Gateway] connection lost to 192.168.1.20:5003
3 Mar 16:50:51 - [info] [tcp in:MySensors Gateway] connecting to 192.168.1.20:5003
3 Mar 16:50:54 - [info] [mqtt-broker:Gavin GPS] Connected to broker: mqtt://m15.cloudmqtt.com:16063

0 Likes

#9

There are several things there I don't understand. Perhaps someone else can comment.

Does the error occur immediately or not till you send the node something? If not till you send something what are you sending. Also export the influx node so we can see how it is configured. If there is any sensitive information in that node or the influx server node that will get exported too then change those before exporting.

0 Likes

#10

The data consists of the following:

Latitude measurement
Longitude measurement
Elevation Measurement
Timestamp

You can see the object in the following picture from the debug node before it gets formatted into the correct structure for Influxdb:

Then I have a function node to format the data for influx which contains the following:

msg.payload.Lat = parseFloat(msg.payload.Lat);
msg.payload.Lon = parseFloat(msg.payload.Lon);
msg.payload.Elevation = parseFloat(msg.payload.Elevation);
msg.payload.Date = Date.parse(msg.payload.Date)

msg.payload = [
{
measurement: "LatLonEle",
fields: {
Lat: msg.payload.Lat,
Lon: msg.payload.Lon,
Elevation: msg.payload.Elevation
},
tags:{
location:"points"
},
timestamp: msg.payload.Date
}
];
return msg;

The first section changes the data from strings into floats and the timestamp into a date/time format and the second section structure the data into the right format according to the influxdb node documentation.

Finally the influxdb node just has the configuration for my influxdb server as follows:

I have grayed out the host in the picture which is the ip address for my server where the influxdb database is running.

0 Likes

#11

Is the server address that you have greyed out the one in the error message? 35.246...

0 Likes

#12

yes thats correct

0 Likes

#13

You did not say whether you get the error even if you don't send anything to the db node.

0 Likes

#14

If I disconnect the influxdb node then everything is fine...its only once I connect it that I get the error

0 Likes

#15

Enable the debug node showing what is going to the db node, expand everything and check ok

0 Likes

#16

ok here it is:

Similar to the other debug node but the structure is slightly different and strings are now turned to numbers and date is in date format

0 Likes

#17

If you had to grey out the server IP you might want to remove the log that is displaying it over and over....

1 Like

#18

Looking at the info tab for the influx node I don't see where it says that the payload can be an array of 1 element containing an object of that form.

0 Likes

#19

I copied the structure from the example batch node at the very end of the page for "node-red-contrib-influxdb" which shows the following structure:

msg.payload = [
{
measurement: "weather_sensor",
fields: {
temp: 5.5,
light: 678,
humidity: 51
},
tags:{
location:"garden"
},
timestamp: new Date()
},
{
measurement: "alarm_sensor",
fields: {
proximity: 999,
temp: 19.5
},
tags:{
location:"home"
},
timestamp: new Date()
}
];
return msg;

I just replaced the fields and tags according to my data which is why I thought I had done it correctly...but it appears not.

0 Likes

#20

Ah, you are using the batch node that is not present in the version of node-red-contrib-influxdb that I am using.
Your data does look ok.
Have a look at the influxdb log on the server and see what it says about it.
Have you successfully accessed the server at all?

0 Likes

#21

Hi Colin

Yes I can access the server, but when I review the firewall logs (I created a firewall rule to open port 8086) there is no record of any activity so I suspect the issue may be in getting the connection out of node red.

0 Likes