LowPowerLab Forum

Software support => Pi Gateway => Topic started by: DrSproc on February 20, 2016, 08:11:17 AM

Title: Pressure in inches to kPa (Weathershield mote)
Post by: DrSproc 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 (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

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!