Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong CPU temp #696

Closed
kobzzon opened this issue Nov 12, 2022 · 26 comments
Closed

Wrong CPU temp #696

kobzzon opened this issue Nov 12, 2022 · 26 comments
Labels
documentation Improvements or additions to documentation

Comments

@kobzzon
Copy link

kobzzon commented Nov 12, 2022

Device Information |

  • SOC: [e.g. S905]
  • Model [e.g. UHD300]

**Armbian Version |

  • Kernel Version: [e.g. 5.15.77]
  • Release: [e.g. flippy]

**Describe the bug |
Showing wrong CPU Temp in terminal and in klipper firmware (-1 degree Celsius is displayed)
image

@ophub
Copy link
Owner

ophub commented Nov 13, 2022

Re-download the firmware and reinstall. There is a problem with your system.

@kobzzon
Copy link
Author

kobzzon commented Nov 13, 2022

Re-download the firmware and reinstall. There is a problem with your system.

the problem is not solvedimage

@ophub
Copy link
Owner

ophub commented Nov 13, 2022

Does the previous permission issue still exist?

Execute armbian-fix

look at the results

@kobzzon
Copy link
Author

kobzzon commented Nov 13, 2022

Does the previous permission issue still exist?

Execute armbian-fix

look at the results

image

@ophub
Copy link
Owner

ophub commented Nov 13, 2022

Non-root users need to add sudo when executing system operation commands

sudo armbian-fix

@ophub
Copy link
Owner

ophub commented Nov 13, 2022

Execute these 3 commands separately to see which one can be used

sensors | grep -Eo '\+[0-9]+.+C' | sed ':a;N;$!ba;s/\n/ /g;s/+//g'


awk '{ printf("%.1f °C", $0 / 1000) }' /sys/class/hwmon/hwmon0/temp1_input


awk '{ printf("%.1f °C", $0 / 1000) }' /sys/class/thermal/thermal_zone0/temp

@kobzzon
Copy link
Author

kobzzon commented Nov 13, 2022

Non-root users need to add sudo when executing system operation commands

sudo armbian-fix
sudo armbian-fix

@kobzzon
Copy link
Author

kobzzon commented Nov 13, 2022

Execute these 3 commands separately to see which one can be used

sensors | grep -Eo '\+[0-9]+.+C' | sed ':a;N;$!ba;s/\n/ /g;s/+//g'


awk '{ printf("%.1f °C", $0 / 1000) }' /sys/class/hwmon/hwmon0/temp1_input


awk '{ printf("%.1f °C", $0 / 1000) }' /sys/class/thermal/thermal_zone0/temp

3 commands

@ophub
Copy link
Owner

ophub commented Nov 13, 2022

Did you delete the sudo privileges of the root user?

User permissions are incorrect, many operations are invalid

add your user to sudo group

sudo -i

sudo usermod -aG sudo root
sudo usermod -aG sudo klipper


sudo apt-get update
sudo apt-get install -y lm-sensors

sensors | grep -Eo '\+[0-9]+.+C' | sed ':a;N;$!ba;s/\n/ /g;s/+//g'

@kobzzon
Copy link
Author

kobzzon commented Nov 13, 2022

sensors | grep -Eo '+[0-9]+.+C' | sed ':a;N;$!ba;s/\n/ /g;s/+//g'

sensor

@ophub
Copy link
Owner

ophub commented Nov 13, 2022

Regardless of the temperature issue.
Your basic user permissions are wrong. Unable to use Armbian system normally.

@ophub
Copy link
Owner

ophub commented Nov 13, 2022

The temperature is in this file. Find the temperature viewing method that suits your box and modify this place:
/usr/lib/armbian/armbian-allwinner-battery
Snip20221113_2

Call display in this file:
/etc/update-motd.d/30-armbian-sysinfo

Snip20221113_3
Snip20221113_4

@kobzzon
Copy link
Author

kobzzon commented Nov 13, 2022

Regardless of the temperature issue. Your basic user permissions are wrong. Unable to use Armbian system normally.


login as: root
root@192.168.1.3's password:
    _              _   ____  ___   ___  ____
   / \   _ __ ___ | | / ___|/ _ \ / _ \| ___|
  / _ \ | '_ ` _ \| | \___ \ (_) | | | |___ \
 / ___ \| | | | | | |  ___) \__, | |_| |___) |
/_/   \_\_| |_| |_|_| |____/  /_/ \___/|____/

Welcome to Armbian 22.11.0-trunk Jammy with Linux 5.15.77-flippy-78+o

No end-user support: built from trunk

System load:   27%              Up time:       2 min
Memory usage:  22% of 803M      IP:            192.168.1.243
192.168.1.2 192.168.1.3
CPU temp:      2147483647°C             Usage of /:    48% of 7.0G
RX today:      648.0 KiB

Last login: Sun Nov 13 09:09:19 2022 from 192.168.1.156


