(05-23-2021, 05:07 PM)dsimic Wrote:(05-23-2021, 02:40 PM)raph Wrote: I'll look into it, and write a guide to set this up. Feel free to ping me if you don't here from me soon. I plan to write a systemd task that runs post resume, and a cron task that runs every 30 seconds when the phone is on and not sleeping.
I'll also have a take on a simple script that would pull and record the values automatically.
Please, have a look at the attached PHP script. The MD5 hash of the file is 795e913de490230719c0cecaeb982603.
Once started from the shell or even from a systemd unit (it doesn't need to be started by the root user), the script remains silently in the foreground and collects the CPU temperature every 30 seconds, storing the daily log files in /var/tmp by default, which can be easily configured as desired. The script should detect and log appropriately all events of the phone resuming from the suspend to RAM. Please note that I haven't tested the script a lot, so there might be some unforeseen issues.
Of course, everybody else is welcome to test out and use this script. Please, report any issues you've encountered.
Edit: I've improved the script a bit, so it detects the resume events better. Because the detection is based on how long it takes for the internal poll loops to execute, it was possible to have false positives. The improved version is attached now, replacing the previous version.
Edit #2: I've improved the script a bit again, so it avoids "wraps" or "creeping up" of the polling time points at the second level. Those "wraps" produced no ill effects, but the resulting time points were unsightly. The improved version is attached now, replacing the previous version(s).