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

RPi 3 B+ / Temperature question #1836

Closed
helmethawthorn opened this issue Jun 10, 2018 · 19 comments
Closed

RPi 3 B+ / Temperature question #1836

helmethawthorn opened this issue Jun 10, 2018 · 19 comments
Assignees
Labels
External bug 🐞 For bugs which are not caused by DietPi. Raspberry Pi Solution available 🥂 Definite solution has been done Via Forum
Milestone

Comments

@helmethawthorn
Copy link

Creating a bug report/issue:

(Referring to https://dietpi.com/phpbb/viewtopic.php?f=9&t=3873)

Hi all, I have just bought my first Raspberry and I am doing my first steps. - My goal is to run Pi-Hole on it. Having started with Raspbain Stretch Lite, I read about DietPi - and it sounds very good and interesting. So, I re-installed it with DietPi. :D

I am wondering why the displayed CPU temperature is higher, when I run on DietPi.

Any idea, what the reason is?
Thank you very much!

Required Information:

  • DietPi version | 6.9
  • Distro version | stretch / 9.4
  • Kernel version | 4.14.44-v7+
  • SBC device | RPi 3 Model B+ (armv7l)
  • Power supply used | original Raspberry Pi 3 / 5V 2.5A
  • SDcard used | SanDisk ultra, SDHC, 32GB

Additional Information (if applicable):

  • Software title | Pi-Hole
  • Freshly installed right after setting up DietPi
  • Yes
  • 1f580197-5c1d-47de-bb59-84a00415282a

Steps to reproduce:

  1. Start from scratch with Dietpi / re-install on SD-card
  2. Let first install routine run (incl. updates)
  3. Install Pi-Hole from DietPi Software menu
  4. Watch temperatures via Ph-Hole Web frontend or with watch "cat /sys/class/thermal/thermal_zone0/temp"

Expected behaviour:

I was expecting temperatures to be as low as with original Raspbian image.
Perhaps even a little bit lower, as DietPi runs fewer processes and because I changed the CPU profile to "conservative" which should prefer slower CPU frequencies.

Actual behaviour:

Temperature is slightly higher when running on DietPi. Of course, that's not really bad now. But as higher temperature means faster aging, I am wondering what the cause is.

Extra details:

I use the original Raspberry case and I did some tests with the top cover mounted and some without. Here are the results (average calculated from 13 measurements):

WITH top cover:
DietPi: 57,5 (+2,6)
Raspbian: 54,9

WITHOUT top cover:
DietPi: 51,0 (+3,1)
Raspbian: 47,9

As requested, I will attach my /boot/config.txt.

@helmethawthorn
Copy link
Author

config-txt-dietpi.txt

@helmethawthorn helmethawthorn changed the title RP 3 B+ / Temperature question RPi 3 B+ / Temperature question Jun 10, 2018
@MichaIng
Copy link
Owner

MichaIng commented Jun 10, 2018

I can confirm the issue on fresh DietPi v6.9 (although in my case Buster testing installation) vs fresh Raspbian Lite pre-image:

Raspbian Lite:

root@raspberrypi:~# echo CPU: $(( $(</sys/class/thermal/thermal_zone0/temp) / 1000 )) GPU: $(vcgencmd measure_temp)
CPU: 40 GPU: temp=40.1'C
root@raspberrypi:~# vcgencmd measure_clock arm
frequency(45)=600000000

DietPi Buster:

2018-06-09 22:52:44 root@micha:~# echo CPU: $(( $(</sys/class/thermal/thermal_zone0/temp) / 1000 )) GPU: $(vcgencmd measure_temp)
CPU: 45 GPU: temp=45.5'C
2018-06-09 22:52:50 root@micha:~# vcgencmd measure_clock arm
frequency(45)=900000000
  • Even after 15 idle minutes with 0.00 / 0.00 / 0.00 usage, clock and temperature stay the same,
  • Using default config.txt leads to 600 Mhz and 40 °C. Then trying to put the DietPi default settings inside and:
  • Found 'initial_turbo' to be the problem. Should be 20 seconds, but clock stays at 900 MHz forever or wayyy longer. When taking this setting out, clock goes down to 600 MHz and temperatures to ~40 °C.

I see you installed the newest kernel via rpi-update / dietpi-config? That would have been the next step, as I am on current APT kernel 4.14.34. So this is sadly no single version bug.

@helmethawthorn
Thank you very much for the report btw. The forum indeed is a good start point to share issues, but don't hesitate to open an issue here on github as well, even if you are not sure if it's a bug or a usage issue 😉. DietPi aims to be user friendly, so everything should behave as users (with less Linux experience) would expect it.

Could you try to comment the line, reboot and see if the issue persists or is solved as it was for me? sed -i 's/initial_turbo/#initial_turbo/' /DietPi/config.txt

Further reference:
https://www.raspberrypi.org/documentation/configuration/config-txt/overclocking.md
https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=6201&start=425#p180099

@MichaIng MichaIng added Bug 🐞 Hardware related 💻 Insufficient PSU/SD card, faulty unit and/or peripherals, etc Raspberry Pi labels Jun 10, 2018
@MichaIng MichaIng added this to the v6.10 milestone Jun 10, 2018
@MichaIng MichaIng added External bug 🐞 For bugs which are not caused by DietPi. and removed Bug 🐞 Hardware related 💻 Insufficient PSU/SD card, faulty unit and/or peripherals, etc labels Jun 10, 2018
@helmethawthorn
Copy link
Author

That's interesting!

Although I set the CPU profile to "conservative" and although the command "cpu" shows "Current Freq: 600 MHz",...

 ─────────────────────────────────────────────────────
  DietPi CPU Info
  Use dietpi-config to change CPU / performance options
  ─────────────────────────────────────────────────────
  Architecture |     armv7l
  Temp         |     57'c : 134'f  | Running warm, but safe.
  Governor     |     conservative
  Throttle up  |     50% CPU usage
 
                  Current Freq    Min Freq   Max Freq
  CPU0         |      600 MHz      600 MHz    1400 MHz
  CPU1         |      600 MHz      600 MHz    1400 MHz
  CPU2         |      600 MHz      600 MHz    1400 MHz
  CPU3         |      600 MHz      600 MHz    1400 MHz

...when issuing the command you used ("vcgencmd measure_clock arm") I get this:
frequency(45)=1400000000.
I let it run with "watch" for 30 minutes - and the value never changed.
Does that mean that my RPi runs with full speed all the time instead of throttling? I assume there should be a "600000000" at least sometimes, shouldn't it? ;-)

Will try now to boot without the initial_turbo. Thank you very much!

@MichaIng: I am happy to be able to do my part to make DietPi even better - even if it is only a veeeery small part. - Great software! :-)