root@armbian:~# sudo armbian-fix
01. Fix tmp permissions
02. Fix update-motd.d permissions
03. Fix man permissions
04. Fix man permissions
05. Fix man permissions
06. Fix man permissions
07. Fix sudo permissions
08. Fix sudo permissions
11. Fix polkit-agent-helper-1 permissions
12. Fix sudoers.so permissions
13. Fix sudoers.so permissions
14. Fix polkit-agent-helper-1 permissions
15. Fix custom banner name: Aml Aml S905
19. Clean up local installation packages
20. Delete machine-id
21. Generate /etc/machine-id
22. Generate /var/lib/dbus/machine-id
23. Turn off automatic sleep mode
armbian-fix: Loading finished.

root@armbian:~# ^[[200~sensors | grep -Eo '\+[0-9]+.+C' | sed ':a;N;$!ba;s/\n/ /g;s/+//g'~
-bash: $'\E[200~sensors': command not found
sed: -e expression #1, char 26: unknown option to `s'

root@armbian:~# awk '{ printf("%.1f °C", $0 / 1000) }' /sys/class/hwmon/hwmon0/temp1_input
4294967295.0 °C
root@armbian:~# awk '{ printf("%.1f °C", $0 / 1000) }' /sys/class/thermal/thermal_zone0/temp
-1.0 °C

root@armbian:~# sudo -i
root@armbian:~# sudo usermod -aG sudo root
root@armbian:~# sudo usermod -aG sudo klipper

root@armbian:~# sudo apt-get update
Get:1 http://ports.ubuntu.com jammy InRelease [270 kB]
Get:2 http://ports.ubuntu.com jammy-security InRelease [110 kB]
Get:3 http://ports.ubuntu.com jammy-updates InRelease [114 kB]
Get:4 http://ports.ubuntu.com jammy-backports InRelease [99.8 kB]
Get:5 http://ports.ubuntu.com jammy/universe arm64 Packages [17.2 MB]
Get:6 http://ports.ubuntu.com jammy/main arm64 Packages [1,758 kB]
Get:7 http://ports.ubuntu.com jammy/multiverse arm64 Packages [224 kB]
Get:8 http://ports.ubuntu.com jammy/restricted armhf Packages [13.3 kB]
Get:9 http://ports.ubuntu.com jammy/restricted arm64 Packages [24.2 kB]
Get:10 http://ports.ubuntu.com jammy/multiverse armhf Packages [199 kB]
Get:11 http://ports.ubuntu.com jammy/universe armhf Packages [16.8 MB]
Get:12 http://ports.ubuntu.com jammy/main armhf Packages [1,701 kB]
Get:13 http://ports.ubuntu.com jammy-security/restricted armhf Packages [9,365 B]
Get:14 http://ports.ubuntu.com jammy-security/universe armhf Packages [472 kB]
Get:15 http://ports.ubuntu.com jammy-security/main armhf Packages [353 kB]
Get:16 http://ports.ubuntu.com jammy-security/universe arm64 Packages [629 kB]
Get:17 http://ports.ubuntu.com jammy-security/restricted arm64 Packages [189 kB]
Get:18 http://ports.ubuntu.com jammy-security/main arm64 Packages [526 kB]
Get:19 http://ports.ubuntu.com jammy-security/multiverse armhf Packages [594 B]
Get:20 http://ports.ubuntu.com jammy-updates/main arm64 Packages [822 kB]
Ign:20 http://ports.ubuntu.com jammy-updates/main arm64 Packages
Get:21 http://ports.ubuntu.com jammy-updates/universe arm64 Packages [811 kB]
Get:22 http://ports.ubuntu.com jammy-updates/multiverse arm64 Packages [2,308 B]
Get:23 http://ports.ubuntu.com jammy-updates/universe armhf Packages [653 kB]
Get:24 http://ports.ubuntu.com jammy-updates/restricted armhf Packages [9,747 B]
Get:25 http://ports.ubuntu.com jammy-updates/main armhf Packages [620 kB]
Get:26 http://ports.ubuntu.com jammy-updates/restricted arm64 Packages [202 kB]
Get:27 http://ports.ubuntu.com jammy-updates/multiverse armhf Packages [1,334 B]
Get:28 http://ports.ubuntu.com jammy-backports/main armhf Packages [3,169 B]
Get:29 http://ports.ubuntu.com jammy-backports/main arm64 Packages [3,184 B]
Get:30 http://ports.ubuntu.com jammy-backports/universe arm64 Packages [7,261 B]
Get:31 http://ports.ubuntu.com jammy-backports/universe armhf Packages [7,272 B]
Get:20 http://ports.ubuntu.com jammy-updates/main arm64 Packages [822 kB]
Fetched 43.2 MB in 1min 23s (520 kB/s)
Reading package lists... Done

root@armbian:~# sudo apt-get install -y lm-sensors
Reading package lists... Done
Building dependency tree... Done
Suggested packages:
  fancontrol read-edid
