LowPowerLab Forum

Software support => Pi Gateway => Topic started by: Hacker007 on January 21, 2016, 07:29:53 PM

Title: How to turn on Plotting on the Battery Voltage (MotionOLED Mote)
Post by: Hacker007 on January 21, 2016, 07:29:53 PM
How do I turn on plotting on the battery voltage?  I am running the code form the V7 Image.  I have been able to do this before but for some reason the control to enable/disable plotting on this data point from my MotionOLED Mote is gone.  Does anyone know how to do this?  Please see the two screen shots attached.   Regards.
Title: Re: How to turn on Plotting on the Battery Voltage (MotionOLED Mote)
Post by: mzv72m on January 21, 2016, 10:37:26 PM
The metrics.js file needs to be updated where the battery metric is being captured.  If you look under special metrics I think this is the one you need to modify and include the graphing options like I added at the end of the below code.

  //special metrics
  V : { name:'V', regexp:/(?:V?BAT|VOLTS|V)\:(\d\.\d+)v?/i, value:'', unit:'v', graph:1,  graphOptions: { legendLbl:'Level', lines: { lineWidth:1 }, colors:['#09c']}},


Title: Re: How to turn on Plotting on the Battery Voltage (MotionOLED Mote)
Post by: Hacker007 on January 22, 2016, 06:54:36 AM
Thanks a lot.  Is there a recommended way in which to best edit the file?  Do I need to re-boot after the edit?  Can I edit it while the file is being used?  Is there a way to edit it without having to re-boot?  Thanks, again mzv72m.
Title: Re: How to turn on Plotting on the Battery Voltage (MotionOLED Mote)
Post by: Felix on January 22, 2016, 08:21:21 AM
Hacker007,
You can just edit it in place.
To reboot, you have 2 options (assuming you are running upstart as it comes standard with my recent images):
- just issue a sudo restart gateway (or stop then start)
- if you load V8 it has a new settings page with a power symbol button which you can use to stop the app, which then gets restarted by upstart (so essentially a restart)

You can basically log/graph any numeric metric. However in some cases it makes little sense. When a battery drains very very slowly (well most of my battery nodes are since they are supposed to last a looong time) you always see a very straight line in the graph, so no real value added to just looking at a fixed value.
And FWIW the nodes in the dashboard will show a low battery icon when the voltage is below 3.55v i believe. Maybe I should make that value customizable via a metric setting...  ::)
Hope this helps...