@MichaIng
Copy link
Owner

MichaIng commented Jun 10, 2018

@helmethawthorn
Did you try to remove/comment the initial_turbo setting in /DietPi/config.txt?

Hmm so cpu shows current clock = 600 MHz while vcgencmd measure_clock arm shows 1400 at the same time?? This is strange. On my RPi2 both show definitely the current clock (not max clock) and cpu mostly show 1 or 2 cores up at 900 MHz (max for RPi2) due the the script internal load.
It would not make much sense, but maybe the command on RPi3 somehow shows the max clock instead of current? Sadly I have no RPi3 here to investigate, maybe @Fourdee finds some time.

One thing: DietPi default Throttle up is by default at 50% as you can see, which is quite low compared to default, AFAIK. I e.g. use for server only system 85%, as also recommended within performance settings. You could check the default cat /sys/devices/system/cpu/cpufreq/conservative/up_threshold respectively cat /sys/devices/system/cpu/cpufreq/ondemand/up_threshold at Raspbian Lite, in case adjust this within DietPi and check if this leads to equal temperatures.

@helmethawthorn
Copy link
Author

@MichaIng
Meanwhile I have done some testing. With the new (=commented) setting in /DietPi/config.txt, I get the following results:

  • Temperature with top cover: 53,6

    • -3,9 C !
    • (Load 0.00 0.00 0.00)
  • Temperature without top cover: 47,5

    • -3,5 C
    • Load 0.08 0.03 0.01
# vcgencmd measure_clock arm
frequency(45)=600000000
 ─────────────────────────────────────────────────────
 DietPi CPU Info
 Use dietpi-config to change CPU / performance options
 ─────────────────────────────────────────────────────
 Architecture |     armv7l
 Temp         |     48'c : 118'f | Optimal temperature.
 Governor     |     conservative
 Throttle up  |     50% CPU usage

                 Current Freq    Min Freq   Max Freq
 CPU0         |      600 MHz      600 MHz    1400 MHz
 CPU1         |      600 MHz      600 MHz    1400 MHz
 CPU2         |      600 MHz      600 MHz    1400 MHz
 CPU3         |      600 MHz      600 MHz    1400 MHz

Questioning the max/default/current clock settings, you had the right idea, right from the start!

Hmm so cpu shows current clock = 600 MHz while vcgencmd measure_clock arm shows 1400 at the same time?? This is strange.

