1- sudo rmmod rtc_ds1307
2- run python script to get temp
3- re-enable: sudo modprobe rtc_ds1307
Code: Select all
import smbus bus = smbus.SMBus(1) address = 0x68 def getTemp(address): byte_tmsb = bus.read_byte_data(address,0x11) byte_tlsb = bin(bus.read_byte_data(address,0x12))[2:].zfill(8) return byte_tmsb+int(byte_tlsb)*2**(-1)+int(byte_tlsb)*2**(-2) print getTemp(address)
I don't want to have to do that, is there a better driver, or another way that would allow me to get the internal temp without kill the process all the time? If this is the only way, I there negative effect of kill a process and restart it all the time. My plan is to check the internal temp every 2 to 5 min. So potentially 30 time a hour the process would get kill and then restarted.