The following NEW packages will be installed:
  lm-sensors
0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
Need to get 81.8 kB of archives.
After this operation, 366 kB of additional disk space will be used.
Get:1 http://ports.ubuntu.com jammy/universe arm64 lm-sensors arm64 1:3.6.0-7ubuntu1 [81.8 kB]
Fetched 81.8 kB in 1s (60.7 kB/s)
Selecting previously unselected package lm-sensors.
(Reading database ... 62654 files and directories currently installed.)
Preparing to unpack .../lm-sensors_1%3a3.6.0-7ubuntu1_arm64.deb ...
Unpacking lm-sensors (1:3.6.0-7ubuntu1) ...
Setting up lm-sensors (1:3.6.0-7ubuntu1) ...
Created symlink /etc/systemd/system/multi-user.target.wants/lm-sensors.service → /lib/systemd/system/lm-sensors.service.
Processing triggers for man-db (2.10.2-1) ...

root@armbian:~# sensors | grep -Eo '\+[0-9]+.+C' | sed ':a;N;$!ba;s/\n/ /g;s/+//g'
+4294967295.0°C

@ophub
Copy link
Owner

ophub commented Nov 13, 2022

sudo vi /usr/lib/armbian/armbian-allwinner-battery

#read raw_temp </etc/armbianmonitor/datasources/soctemp 2>/dev/null
raw_temp="$(sensors 2>/dev/null | grep -Eo '\+[0-9]+' | awk '{print $1}' | head -n1 | sed -e 's|+||')"

Snip20221113_7

Referring to the above figure, comment out the original line 13 and add a new temperature acquisition method
After saving, log in again with ssh to see the temperature display

Or modify the algorithm on line 19. Count numbers to the correct number of digits.

@ophub ophub closed this as completed Nov 14, 2022
@kobzzon
Copy link
Author

kobzzon commented Nov 14, 2022

"/usr/lib/armbian/armbian-allwinner-battery" [readonly]

@ophub ophub reopened this Nov 15, 2022
@ophub
Copy link
Owner

ophub commented Nov 15, 2022

sudo …

@ophub ophub closed this as completed Nov 15, 2022
@kobzzon
Copy link
Author

kobzzon commented Nov 15, 2022

armbian-allwinner-battery

CPU temp LOST
armbian-allwinner-battery

@ophub
Copy link
Owner

ophub commented Nov 21, 2022

Use ssh to log in to armbian, copy and paste each line of command separately, and fix the temperature display error.

temp_file="/usr/lib/armbian/armbian-allwinner-battery"
insert_line="$(cat ${temp_file} | grep -n 'CPU_TEMP_OFFSET' | awk -F':' '{print $1}')"
sed -i "${insert_line}i\        [[ \"\$(echo \${board_temp} | awk -F'.' '{print \$1}' | wc -c)\" -gt \"3\" ]] && board_temp=\${board_temp:0:2}" ${temp_file}

Snip20221121_2

@kobzzon
Copy link
Author

kobzzon commented Nov 22, 2022

Use ssh to log in to armbian, copy and paste each line of command separately, and fix the temperature display error.

temp_file="/usr/lib/armbian/armbian-allwinner-battery"
insert_line="$(cat ${temp_file} | grep -n 'CPU_TEMP_OFFSET' | awk -F':' '{print $1}')"
sed -i "${insert_line}i\        [[ \"\$(echo \${board_temp} | awk -F'.' '{print \$1}' | wc -c)\" -gt \"3\" ]] && board_temp=\${board_temp:0:2}" ${temp_file}

Snip20221121_2

It's works! Great! Many thx!!!
image

@ophub
Copy link
Owner

ophub commented Nov 22, 2022

ok

@ophub ophub added the documentation Improvements or additions to documentation label Nov 22, 2022
@kobzzon
Copy link
Author

kobzzon commented Nov 22, 2022

ok

But in Fluidd displaying wrongimage

@ophub
Copy link
Owner

ophub commented Nov 22, 2022

I don't know about other software

@kobzzon
Copy link
Author

kobzzon commented Nov 22, 2022

I don't know about other software

And didn't work any webcams image

@kobzzon
Copy link
Author

kobzzon commented Nov 22, 2022

I don't know about other software

From Fluidd issue:
"Assuming you are using a sensor_type: temperature_host in your Klipper printer.cfg, you will most likely have to override the sensor_path as Klipper by default will use /sys/class/thermal/thermal_zone0/temp but that doesn't seem to be available in your system.

You can confirm by SSH'ing and then cat /sys/class/thermal/thermal_zone0/temp and checking the result"

How can i do this?

@ophub
Copy link
Owner

ophub commented Nov 22, 2022

For the use of third-party software, go to the corresponding website for consultation, I don’t know how to use it

@kobzzon
Copy link
Author

kobzzon commented Nov 23, 2022

For the use of third-party software, go to the corresponding website for consultation, I don’t know how to use it

and how about permission cameras?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants