I have a 5G Router from a Chinese company based on OpenWrt software
(OpenWrt 19.07-SNAPSHOT, r11306-c4a6851c72)
I can access the commands I want via Telnet.
At the moment I care about the thing that shows the temperature of the router
Excellent, but for some reason he does not write the full temperature, just for example. If the temperature is 45.6°C, he writes it as 45.0°C. Can you edit it?
for d in /sys/devices/system/cpu/cpu*/cpufreq ; do
echo $(cat "$d"/affected_cpus) $(cat "$d"/scaling_cur_freq) | awk '{printf "CPU %d: %8.3f MHz\n", $1, $2/1000}'
done
CPU 0: 560.915 MHz
CPU 1: 624.644 MHz
CPU 2: 1248.746 MHz
CPU 3: 789.143 MHz
I even ran it through https://www.shellcheck.net/ and got down to only one warning ("quote everything, in fact, do it twice").
i think, md_5g is related to temperature of NR 5G module chipset, md_4g is related to temperature of LTE 4G module chipset, and cpu_little0-3 is related to CPU.!!
Other temperatures, I don't know what they belong to.
The router contains Wi-Fi 2.4, but I did not find its temperature in the list. Is it md_rf?
All of those values look very much reasonable to me. My APU usually runs 48-60 C, wandering up and down with ambient changes (18-28 over the course of the year in my office here). My N5105 has better cooling, so it's almost always ambient+20, so 40-50 C or so.
Oh, I see the "affected_cpus" looks like it doesn't exist on your device. I wonder if it's due to your older kernel, here's what's there on an RT3200 with a 5.10 kernel. Maybe just delete the CPU id stuff in that line, and it'll spit out the frequencies in order...
$ ls -la /sys/devices/system/cpu/cpu0/cpufreq/
drwxr-xr-x 4 root root 0 Aug 14 08:43 .
drwxr-xr-x 3 root root 0 Aug 14 08:43 ..
-r--r--r-- 1 root root 4096 Aug 23 16:04 affected_cpus
-r-------- 1 root root 4096 Aug 23 16:04 cpuinfo_cur_freq
-r--r--r-- 1 root root 4096 Aug 23 16:04 cpuinfo_max_freq
-r--r--r-- 1 root root 4096 Aug 23 16:04 cpuinfo_min_freq
-r--r--r-- 1 root root 4096 Aug 23 16:04 cpuinfo_transition_latency
drwxr-xr-x 2 root root 0 Aug 14 08:43 ondemand
-r--r--r-- 1 root root 4096 Aug 23 16:04 related_cpus
-r--r--r-- 1 root root 4096 Aug 23 16:04 scaling_available_frequencies
-r--r--r-- 1 root root 4096 Aug 23 16:04 scaling_available_governors
-r--r--r-- 1 root root 4096 Aug 14 08:45 scaling_cur_freq
-r--r--r-- 1 root root 4096 Aug 23 16:04 scaling_driver
-rw-r--r-- 1 root root 4096 Aug 14 08:43 scaling_governor
-rw-r--r-- 1 root root 4096 Aug 23 16:04 scaling_max_freq
-rw-r--r-- 1 root root 4096 Aug 23 16:04 scaling_min_freq
-rw-r--r-- 1 root root 4096 Aug 23 16:04 scaling_setspeed
drwxr-xr-x 2 root root 0 Aug 23 16:04 stats