Author Topic: Pressure in inches to kPa (Weathershield mote)  (Read 1281 times)

DrSproc

  • NewMember
  • *
  • Posts: 17
  • Country: ca
Pressure in inches to kPa (Weathershield mote)
« on: February 20, 2016, 08:11:17 AM »
For my Canadian compadres, here's a quick way I converted to KPa Pressure and also graphed it using the weathershield mote... this assumes the mote's in the field transmitting inches. 

Here a barometric compensation chart... http://www.engineeringtoolbox.com/barometers-elevation-compensation-d_1812.html...

Login to your raspberry pi and make a backup copy of the metrics.js file

cp /home/pi/gateway/metrics.js /home/pi/gateway/metrics.js_bak

Next nano into metrics.js

nano /home/pi/gateway/metrics.js

and modify the following line in the //WeatherShield metrics section

Code: [Select]
P : { name:'P', regexp:/P\:([\d\.]+)/i, value:'',valuation:function(value) {return (value/0.2952998748967986).toFixed(2);}, unit:'kPa', pin:1,graph:1, graphOptions:{ legendLbl:'Pressure', lines: { lineWidth:1 }} },

ctl-o to save and ctl-x to exit

reboot your raspberry pi and voila!
« Last Edit: February 24, 2016, 12:04:40 AM by DrSproc »