Bananian Linux

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000056Bananian Linux[All Projects] Userlandpublic2014-10-13 17:292014-11-19 10:41
ReporterThomas Kaiser 
Assigned ToNico 
PrioritylowSeverityfeatureReproducibilityhave not tried
StatusresolvedResolutionfixed 
Product Version14.09 
Target Version14.11Fixed in Version14.11 
Summary0000056: Add two shell functions to read out thermal sensors inside the A20 SoC and the AXP209 PMU
DescriptionIf these small shell code snippets http://pastebin.com/ZC5k9X2q [^] would be included the two shell functions soctemp and pmutemp would be available:

root@bananas ~ # soctemp 
42.5
root@bananas ~ # pmutemp
29.8

For more details compare with http://forum.lemaker.org/redirect.php?goto=findpost&ptid=6457&pid=33122&fromuid=33332 [^]
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0000054)
Thomas Kaiser (reporter)
2014-10-13 17:33

Silly me, there was a mistake in the pastebin code. The next to last line should read 'echo "scale=1; ${RawVal}/1000" | bc' without trailing parenthesis
(0000055)
guest (viewer)
2014-10-14 20:44

Just a sidenote: The package 'bc' is not available by default in Bananian and must be installed manually.
(0000056)
Thomas Kaiser (reporter)
2014-10-16 13:37

Thx for paying attention. Here is the bc free version that makes also temperature correction adjustable: http://pastebin.com/60mhgvaS [^]

Yesterday my A20-OLinuXIno-LIME2 arrived (which seems to be 100% compatible to Banana Pi -- I just rewrote fex/bin stuff and bootet a Banana distro). The temperatures outputted by soctemp were a few degrees to low so I had to adjust SoCTempAdjustment=1415 (estimated by finger sensing ;-)
(0000061)
Thomas Kaiser (reporter)
2014-10-22 09:18

BTW: When these two functions will be added to Bananian then it has to be ensured that sunxi-dbgreg.ko will be loaded automatically at boot time otherwise the execution of the soctemp function with an UID != 0 will always fail.
(0000062)
Thomas Kaiser (reporter)
2014-10-22 09:23

And here's one more fix: http://pastebin.com/Rspxv4bx [^] (the definition of ${SoCTempAdjustment} must be part of the function)
(0000063)
guest (viewer)
2014-10-23 23:47

Does it happen on your machines as well, that sometimes soctemp() reports -144.7 degrees? This is the adjustment value which means that the actual read is empty or zero. It happens from time to time on my machine. When I try to rerun the command a few times, it works again.

Why is the sleep time necessary? Might it help to increase/decrease this value?
(0000072)
Thomas Kaiser (reporter)
2014-11-05 14:08

Until it's not really clear how to interpret the values read out from A20 it's not a good idea to follow this approach right now. See the end of this thread or the referenced forum post for details:

https://groups.google.com/forum/#!topic/linux-sunxi/2zoxTcepPVo%5B1-25-false%5D [^]

People believe in numbers. Currently they get the thermal value from the PMU in their distros (and believe it's the CPU's), with the soctemp function they get some value without any meaning (and believe it's the CPU's).Since Nico postponed the inclusion of this RfE I'm sure the issue can be resolved in the meantime. For discussions related to this please use the forum link. This is a bug tracker :-)
(0000074)
Thomas Kaiser (reporter)
2014-11-10 11:42

Final fixes: http://pastebin.com/FSvCXx6p [^]

When reading the A20's temperature the CHOP_TEMP_EN register (according to the A20's user manual: "Chop temperature calibration enable: 0: Disable, 1: Enable") remains enabled.

And I added a conversion to Fahrenheit: When the functions will be called with f or F as only argument then values will be converted from Celsius to Fahrenheit (without using bc of course ;-)
(0000077)
guest (viewer)
2014-11-13 14:00

i got an error:
root@bananapi /usr/local/bin # ./cputemp
./cputemp: 28: ./cputemp: 378: not found
approx. °C
approx. 39.4°C
(0000078)
guest (viewer)
2014-11-13 14:41

fixed by changing line 28:

CelsiusVal=$(echo $(( 0x${HexVal} - ${SoCTempAdjustment} )) | awk '{printf ("%0.1f",$1/10); }' )
(0000081)
Thomas Kaiser (reporter)
2014-11-14 11:56

Thx, the fix of the fix: http://pastebin.com/jNLfSS4U [^]

- Issue History
Date Modified Username Field Change
2014-10-13 17:29 Thomas Kaiser New Issue
2014-10-13 17:33 Thomas Kaiser Note Added: 0000054
2014-10-14 20:44 guest Note Added: 0000055
2014-10-16 13:37 Thomas Kaiser Note Added: 0000056
2014-10-19 12:46 Nico Assigned To => Nico
2014-10-19 12:46 Nico Status new => assigned
2014-10-19 12:46 Nico Target Version => later
2014-10-22 09:18 Thomas Kaiser Note Added: 0000061
2014-10-22 09:23 Thomas Kaiser Note Added: 0000062
2014-10-23 23:47 guest Note Added: 0000063
2014-11-05 13:58 Nico Target Version later => 15.04
2014-11-05 14:08 Thomas Kaiser Note Added: 0000072
2014-11-10 11:42 Thomas Kaiser Note Added: 0000074
2014-11-13 14:00 guest Note Added: 0000077
2014-11-13 14:41 guest Note Added: 0000078
2014-11-14 11:56 Thomas Kaiser Note Added: 0000081
2014-11-19 08:44 Nico Target Version 15.04 => 14.11
2014-11-19 10:40 Nico Status assigned => resolved
2014-11-19 10:40 Nico Resolution open => fixed
2014-11-19 10:41 Nico Fixed in Version => 14.11


Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker