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
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 [^] would be included the two shell functions soctemp and pmutemp would be available:

root@bananas ~ # soctemp 
root@bananas ~ # pmutemp

For more details compare with [^]
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
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
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.
Thomas Kaiser (reporter)
2014-10-16 13:37

Thx for paying attention. Here is the bc free version that makes also temperature correction adjustable: [^]

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 ;-)
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.
Thomas Kaiser (reporter)
2014-10-22 09:23

And here's one more fix: [^] (the definition of ${SoCTempAdjustment} must be part of the function)
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?
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:!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 :-)
Thomas Kaiser (reporter)
2014-11-10 11:42

Final fixes: [^]

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 ;-)
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
guest (viewer)
2014-11-13 14:41

fixed by changing line 28:

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

Thx, the fix of the fix: [^]

- 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 - 2020 MantisBT Team
Powered by Mantis Bugtracker