Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android temperature zones?

Tags:

android

I've seen numerous questions/answers showing how to get temperature information from an Android device - using this approach:

int zoneNumber = 0; // Usually 0 or 1
String temperatureFileLocation = "sys/devices/virtual/thermal/thermal_zone" + zoneNumber + "/temp";
File temperatureFile = new File(temperatureFileLocation);
scanner = new Scanner(temperatureFile);
double temperatureC = scanner.nextFloat(); // Degrees C
...
scanner.close(); // finally

I wasn't really sure what each zone is for (i.e., in which part of the device the sensor is located) but I just discovered that there is also a file that describes the type of each zone - for example:

String zoneTypeFileLocation = "sys/devices/virtual/thermal/thermal_zone" + zoneNumber + "/type"; // NB - that's "/type" not "/temp" !

Now, when using Scanner to read in what type each zone is, I get values back such as this:

mtktswmt 
mtktscpu
mtktspmic
mtktspa
mtktsabb
mtktsbattery
tsen_max
sec-fuelguage

Can anyone explain what locations/components all these zone names are actually referring to?

(Ideally, I would like to obtain the temperature of the device's NFC hardware.)

like image 861
ban-geoengineering Avatar asked Aug 22 '17 18:08

ban-geoengineering


1 Answers

I guess that's the Hardware thermal sensors of the mobile. They usually give the temperature of the given zones when the mobile is working or even when you perform some benchmarks results. like

  1. mtktswmt is Wifi Chip temperature zone.
  2. mtktscpu is cpu temperature zone.
  3. mtktspmic is Multi IO and Regulator Chip temperature zone.
  4. mtktspa is Thermal sensor MD1
  5. mtktsabb is processor temperature zone.
  6. mtktsbattery is the battery temperature zone.
  7. tsen_max is the maximum temperature sensor capacity(I dont know for sure).
  8. sec-fuelguage is the fuel gauge chip.

the mtkt prefix is just the name of the maker. In this case it is Mediatek

That's pretty hardcore hardware stuff. These are actually used by the makers of the android mobile phone(I guess). Even the above mentioned data is searched from google android open source project where the values were found in kernal drivers. Hence it's pretty hardcore hardware to play with it.

For using the Hardware Properties that actually gives you your desired results try HardwarePropertiesManager.

I hope it Helps.

like image 112
Sahil Avatar answered Sep 22 '22 05:09

Sahil