Influxdb integration error

Hi there!
I just installed LoRaServer and everything was working just ok before I tried to set up influxdb integration. Loraserver is installed on RPi, influx and Grafana are installed on other machine. Integration configuration looks like this:


On every message received by the LoRa app server, following lines appears in the log file:
Jul 24 12:17:52 raspberrypi lora-app-server[580]: time=“2019-07-24T12:17:52Z” level=error msg=“integration/multi: integration *influxdb.Integration error” error=“sending measurements error: http request error: Post http://influxdbiphere:8086/write?db=lora&precision=u&rp=: dial tcp influxdbiphere:8086: i/o timeout”
Jul 24 12:17:52 raspberrypi lora-app-server[580]: time=“2019-07-24T12:17:52Z” level=info msg=“device updated” dev_eui=e4aabb0000000c08
Jul 24 12:17:52 raspberrypi lora-app-server[580]: time=“2019-07-24T12:17:52Z” level=info msg=“finished unary call with code OK” grpc.code=OK grpc.method=HandleUplinkData grpc.request.deadline=“2019-07-24T12:17:53Z” grpc.service=as.ApplicationServerService grpc.start_time=“2019-07-24T12:17:52Z” grpc.time_ms=28.771 peer.address="[::1]:45616" span.kind=server system=grpc
Jul 24 12:17:52 raspberrypi lora-app-server[580]: time=“2019-07-24T12:17:52Z” level=info msg=“integration/mqtt: publishing message” qos=0 topic=application/1/device/e4aabb0000000c08/rx

Unfortunately, haven`t find any information regarding to this error. I will really appreciate your help. Thanks in advance!

Ok, that was network issue which is fixed now, but the next issue is with parsing. Error message says “invalid boolean” for every data field from object. Why does it even think, that it should be boolean?

I have minimized my decoding script, to return only one value - uptime, and the script looks like this:
function Decode(fPort, bytes) {
if (fPort == 1 && bytes[0] == 1) {
var node_time = bytes[1] | bytes[2] << 8 | bytes[3] << 16 | bytes[4] << 24;
var node_time_s = node_time / 1000.0;
return {
“uptime [s]” : node_time_s
};
}
else {
return {}
}
}
It works just fine, for decoding uptime and showing it in lora-app-server:


But, lora-app-server log still returns this message:
Jul 25 05:35:13 raspberrypi lora-app-server[580]: time=“2019-07-25T05:35:13Z” level=error msg=“integration/multi: integration *influxdb.Integration error” error=“sending measurements error: expected 2xx response, got: 400 ({“error”:“partial write: unable to parse ‘device_frmpayload_data_uptime [s],application_name=my-application,dev_eui=XXXXXXXXXXX,device_name=XXX,f_port=1 value=28253.181000’: invalid boolean dropped=0”}\n)”
Returned value is just like everybody else has returned, but for them it works fine. Is it possible that problem is in influxDB itself or am I missing something?

Is it possible that nobody have had problems with parsing the payload? I have tried multiple ways to format the payload, but still with no luck.

When InfluxDB sees a measurement for the first time, it will detect the type of the measurement and all future measurements must use the same time. Else it will raise an error that the data you are trying to write is invalid, which is the error you’re seeing I believe.

I appreciate your answer, brocaar! While testing and writing an reply, I found out that the problem was in the variable name. As you see in the photo, the variable is called “uptime [s]” - InfluxDB doesn`t like the brackets. Edited my codec and everything works like a charm. Thanks!