2020-11-28 05:15:40 +00:00
# Temperature Sensor Monitor for Apple Silicon M1
2020-11-30 00:00:23 +00:00
- `temp_sensor.m` : A modified version of the Objective-C [code ](https://github.com/freedomtan/sensors/blob/master/sensors/sensors.m ) for iOS sensor by [freedomtan ](https://github.com/freedomtan );
2020-11-28 05:15:40 +00:00
2020-11-30 00:00:23 +00:00
- `monitor.cpp` : A naive C++ wrapper for `temp_sensor.m` output for monitoring temperature in the terminal.
2020-11-28 05:15:40 +00:00
## Usage
2020-11-30 00:00:23 +00:00
Compile `temp_sensor.m` and `monitor.cpp` individually. Then
2020-11-28 05:15:40 +00:00
2020-11-30 00:00:23 +00:00
`./temp_sensor | ./monitor` or `./temp_sensor`
Only test with my Mac mini with M1. Please check your mac's `ioreg -lfx` output to make changes in `temp_sensor.m` if needed.
2020-11-28 05:15:40 +00:00
## References
2020-11-30 00:00:23 +00:00
For **better names** (e.g. what is `PMU TP3w` ?) for the sensors, please refer to
2020-11-28 05:15:40 +00:00
https://github.com/exelban/stats/blob/master/Modules/Sensors/values.swift
https://github.com/acidanthera/VirtualSMC/blob/master/Docs/SMCSensorKeys.txt
2020-11-28 05:32:25 +00:00
Here is a similar code in swift for getting sensor values using IOKit (for intel Mac)
2020-11-28 05:15:40 +00:00
https://github.com/exelban/stats/blob/master/Modules/Sensors/values.swift
2020-11-28 05:32:25 +00:00
For intel Mac, an easier way to get sensor infomation:
`sudo powermetrics`
2020-11-28 05:15:40 +00:00
2020-11-28 17:04:58 +00:00
## Demo: screen shot and screen record
- screen record : screen_record.mp4[1.4MB] or
![screen record ](https://raw.githubusercontent.com/fermion-star/apple_sensors/master/screen_record.low.gif )
2020-11-28 05:15:40 +00:00
2020-11-28 15:12:10 +00:00
- screen shot
![screen shot ](https://raw.githubusercontent.com/fermion-star/apple_sensors/master/screen_shot.png )
2020-11-28 05:23:17 +00:00
<!-- -
2020-11-28 15:10:19 +00:00
![screen record ](screen_record.mp4 )
2020-11-28 05:15:40 +00:00
2020-11-28 15:10:19 +00:00
![screen shot ](screen_shot.png )
2020-11-28 05:23:17 +00:00
--->
2020-11-28 05:15:40 +00:00