Indeed. However, with the changed config.txt both are the same now.
When I fire the "cpu" command several times directly one after the other, all cores go straight up to 1.400 MHz. Otherwise they stay at 600 MHz and it seems nothing can make them go up. Maybe the result of the (now working) "conservative" setting?

One thing: DietPi default Throttle up is by default at 50% as you can see,...

Thank you for this hint. :-) I didn't change it before, this is the setting right after the installation. I have increased the value to 85.

By the way: the "Recommended value" for the "ARM Temp Limit" is 65 C - but the configured value is 75 C after the installation. Is there a specific reason for this?

@helmethawthorn
Copy link
Author

helmethawthorn commented Jun 10, 2018

You could check the default cat /sys/devices/system/cpu/cpufreq/conservative/up_threshold respectively cat /sys/devices/system/cpu/cpufreq/ondemand/up_threshold at Raspbian Lite, in case adjust this within DietPi and check if this leads to equal temperatures.

I quickly booted up the "Raspbian SD card". ;-) And "cat /sys/devices/system/cpu/cpufreq/ondemand/up_threshold" says "50". The same as after a fresh DietPi installation. "vcgencmd measure_clock arm" shows 600.

But as the temperature is even a tiny bit lower with DietPi (compared to running on Raspian), I am happy now.

Thank you very much for your help!

PS. 40 C? Why is your temperature that low? Is this normal for a RPi2? Or is your room temperature lower? I have 26 C. ;-)))

@MichaIng
Copy link
Owner

MichaIng commented Jun 10, 2018

@helmethawthorn
Ah, throttle up at 50% is default? Okay that's just another cause elimination then 🙂.

Thank you very much for testing and reporting. Great that we found the cause and even obviously a kernel settings issue that affects all RPi versions (at least 2 and 3). Seems that the initial_turbo somehow breaks CPU governor settings. Just checked past PRs about this: https://github.com/raspberrypi/firmware/search?q=initial_turbo&type=Commits

Maybe firmware: arm_loader: Don't lose force_turbo when initial_turbo completes preserves turbo even if no turbo was set. No idea, I will create an issue about this.

Hmm the last think we could test, just to be sure, is setting initial_turbo on Raspbian Lite and see if it has the same effect there.


Issue: raspberrypi/firmware#1005

@helmethawthorn
Copy link
Author

@MichaIng
Thanks again for YOUR help! Is there anything I can help you with right now?
Does this bug report stay open for further comments/actions or shall I close it, now that the root cause is clear? (Sorry, - I have never used GitHub before. ;-))

@MichaIng MichaIng added the Solution available 🥂 Definite solution has been done label Jun 10, 2018
@MichaIng
Copy link
Owner

MichaIng commented Jun 10, 2018

@helmethawthorn
We can keep the issue opened until we have some reaction from the raspberrypi repo, so we will not forget the issue, if the reaction takes some time 😉.

In case, for v6.10:

  • Remove initial_turbo from default config.txt.
  • Remove initial_turbo via patch_file.

@helmethawthorn
Copy link
Author

Okay! :-)

Any clue why I have only 5 emojis? No smileys at all, - only 👍 👎 💯 🔢 and 🥇.

@MichaIng
Copy link
Owner

@helmethawthorn
After typing :, start to enter some more letters so see other emojis. :smiley: e.g.

@Fourdee
Copy link
Collaborator

Fourdee commented Jun 10, 2018

@MichaIng

Impressive debugging and finding the cause, great work 👍

@MichaIng
Copy link
Owner

As we have another possibly kernel related RPi issue, I just add it here, so we have one place to follow both issues:
Forum: https://dietpi.com/phpbb/viewtopic.php?f=11&t=3886
GitHub: raspberrypi/firmware#1006

In short: rpi-update/4.14.48 seems to break SDcard/the possibility for kernel to mount root.

MichaIng referenced this issue Jun 19, 2018
+ RPi | Disable "initial_turbo" setting within config.txt, as it leads to CPU governor not being able to throttle down CPU: https://github.com/Fourdee/DietPi/issues/1836
@MichaIng
Copy link
Owner

Added PR to fix OT issue: https://github.com/Fourdee/DietPi/pull/1859
We should keep an eye on the RPi firmware issue and revert in case of fix arrived in stable (APT) repo.

@Fourdee
Copy link
Collaborator

Fourdee commented Jun 20, 2018

@MichaIng

Great work, tested fine on RPi 3B+ 👍

MichaIng referenced this issue Jun 20, 2018
+ DietPi-Config | RPi: Disabled initial_turbo setting due to: due to: https://github.com/Fourdee/DietPi/issues/1836
@MichaIng
Copy link
Owner

I mark as closed, until we have some solution from RPi firmware side.

