Add-ons

CPU temperature measurement

32 16717
but it's no solution for the CPU-Temp!

Math43  
Hello,

I'm interested too for CPU temp measurement !

icejack  
well it seems that the A20 Chip internal sensor isnt calibrated so it cannot give proper temperature reading yet

http://linux-sunxi.org/Temperature_Calibration

agocs  
It works for me now on Raspbian.

Also put it in rpimonitor with this modification:
dynamic.12.source=/sys/devices/platform/sunxi-i2c.0/i2c-0/0-0034/temp1_input

PaulG  
Where can I download rpimonitor from

Post Last Edited by Randural at 2014-8-23 02:33

mainpage: http://rpi-experiences.blogspot.de/p/rpi-monitor.html

install (german): http://jankarres.de/2013/11/rasp ... nitor-installieren/

install (english): http://elinux.org/RPi-Monitor

PaulG  
Has any one managed to read the temperature with python, is so I would love to see the code.

Post Last Edited by actkk2000 at 2014-8-24 16:50

Reply 17# PaulG

  1. nano cpu_temp.py
Copy the Code

copy this inside:
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. import os
  4. import time
  5. while True:
  6.    cmd = """cat /sys/devices/platform/sunxi-i2c.0/i2c-0/0-0034/temp1_input |awk '{printf ("%0.1f",$1/1000); }'"""
  7.    temp_c = os.popen(cmd).readline().strip()
  8.    temp_f = float(temp_c) * 9.0 / 5.0 + 32.0
  9.    print "CPU Temp = ", temp_c, "ºC /", temp_f, "ºF "
  10.    time.sleep(5)
Copy the Code

CTRL + x to exit, answer Yes

Finally run:
  1. sudo python cpu_temp.py
Copy the Code


Sources:
http://www.cubieforums.com/index.php/topic,2004.msg12991.html#msg12991
https://learn.adafruit.com/adafruits-raspberry-pi-lesson-11-ds18b20-temperature-sensing/software
http://stackoverflow.com/questions/10589620/syntaxerror-non-ascii-character-xa3-in-file-when-function-returns-%C2%A3

PaulG  
Reply 18# actkk2000

actkk2000

Thanks for that.

Reply 18# actkk2000

Tried it under Raspbian but could not find .../0-0034/temp1_input.The readout of AXP202 via sudo i2cget -y 0 0x34 0x5E w works.
Do I have an initializing problem?

You have to log in before you can reply Login | Sign Up

Points Rules