This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Changing units in Signal K
#1
I am migrating to OP4 on the RPi 5 with MacArthur HAT and I2C BME280 for temp, pressure and Humidity. I use KIP to plot the data to display the info like Matt Bailey does (great videos BTW Smile ).

On the "old RPi 4 " I am using Influx DB and Grafana I had no problems manipulating the data to give me hPa rather than Pa for the pressure. With the updates to Influx and Grafana I just can't get my head around how to do this, as all the friendly features seem to have been replaced by scripts.

Now I am a little technical, but not that technical, and I have been going round and round with Influx and Grafana for a while now, so I thought that the easiest way would simply to change the Signal K or BMP280 units from Pa to hPa. But I just cannot find how to do it (there is talk of changing the scripts in .JSON but I have to admit that is a little beyond me!).

I tried changing the scaling factor of the BME280 in the I2C menu of OP4, but that has no effect.

Can any of you clever folks out there help me please?

Thanks
Reply
#2
(2024-05-06, 01:01 PM)SoakinJoe Wrote: Can any of you clever folks out there help me please?

Thanks

not so clever as persistent  Big Grin Big Grin

Assuming you are now on influx V2, flux ain't immediately obvious, but eventually I found the map function. Signalk works in SI units so probably best to do any unit changes last. Here's my pressure flux, you can change the name as well >>

from(bucket: "boatyDb")
  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)
  |> filter(fn: ® => r["_measurement"] == "environment.outside.pressure")
  |> map(fn: ® => ({ _value:r._value / 100.0, _time:r._time, _field:"Pressure" }))
  |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)
  |> yield(name: "mean")
Reply
#3
Works perfectly, not sure I would have got there on my own.

Thanks very much
Reply
#4
(2024-05-06, 05:16 PM)SoakinJoe Wrote: Works perfectly, not sure I would have got there on my own.

Thanks very much

Took me a while!  Big Grin

One tip is to use the influxdb web portal on port 8086 then click the data explorer little graph icon  and use it to create the flux script & copy/paste into grafana
Reply
#5
(2024-05-06, 06:25 PM)PaddyB Wrote:
(2024-05-06, 05:16 PM)SoakinJoe Wrote: Works perfectly, not sure I would have got there on my own.

Thanks very much

Took me a while!  Big Grin

One tip is to use the influxdb web portal on port 8086 then click the data explorer little graph icon  and use it to create the flux script & copy/paste into grafana

I would never have found that Smile
Reply
#6
Using influxdb and grafana, I'm trying to chart the boat's position on a map (no problem) but I am unable to apply a color gradient relative to the speed of the boat/power consumption... If anyone has something like this working, could they please share ? Thanks !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)