#!/usr/bin/python2
#should be executed each minute with cron
#*/1 * * * * /path/getTemperatures.py
#system time has tobe rigt -> start after NTP time sync

import datetime
import os
import glob
import time
#Adafruit_DHT has to be installed -> https://github.com/adafruit/Adafruit_Python_DHT.git
import Adafruit_DHT

os.system('modprobe w1-gpio')
os.system('modprobe w1-therm')

pin = 27
humidity, temperature = Adafruit_DHT.read_retry(Adafruit_DHT.AM2302, pin)
d = datetime.datetime.now()

base_dir = '/sys/bus/w1/devices/'
device_folder = glob.glob(base_dir + '28*')[0]
device_file = device_folder + '/w1_slave'

def read_temp_raw():
    f = open(device_file, 'r')
    lines = f.readlines()
    f.close()
    return lines
 
def read_temp():
    lines = read_temp_raw()
    while lines[0].strip()[-3:] != 'YES':
        time.sleep(0.2)
        lines = read_temp_raw()
    equals_pos = lines[1].find('t=')
    if equals_pos != -1:
        temp_string = lines[1][equals_pos+2:]
        temp_c = float(temp_string) / 1000.0
        return temp_c

with open("/home/john/meteor-Data/"+d.strftime("%Y-%m-%d")+".csv", "a") as f:
    f.write(d.strftime("%Y-%m-%d %H:%M:%S,"+str(temperature)+","+str(humidity)+","+str(read_temp())+"\n"))

@@ -309,16 +309,143 @@
 it_DHT%0A%0A
+#Adafruit_BMP has to be installed -%3E https://github.com/adafruit/Adafruit_Python_BMP.git%0Aimport Adafruit_BMP.BMP085 as BMP085%0A%0A
 os.syste
@@ -703,471 +703,1212 @@
 ce_f
-ile = device_folder + '/w1_slave'%0A%0Adef read_temp_raw():%0A    f = open(device_file, 'r')%0A    lines = f.readlines()%0A    f.close()%0A    return lines%0A %0Adef read_temp():%0A    lines = read_temp_raw()%0A    while lines%5B0%5D.strip()%5B-3:%5D != 'YES':%0A        time.sleep(0.2)%0A        lines = read_temp_raw()%0A    equals_pos = lines%5B1%5D.find('t=')%0A    if equals_pos != -1:%0A        temp_string = lines%5B1%5D%5Bequals_pos+2:%5D%0A        temp_c = float(temp_string) / 1000.0%0A        return temp_c
+older_2 = glob.glob(base_dir + '28*')%5B1%5D%0Adevice_file = device_folder + '/w1_slave'%0Adevice_file_2 = device_folder_2 + '/w1_slave'%0A%0A#TODO: cely predelat!!!!%0Adef read_temp_raw():%0A    f = open(device_file, 'r')%0A    lines = f.readlines()%0A    f.close()%0A    return lines%0A%0Adef read_temp_raw_2():%0A    f = open(device_file_2, 'r')%0A    lines = f.readlines()%0A    f.close()%0A    return lines%0A %0Adef read_temp():%0A    lines = read_temp_raw()%0A    while lines%5B0%5D.strip()%5B-3:%5D != 'YES':%0A        time.sleep(0.2)%0A        lines = read_temp_raw()%0A    equals_pos = lines%5B1%5D.find('t=')%0A    if equals_pos != -1:%0A        temp_string = lines%5B1%5D%5Bequals_pos+2:%5D%0A        temp_c = float(temp_string) / 1000.0%0A        return temp_c%0A%0Adef read_temp_2():%0A    lines = read_temp_raw_2()%0A    while lines%5B0%5D.strip()%5B-3:%5D != 'YES':%0A        time.sleep(0.2)%0A        lines = read_temp_raw()%0A    equals_pos = lines%5B1%5D.find('t=')%0A    if equals_pos != -1:%0A        temp_string = lines%5B1%5D%5Bequals_pos+2:%5D%0A        temp_c = float(temp_string) / 1000.0%0A        return temp_c%0A%0Asensor = BMP085.BMP085()%0Atemp = sensor.read_temperature()%0Apressure = sensor.read_pressure()%0A%0A#print 'Temp = %7B0:0.2f%7D *C'.format(temp)%0A#print 'Pressure = %7B0:0.2f%7D Pa'.format(pressure)
 %0A%0Awi
@@ -2084,14 +2084,69 @@
 emp())+%22
+,%22+str(read_temp_2())+%22,%22+str(temp)+%22,%22+str(pressure)+%22
 %5Cn%22))%0A

Add barometric pressure and more temperature sensors.