pbegg / signalk-to-influxdb-v2-buffering

'Plugin that saves data to an influxdbv2 database - buffers data without internet connection'
5 stars 3 forks source link

To Do #1

Open pbegg opened 3 years ago

pbegg commented 3 years ago
mgf909 commented 3 years ago

Possible to allow non https server connection? I plan to use tailscale vpn to connect my machines - largely to keep networking simple over various mobile and marina connections - and also so i dont forget to renew certs etc! So being able to connect to a non-SSL Influxdb instance ( self hosted ) is important to me.

Update: Ive bodged this by editing /home/pi/.signalk/node_modules/influxdb-v2/src/index.js and replacing //const baseUrl =${this._protocol}://${this._host}:${this._port}/api/v2; const baseUrl =http://192.168.0.11:8086/api/v2;

Would be great if you could add the protocol/port to be specified in the plugin config.

pbegg commented 3 years ago

I will try to update this during the week, I will make a drop down box in the plugin config to select the protocol.

jpcavanagh commented 3 years ago

I am having a difficulity with the protocol too. I want to connect to "http://domain.xyz:8086" (a self hosted influxdb instance) but the connection fails and logs the connect attempt to "https://http//domain.xyz:8086:443/api/v2/write?org=xx&bucket=xx&precision=ms failed, reason: getaddrinfo ENOTFOUND http http:443"

could you read the URL as entered in the field with the http or https ?

pbegg commented 3 years ago

I am currently re writing this plugin to utilize the influxdata js library which should address most of the issues the plugin currently has.

xbgmsharp commented 3 years ago

The issue still persist. The influxdata js library force the protocol (https) and the port (403), https://www.npmjs.com/package/influxdb-v2 To allow an URI instead of an hostname value.

const url = require('url');
...
    const hosturi = url.parse(options.influxHost);
    app.debug(`proto: ${hosturi.protocol}, hostname: ${hosturi.hostname}, port: ${hosturi.port}...`)
    const influxdb = new Influxdb({
      host: hosturi.hostname,
      protocol: hosturi.protocol,
      port: hosturi.port,
      token: options.influxToken
      })
pbegg commented 3 years ago

The Plugin is now updated to use the the @influx-client-js library and should allow use of different protocol

jlazkano commented 2 years ago

Hello,

I want to send the SignalK data to http://192.168.1.10:8086

But it doesn't work. Is this fixed? or still need to rewrite the code to accept PROTOCOL://IP:PORT?

Kind regards.

pbegg commented 2 years ago

Is your InfluxData v2? You should be able to type the full address including protocol as you mentioned above.

I have not tested with a local DB only influx cloud

jlazkano commented 2 years ago

Hello,

Yes, I put "http://192.168.1.10:8086" in the "Influxdb2.0 Host URL" parameter.

The server has this version:

InfluxDB 2.1.1 Server: 657e183 Frontend: cc65325

There is no any data in the Influxdb bucket, and there is no any log in the SignalK log.

Thanks for your help.

dhskinner commented 2 years ago
  • [ ] Currently buffer.js is logging to console and not debug
  • [ ] When plugin is stopped, log current measurements in buffer or post to influx - currently they will be lost
  • [ ] buffer.sendBuffer() is using using readFileSync - maybe should change this to use async

Hi Phil can I add two items please (and apologies I ran out of time to take a look at these today):