Detect overheating in Google Glass programmaticaly

后端 未结 1 1331
陌清茗
陌清茗 2021-01-25 12:34

As many of other I am facing the google glass overheating issue. My question is how to detect it in the application?

I was looking through the log but nothing that indi

相关标签:
1条回答
  • 2021-01-25 12:55

    Google Glass have (at least) two temperature probes.
    One for the battery, and the other for the CPU board.
    You can read them as a regular file.

    Battery
    /sys/devices/platform/omap_i2c.1/i2c-1/1-0055/power_supply/bq27520-0/temp

    CPU Board
    /sys/devices/platform/notle_pcb_sensor.0/temperature

    But keep in mind that these files may change location as new versions of Google Glass are shipped.

    The code (simplified version)

    private String readTemperature(String path) throws IOException {
        return new BufferedReader(new InputStreamReader(new FileInputStream(new File(path)))).readLine();
    }
    

    Interpretation

    The values you'll get from these files are in different units.
    The CPU Board temperature must be divided by 1000 to get the temperature in °C.
    The battery temperature must be divided by 10 to get the temperature in °C.

    Logcat

    The logcat also gives you the temperatures every minutes or so in a one line log.
    You could even parse it:

    I/UserEventService(568): [GlassUserEventPerformanceStats ... battery_temperature_milli_centigrade: 34000 board_temperature_milli_centigrade: 44000 ]

    Values

    From what I've experience, values of the CPU board can go from 25°C to 70°C.
    If you go above 70°C, you app or any active app is likely to be killed by the system and you'll see the message "Glass must cool down to run smoothly".

    0 讨论(0)
提交回复
热议问题