 /*
-  Arduino Yun - Power and temperature measurement
-
-    1) Interrupt-driven light pulse detection on IRQ 0 and 1
-    - PV Produktion: pin3 (Yun) = IRQ 0
-    - Zweirichtungszaehler: pin2 (Yun) = IRQ 1
-    - calculate power based on ppwh pulses per Wh
-    
-    2) OneWire temperature measurement via Dallas DS18B20
-
-    3) Plot averaged powers to plot.ly as streaming plot
-
-    4) Log data to /mnt/sda1/datalogs: timestamp, production [W], abs(production - consumption) [W], temperature [°C]
-
-
-    Possible improvements / backlog:
-    - check power calculations for pathological cases (zero difference etc)
-
-
-    History: 
-
-    140927 Merged with DS18B20 temperature measurement - on port 4, writing to col 4
-
-    140921 Move from appending to one single datafile datalog.txt to daily datalog files
-
-    140912  timing approach adjusted: timestamp with 1s precision is logged, looping until measurementinterval with
-            ms precision has passed by. Should be ok for intervals >= 10s. Not ok for sub-second measurements.
-
-    140911: data logging to SD card added
+Arduino Yun - Power and temperature measurement
+
+1) Interrupt-driven light pulse detection on IRQ 0 and 1
+- PV Produktion: pin3 (Yun) = IRQ 0
+- Zweirichtungszaehler: pin2 (Yun) = IRQ 1
+- calculate power based on ppwh pulses per Wh
+
+2) OneWire temperature measurement via Dallas DS18B20
+
+3) Plot averaged powers to plot.ly as streaming plot
+
+4) Log data to /mnt/sda1/datalogs: timestamp, production [W], abs(production - consumption) [W], temperature [°C]
+
+
+Possible improvements / backlog:
+- check power calculations for pathological cases (zero difference etc)
+
+
+History:
+
+141229 change of dev env to Win158, and moved to git
+
+140927 Merged with DS18B20 temperature measurement - on port 4, writing to col 4
+
+140921 Move from appending to one single datafile datalog.txt to daily datalog files
+
+140912  timing approach adjusted: timestamp with 1s precision is logged, looping until measurementinterval with
+ms precision has passed by. Should be ok for intervals >= 10s. Not ok for sub-second measurements.
+
+140911: data logging to SD card added
 */
+
+// plot.ly streaming tokens, gitignored, same directory
+#include "mytokens.h"
 
 #include <Bridge.h>
 #include <Console.h>

// Initialize as many plotters as you want! Each plotter will send data to the same plot as a separate line.
// Make sure that you place these exact-same stream tokens in your `config.json` file on the Linino.

plotly plotter1("rs7ymb8xpy"); plotly plotter2("3lkrelrfxt"); // plot.ly tokens

// Measurement interval in milliseconds
int measurementInterval = 10000;

// Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
OneWire oneWire(ONE_WIRE_BUS);

// Pass our oneWire reference to Dallas Temperature.
DallasTemperature sensors(&oneWire);

// Data logging and time stamping from http://arduino.cc/en/Tutorial/YunDatalogger