@Fourdee Fourdee mentioned this issue Jun 30, 2018
Fourdee referenced this issue Jul 3, 2018
**v6.10**
(03/07/18)

**Changes / Improvements / Optimizations:**

General | ASUS TB: GLES GPU and VPU support now enabled, once Xserver is installed.

General | 'firmware-iwlwifi': Is now a pre-req to WiFi enable. Adds support for Intel based WiFi chips by default: https://github.com/Fourdee/DietPi/issues/1855

General | "net-tools" commands (ifconfig, netstat, route, ...) were replaced by modern "ip" commands (ip a, ip r, ...) within DietPi scripts and the package therefore removed from DietPi core packages: https://github.com/Fourdee/DietPi/issues/1666

General | Removed unused "/DietPi/config.txt" from non-RPi devices: https://github.com/Fourdee/DietPi/pull/1863

General | CurlFTPFS: Removed from DietPi scripts and is no longer supported. Due to lack of security, and, single digit install count (survey).

General | Timesync: DietPi will now only check for a sucessful sync once per system boot, and, again hourly/daily if set. This is to prevent excess delay of systemd-timesyncd service, once the time has already been synced.

General | Sparky SBC: Designs patch added for DSD on MPD-5 dac , new Ids added Mytek Manhatten , LH labs 1V5 2V0 ,HD-AVP/AVA IDA-8: https://github.com/sparky-sbc/sparky-test/tree/master/dsd-marantz

DietPi-Backup | Rewritten. Userdata option removed, included by default backup. Added options to edit include/exclude filters in the GUI. Existing backups (v6.9 or less) are no longer supported: https://github.com/Fourdee/DietPi/issues/1851

DietPi-Config | Soundcards (RPi): Allo Katana, now available for selection. https://github.com/Fourdee/DietPi/issues/1849

DietPi-Config | IntelGPU Driver: Installation code added: https://github.com/Fourdee/DietPi/issues/1855#issue-333150262

DietPi-Config | Networking: You can now view the sent and recieved totals for both network devices. NB: 32bit devices will reset the values after 32bit int limit is reached (roughly 4.3GB~), this is a kernel/arch limitation: https://github.com/Fourdee/DietPi/issues/1666#issuecomment-401546728

DietPi-Drive_Manager | Rewrite and improvements:
 - Now supports ROM devices (eg: DVD). NB: compatibility for DVD/CD devices relies on kernel support. Not all devices will support DVD/CD devices, and/or their filesystem format: https://github.com/Fourdee/DietPi/issues/1858
 - Resize ext4 options added: https://github.com/Fourdee/DietPi/issues/1821
 - Support for detecting and formatting non-partitioned drives
 - You can now benchmark read/write for all available mounted drives: https://github.com/Fourdee/DietPi/issues/1858
 - Now supports mounting, viewing, removal of network drives on system (nfs4, cifs). This replaces the previous options in 'dietpi-config': https://github.com/Fourdee/DietPi/issues/1858
 - Moving of DietPi user data to filesystems that do not support permission (FAT), is no longer supported and disabled: https://github.com/Fourdee/DietPi/issues/1846

DietPi-Globals | G_BACKUP: Added to globals. This will be gradually rolled out in DietPi scripts, allowing the user to create a system backup, prior to significant system changes: https://github.com/Fourdee/DietPi/issues/1871#issuecomment-400443401

DietPi-Globals | G_CHECK_USERDATA: Added to DietPi scripts: https://github.com/Fourdee/DietPi/issues/1850#issuecomment-401407996

DietPi-Services | Rsync: Added to service control. This will prevent errors if rsync is running in daemon mode, when 'dietpi-backup' is run: https://github.com/Fourdee/DietPi/issues/1869#issuecomment-399890771

DietPi-Software | Ubooquity: Now available for installation: https://dietpi.com/phpbb/viewtopic.php?f=8&t=5&p=12969#p12969 (https://github.com/Fourdee/DietPi/issues/1845#issuecomment-397447909)

DietPi-Software | Roon Extension Manager: Now available for installation. Many thanks to @JanKoudijs for contributing this great addition!: https://github.com/Fourdee/DietPi/pull/1865

DietPi-Software | Mosquitto: Now uses Debian APT installation: https://github.com/Fourdee/DietPi/issues/1868#issuecomment-399982278

DietPi-Software | Gogs: Now runs under its own user. For new installations only: https://github.com/Fourdee/DietPi/issues/1877

DietPi-Software | Xserver: 'mesa-utils-extra' now also installed by default, useful for GLES testing 'es2_info es2gears' etc.

