Closed jkehrel closed 1 year ago
To query the temperature, no command is executed, but a file containing the temperature is queried. At the moment this is /sys/class/thermal/thermal_zone0/temp
and /sys/class/hwmon/hwmon0/temp1_input
. Do you have these files? You can test the output with:
cat /sys/class/hwmon/hwmon0/temp1_input
cat /sys/class/thermal/thermal_zone0/temp
After further investigation, a correction: Your code gets the temperature on my Pi 2B. The problem lies in the browser.
On a Windows 10 22H2 PC with Firefox 111 I can not see the temperature: Using Google Chrome on the same PC it is visible: On an Android smartphone with Chrome it is visible too: But on Android/Chrome these buttons are nearly unreadable because of white text on light gray color of background Both buttons are okay on Windows with Chrome and Firefox
During development, I sometimes have similar errors. Have you cleared the browser cache?
OK. Cleared my browser cache on Windows. Now Firefox shows temperature. So you can close this issue. But on Android 12 with Google Chrome the two buttons have background color light gray and only the edge of the buttons is in the correct color as in my hard copy of the screen. Even after clearing the browser cache. Because the text is white, it is hardly readable.
But on Android 12 with Google Chrome the two buttons have background color light gray and only the edge of the buttons is in the correct color as in my hard copy of the screen.
I'll take a look at it in the next few days and fix it.
It is fixed. It will be included in the next update.
Your script does not find a temperature reading on my Rasberry Pi 2B with Pi OS bullseye. With PI OS operating system or Ubuntu 22.04 you can get the temperature with Python this way:
or
comment # above is german, my language.
Should be similar with PHP
Thank you for your nice and free implementation of pi.alert.