DietPi-Software | Moode: Removed from our software lineup: https://github.com/Fourdee/DietPi/issues/1223#issuecomment-401549371

DietPi-Software | Radarr, Sonarr and Jackett: Services optimized and no longer run in debugging mode. Should improve runtime performance. Many thanks to @userdeveloper98 for this contribution! https://github.com/Fourdee/DietPi/pull/1889

DietPi-Survey | Simplified available options. You can now either Opt In, or, Opt Out and automatically have any existing data cleared. Interactive installations will be prompted to Opt In or Out during 1st run. Automated installations are Opted In by default, you can change this once setup is completed. More information on DietPi-Survey and how to change the options: https://dietpi.com/phpbb/viewtopic.php?f=8&t=20 https://github.com/Fourdee/DietPi/issues/1827#issuecomment-396005575

PREP | 'os-prober' installed by default for x86_64 devices. Ensures dual boot OSs are detected by grub. Also added a 3 second timeout to grub boot prompt, allowing OS selection: https://github.com/Fourdee/DietPi/issues/1855

**Bug Fixes:**

ASUS TB | Resolved square (broken) X11 fonts.

Raspberry Pi | Removed "initial_turbo" setting from DietPi-Config and config.txt, as it prevents CPU governor from throttling down: https://github.com/Fourdee/DietPi/issues/1836

DietPi-Drive_Manager | Resolved incorrect detection of available drives: https://github.com/Fourdee/DietPi/issues/1858

DietPi-Software | GMrender: Resolved an issue where two systems on the same network would nullify the other. Hostname is now used for the server name, UUID used is applied via DietPi generated UUID during 1st run: https://dietpi.com/phpbb/viewtopic.php?f=11&t=3900&p=12985#p12985

DietPi-Software | Apache2: Fixed a syntax error that leads to Apache logging to "/error.log" instead of "/var/log/apache2/error.log"

DietPi-Software | Nukkit: Fixed the broken download link on installation. Many thanks to @symbios24 for reporting bug and providing solution: https://github.com/Fourdee/DietPi/issues/1875

DietPi-Software | Linux software: Resolved an issue with NULL entry being displayed: https://github.com/Fourdee/DietPi/pull/1830#issuecomment-401612168

DietPi-Config | Fixen an issue, where IPv6 could not be disabled on RPi. On current kernel version it is no dedicated kernel module any more and needs to be toggled via "/boot/cmdline.txt".

**AlloGUI v9:**
- Changing the root password, no longer breaks web interface: https://github.com/Fourdee/DietPi/issues/1841
- Resolved issues with terminal leakage in the web interface: https://github.com/Fourdee/DietPi/issues/1841
- System settings: Current version is always shown, even if an update is available.
- System settings: Allo Katana, now available for selection. https://github.com/Fourdee/DietPi/issues/1849
@helmethawthorn
Copy link
Author

@MichaIng - Hi, long time no see! ;-))

I have just updated my DietPi to v6.26.3, which re-adds the "initial_turbo" setting again. When the window popped up while updating I remembered taking my first steps on RPi here on Github, - nearly 1.5 years ago. ;-)

Unfortunately, the initial_turbo option does NOT work for me. Instead, the CPU freq stays at 1.4GHz again - and the temps raise. When I comment the turbo option out, the CPU freq goes down to 600MHz again. - Have checked it several times.

I have also set the value to "2", just in case someone changed it from seconds to minutes. ;-)

Is there anything else I could to do?

Thank you and kind regards!

@helmethawthorn
Copy link
Author

watch "cat /sys/class/thermal/thermal_zone0/temp && vcgencmd measure_temp && vcgencmd measure_clock arm"

***WITH "initial_turbo" ****

60148
temp=60.1'C
frequency(45)=1400000000

***WITHOUT "initial_turbo" ****

57458
temp=57.5'C
frequency(45)=600000000

@MichaIng
Copy link
Owner

@helmethawthorn
Many thanks for your report.

That is very strange, we tested it up and down with several users (RPi dev side as well) on RPi2+3+4 and it worked (and in my case works) very well 🤔.

Which kernel version do you use? uname -r
You use ondemand governor? cat /sys/devices/system/cpu/cpufreq/policy0/scaling_governor
And to assure that it indeed never is in 600 MHz state when booting with initial_turbo: cat /sys/devices/system/cpu/cpufreq/policy0/stats/time_in_state

And it is still the time in seconds 😉. Values over 60 (1 minute) are not allowed/ignored anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
External bug 🐞 For bugs which are not caused by DietPi. Raspberry Pi Solution available 🥂 Definite solution has been done Via Forum
Projects
None yet
Development

No branches or pull requests

3 participants