MichaIng / DietPi

Lightweight justice for your single-board computer!
https://dietpi.com/
GNU General Public License v2.0
4.83k stars 494 forks source link

Image | Raspberry Pi 5: Testing and firmware migration script #6676

Open TDuffinNTU opened 12 months ago

TDuffinNTU commented 12 months ago

ADMIN EDIT

First Raspberry Pi 5 testing images are available now on our download page: https://dietpi.com/#download You can also find images with the new kernel/firmware package set for other RPi models here: https://dietpi.com/downloads/images/testing/ The ones with the new firmware have "RPi1", "RPi2" and "RPi234" (64-bit) in their names. To migrate an existing system, use the migration script:

bash <(curl -sSf 'https://raw.githubusercontent.com/MichaIng/DietPi/dev/.meta/dietpi-rpi-firmware-migration')

WARNING: This is currently a one-way ticket. dietpi-backup cannot be used to restore the old system, since the boot partition mount point has changed. If you want to be able to revert, create an image of the whole SD card/drive. dietpi-imager can be used from another DietPi (or Debian/Ubuntu) system, to minimise partition and filesystem automatically, to have a small compressed backup image.


Is the SBC officially supported by the Debian installer?

Notes

MichaIng commented 9 months ago

@sorriso93 I mean the one selected here must be set to [On]: image

@dirkhh Thanks for your vote. If I see it correctly, it is 4:2 for option 2 and one in the middle. From the team, we also tend to prefer option 2: it is clearly more the "Diet" way of things and would contradict our efforts elsewhere do ship images with minimal size and minimal disk writes. We'll assure to make it as easy as possible to install additional kernel packages for other RPi models and add this info to some prominent place.

I will hold back generating native RPi 5 images a little, because I want to annoy you guys πŸ˜„. Jokes aside: We want to roll out the firmware/kernel migration to all RPi Bookworm users via dietpi-update, probably optional at first, but mandatory at some point. Because the old kernel packages do not receive updates anymore, leaving the system with potential vulnerabilities, and also to make it easier handling RPi systems in our scripts based on distro version only, instead of keeping another check regarding kernel packages and partitioning. And since this migration is process touches an essential part of the system, I want to have as many testers as possible at first. Having the migration script as mandatory step to run/test DietPi on RPi 5, means a lot more testers πŸ˜›.

We will add the kernel selection menu to the script as well, to allow a slim and faster migration, and make people aware of this image compatibility change right from the start.

dirkhh commented 9 months ago

I will hold back generating native RPi 5 images a little, because I want to annoy you guys πŸ˜„.

That was my assumption - I can't make adsb.im feeder images until there are native images, though 😞

Having the migration script as mandatory step to run/test DietPi on RPi 5, means a lot more testers πŸ˜›.

True - but it makes it harder for projects downstream from you that want to be able to support this exciting new SBC (which actually starts to show some availability - at least the 4GB version)

MichaIng commented 9 months ago

@alfredoanton82 Nope, this setting is indeed for enabling temperature controlled cooling. As said, according to some docs, this parameter should be set automatically by the firmware, as fast as it detects a tach signal on the fan port, so it is the intended default behaviour. Out of interest, did the fan start right away then running dtparam cooling_fan=on, or was a reboot required? Or the other way round, does it stop immediately when you run dtparam cooling_fan=off?

And btw, the temperatures at which the fan starts, respectively increases its speed, can be adjusted with those files:

/sys/devices/virtual/thermal/thermal_zone0/trip_point_1_temp
/sys/devices/virtual/thermal/thermal_zone0/trip_point_2_temp
/sys/devices/virtual/thermal/thermal_zone0/trip_point_3_temp
/sys/devices/virtual/thermal/thermal_zone0/trip_point_4_temp

It contains/takes the temperatures in millidegree Celsius.

And if someone could check these files, I hope to find nodes for the related fan speeds there:

ls -l /sys/devices/platform/cooling_fan/hwmon/*/
for i in /sys/devices/platform/cooling_fan/hwmon/*/fan1_input; do echo -n "$i: "; cat "$i"; done

The default was about 30/50/70/90% fan speed for the 4 temperature trip points, IIRC.

@dirkhh There is anyway some more work and testing required, to assure DietPi works well on the RPi 5 and supports at least its most essential features, apart of the new kernel images. I do not intend to artificially hold back RPi 5 images when we think that DietPi has been sufficiently tested on it already. The idea is just to combine testing DietPi on RPi 5 with testing the migration script for a while. Otherwise I fear that the script might come short, and I do not want to face surprises when we roll it out via dietpi-update.

Kreeblah commented 9 months ago

Another vote for option 2 here.

Also, I just ran the migration script on an RPi 4 model B, and while I'm able to reboot with it, /dev/pps0 seems to be missing now. I had it set up before with dtoverlay=pps-gpio,gpiopin=18 in /boot/config.txt and I do see that that line got migrated over to /boot/firmware/config.txt, so I'm not sure what's changed here.

Additionally, the RTC I have installed doesn't seem to be getting the driver loaded now, even though dtoverlay=i2c-rtc,rv3028 also was migrated over to /boot/firmware/config.txt.

Edit: This is on v8.25.1.

dirkhh commented 9 months ago

@dirkhh There is anyway some more work and testing required, to assure DietPi works well on the RPi 5 and supports at least its most essential features, apart of the new kernel images. I do not intend to artificially hold back RPi 5 images when we think that DietPi has been sufficiently tested on it already. The idea is just to combine testing DietPi on RPi 5 with testing the migration script for a while. Otherwise I fear that the script might come short, and I do not want to face surprises when we roll it out via dietpi-update.

I know that more testing is needed. I will call you on your inconsistency here, though...

"I do not intend to artificially hold back RPi 5 images"

and ( a couple of posts above )

"Having the migration script as mandatory step to run/test DietPi on RPi 5, means a lot more testers πŸ˜›."

You can't really have it both ways. I'm not blaming you for using the PR i5 early adopters as guinea pigs and forced testers for the script in questions - but I think you should own up to it. "Yes, we are absolutely holding back the RPi 5 native image because this way this critical script will get more testing." I'm ok with that statement. I'm a bit unhappy with the opposite claim as that appears a wee bit dishonest.

sorriso93 commented 9 months ago

@sorriso93 I mean the one selected here must be set to [On]: image

I didn't have the option to turn on wifi (third row) and now I have serious problem with the SSD, it's the third time it starts in emergency mode...

MichaIng commented 9 months ago

@dirkhh I probably phrased it misleadingly: I meant that I do not want to hold back RPi 5 images even when we think that DietPi runs stable (sufficiently tested, basic features working) on RPi 5, only to further test the migration script. But as long as RPi 5 requires testing and development anyway, for a while I will not promote RPi 5 images, to have testing of RPi 5 and the script combined. Or seeing it from another point of view: Before implementing support to our build/installer scripts, I will use some time to investigate RPi 5 related issues reported here, and in case issues with the script, working on them, and start working on build/installer integration a little later.

But of course at some point we also need to test fresh RPi 5 images, i.e. whether the new packages and mount point are correctly generated by our build and installer scripts.

@sorriso93 Found it: https://github.com/MichaIng/DietPi/commit/f52d625 Try this:

apt install patch
cd /boot
curl -sSf 'https://github.com/MichaIng/DietPi/commit/f52d625.patch' | patch -p1
/boot/dietpi/func/dietpi-obtain_hw_model
dietpi-config 8

Now the option should show up.

EDIT: Does someone have an idea how to efficiently and reliably check whether the currently used RPi model has an onboard WiFi adapter or not? Of course we can keep just adding a flag for those where we know that they have it, but if there is some kernel or device tree node to find out about it, that would be great. Also e.g. I am not sure whether the compute modules have, or their base boards can have onboard WiFi/BT adapters, meaning that they can be controlled, with the dtoverlay=disable-wifi/dtoverlay=disable-bt device tree overlays.

sorriso93 commented 9 months ago

@dirkhh

I probably phrased it misleadingly: I meant that I do not want to hold back RPi 5 images even when we think that DietPi runs stable (sufficiently tested, basic features working) on RPi 5, only to further test the migration script. But as long as RPi 5 requires testing and development anyway, for a while I will not promote RPi 5 images, to have testing of RPi 5 and the script combined. Or seeing it from another point of view: Before implementing support to our build/installer scripts, I will use some time to investigate RPi 5 related issues reported here, and in case issues with the script, working on them, and start working on build/installer integration a little later.

But of course at some point we also need to test fresh RPi 5 images, i.e. whether the new packages and mount point are correctly generated by our build and installer scripts.

@sorriso93

Found it: https://github.com/MichaIng/DietPi/commit/f52d625

Try this:


apt install patch

cd /boot

curl -sSf 'https://github.com/MichaIng/DietPi/commit/f52d625.patch' | patch -p1

/boot/dietpi/func/dietpi-obtain_hw_model

dietpi-config 8

Now the option should show up.

EDIT: Does someone have an idea how to efficiently and reliably check whether the currently used RPi model has an onboard WiFi adapter or not? Of course we can keep just adding a flag for those where we know that they have it, but if there is some kernel or device tree node to find out about it, that would be great. Also e.g. I am not sure whether the compute modules have, or their base boards can have onboard WiFi/BT adapters, meaning that they can be controlled, with the dtoverlay=disable-wifi/dtoverlay=disable-bt device tree overlays.

Thanks. I will try as soon as I'm back from vacation because I think my problem with ssd is due to lack of power (running with a 3 amp πŸ˜‚). Anyway I ordered the power supply and then I will reinstall all from scratch

dirkhh commented 9 months ago

The upgrade script worked flawlessly (on a RPi 4b - fresh install from the latest DietPi image freshly downloaded), plugged the SD card into the RPi 5, booted, connected to WiFi, all seems fine. It does seem to run quite warm - completely idle after half and hour it's at 57ΒΊC. That's with the original red/white case with fan... Is there any additional info that would help?

MichaIng commented 9 months ago

Did the fan run OOTB in your case, without applying dtparam=cooling_fan=on first?

Further interesting outputs:

ls -l /sys/devices/platform/cooling_fan/hwmon/*/
for i in /sys/devices/platform/cooling_fan/hwmon/*/fan1_input; do echo -n "$i: "; cat "$i"; done
cpu
vcgencmd get_config int

And whether/how the max frequencies change with arm_boost=1:

G_CONFIG_INJECT 'arm_boost=' 'arm_boost=1' /boot/config.txt
reboot
cpu
vcgencmd get_config int

Sadly the RPi 5 is known to have a pretty high temperature emissions and hence require an active cooling, just like the RPi 4 when it was released. And the default case without massive metal heat sink is probably not great either if good cooling is required. I do blame RPi for not taking care of this after the negative feedback on RPi 4 at the beginning regarding this: Use ARM big.LITTLE (or how it's successor is named), i.e. smaller and larger CPU cores mixed, hardware h264/h265 decoders, and such, there would have been quite some options.

dirkhh commented 9 months ago

Fan started running soon after boot and has been running ever since.

root@DietPi:~# ls -l /sys/devices/platform/cooling_fan/hwmon/*/
lrwxrwxrwx 1 root root     0 Dec 23 08:28 device -> ../../../cooling_fan
-r--r--r-- 1 root root 16384 Dec 23 08:28 fan1_input
-r--r--r-- 1 root root 16384 Dec 23 08:28 name
lrwxrwxrwx 1 root root     0 Dec 23 08:28 of_node -> ../../../../../firmware/devicetree/base/cooling_fan
drwxr-xr-x 2 root root     0 Dec 23 08:28 power
-rw-r--r-- 1 root root 16384 Dec 23 08:28 pwm1
-rw-r--r-- 1 root root 16384 Dec 23 08:28 pwm1_enable
lrwxrwxrwx 1 root root     0 Dec 23 08:28 subsystem -> ../../../../../class/hwmon
-rw-r--r-- 1 root root 16384 Dec 22 16:26 uevent

root@DietPi:~# for i in /sys/devices/platform/cooling_fan/hwmon/*/fan1_input; do echo -n "$i: "; cat "$i"; done
/sys/devices/platform/cooling_fan/hwmon/hwmon2/fan1_input: 1864

root@DietPi:~# cpu
 ─────────────────────────────────────────────────────
 DietPi CPU Info
 Use dietpi-config to change CPU / performance options
 ─────────────────────────────────────────────────────
 Architecture |     aarch64
 Temperature  |     59 Β°C / 138 Β°F : Running warm, but safe
 Governor     |     schedutil

                Current Freq    Min Freq   Max Freq
 CPU0         |      1600 MHz      1000 MHz    2400 MHz
 CPU1         |      1600 MHz      1000 MHz    2400 MHz
 CPU2         |      1600 MHz      1000 MHz    2400 MHz
 CPU3         |      1600 MHz      1000 MHz    2400 MHz

[ INFO ] DietPi-CPU_info | The current CPU frequency may be affected by processing this script itself.

root@DietPi:~# vcgencmd get_config int
arm_64bit=1
arm_freq=2400
arm_freq_min=1000
arm_peri_high=1
audio_pwm_mode=2
avs_temp=22991
camera_auto_detect=-1
core_freq=910
core_freq_min=500
disable_commandline_tags=2
disable_fw_kms_setup=1
disable_l2cache=1
disable_overscan=1
disable_splash=1
display_default_lcd=-1
display_hdmi_rotate=-1
display_lcd_rotate=-1
dvfs=4
enable_gic=1
force_eeprom_read=1
force_pwm_open=1
framebuffer_depth=16
framebuffer_ignore_alpha=1
framebuffer_swap=1
gpu_freq_min=500
hdmi_blanking=1
hdmi_enable_4kp60=1
hevc_freq=910
hevc_freq_min=500
ignore_lcd=-1
init_uart_clock=0x2dc6c00
initial_turbo=20
isp_freq=910
isp_freq_min=500
max_framebuffers=1
over_voltage_avs=0x2a490
pause_burst_frames=1
pciex4_reset=1
program_serial_random=1
temp_limit=75
total_mem=4096
v3d_freq=960
v3d_freq_min=500
vpred=9332
hdmi_force_cec_address:0=65535
hdmi_force_cec_address:1=65535

and after the reboot:

root@DietPi:~# cpu

 ─────────────────────────────────────────────────────
 DietPi CPU Info
 Use dietpi-config to change CPU / performance options
 ─────────────────────────────────────────────────────
 Architecture |     aarch64
 Temperature  |     56 Β°C / 132 Β°F : Running warm, but safe
 Governor     |     schedutil

                 Current Freq    Min Freq   Max Freq
 CPU0         |      1600 MHz      1000 MHz    2400 MHz
 CPU1         |      1600 MHz      1000 MHz    2400 MHz
 CPU2         |      1600 MHz      1000 MHz    2400 MHz
 CPU3         |      1600 MHz      1000 MHz    2400 MHz

[ INFO ] DietPi-CPU_info | The current CPU frequency may be affected by processing this script itself.

root@DietPi:~# vcgencmd get_config int
arm_64bit=1
arm_boost=1
arm_freq=2400
arm_freq_min=1000
arm_peri_high=1
audio_pwm_mode=2
avs_temp=53767
camera_auto_detect=-1
core_freq=910
core_freq_min=500
disable_commandline_tags=2
disable_fw_kms_setup=1
disable_l2cache=1
disable_overscan=1
disable_splash=1
display_default_lcd=-1
display_hdmi_rotate=-1
display_lcd_rotate=-1
dvfs=4
enable_gic=1
force_eeprom_read=1
force_pwm_open=1
framebuffer_depth=16
framebuffer_ignore_alpha=1
framebuffer_swap=1
gpu_freq_min=500
hdmi_blanking=1
hdmi_enable_4kp60=1
hevc_freq=910
hevc_freq_min=500
ignore_lcd=-1
init_uart_clock=0x2dc6c00
initial_turbo=20
isp_freq=910
isp_freq_min=500
max_framebuffers=1
over_voltage_avs=0x2b23c
pause_burst_frames=1
pciex4_reset=1
program_serial_random=1
temp_limit=75
total_mem=4096
v3d_freq=960
v3d_freq_min=500
vpred=9367
hdmi_force_cec_address:0=65535
hdmi_force_cec_address:1=65535
dirkhh commented 9 months ago

So what else can I do to help with this? Run the script on a few other DietPi installs (I have, err, a few)? Run benchmarks? Try stuff? I (unsurprisingly) installed the ADS-B stack and have been running this over night with no odd observations...

Kreeblah commented 9 months ago

I've been taking a look at the issues from the migration script in https://github.com/MichaIng/DietPi/issues/6676#issuecomment-1868056698 and I'm still not sure what's going on.

I'm running the new kernel:

# uname -a
Linux ntp 6.1.0-rpi7-rpi-v8 #1 SMP PREEMPT Debian 1:6.1.63-1+rpt1 (2023-11-24) aarch64 GNU/Linux

I see that /usr/lib/linux-image-6.1.0-rpi7-rpi-v8/overlays/pps-gpio.dtbo and /usr/lib/modules/6.1.0-rpi7-rpi-v8/kernel/drivers/pps/clients/pps-gpio.ko.xz exist. Checking https://github.com/raspberrypi/linux/blob/rpi-6.1.y/arch/arm/boot/dts/overlays/pps-gpio-overlay.dts, the parameter for specifying the GPIO pin to use for PPS is still gpiopin. I'd think that should be enough to get the PPS driver up and running.

Similarly, I see that /usr/lib/linux-image-6.1.0-rpi7-rpi-v8/overlays/i2c-rtc-gpio.dtbo and /usr/lib/modules/6.1.0-rpi7-rpi-v8/kernel/drivers/rtc/rtc-rv3028.ko.xz exist, and I don't see anything that stands out to me in https://github.com/raspberrypi/linux/blob/rpi-6.1.y/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts.

I also double-checked /etc/modules, and it still looks the same:

i2c-bcm2708
i2c-dev
pps-gpio

I don't want to sidetrack the RPi 5 issue, so I'm going to make a new one for this.

dirkhh commented 9 months ago

Hmm - just noticed that the RPi5 died. Unresponsive to ping, fan is off. Reboot is uneventful - but of course there are no logs from prior to the crash... πŸ€·πŸΌβ€β™‚οΈ

edited to add: looks like this may have been a power supply issue. I connected it to the wrong USB-C cable so it wasn't a PD but an old style 5V/4A power supply... I'll keep monitoring this

Joulinar commented 9 months ago

guys can someone test our dietpi-dashboard if it is running on RPi5

dirkhh commented 9 months ago

guys can someone test our dietpi-dashboard if it is running on RPi5

I've never used this, so I don't know what to expect. I installed it with dietpi-software - then what? Connecting to port :5252 doesn't give me anything. I don't see an obvious process running? Do I need to start it somehow? There does appear to be an executable in /opt/dietpi-dashboard -- trying to run that gets me a SIGSEGV

edited to add: ah, reading through the install log - that would be the binary, it's statically linked, and it crashes on launch - which is why the service that was enabled to start it then died. So I guess the answer is "nope, doesn't work".

Joulinar commented 9 months ago

Thx for confirming the issue with our Dashboard. Probably related to new kernel.

Edit: ahhh latest nightly build is working.

dirkhh commented 9 months ago

silly me - I should have thought about testing the latest nightly build. I can confirm that that works here as well. With it and the ADS-B feeder running my CPU is now at 60ΒΊC... Is the fan already set up to respond to temperature, or is this something that still needs manual tuning? It feels like it's running fairly slowly (and rather quietly)...

Joulinar commented 9 months ago

It did some stress testing using our DietPi stress option. Even after burning CPU for 5 minutes, it never goes above 62Β°C. As well fan speed was spinning up/down depending on temperature.

 Stress Test
─────────────────────────────────────────────────────
 Mode: Running stress test for 60 seconds

[ INFO ] DietPi-Config | To terminate, type: killall stress
stress: info: [1579] dispatching hogs: 8 cpu, 0 io, 0 vm, 0 hdd
Tue Dec 26 00:12:50 CET 2023 | 48 Β°C | 60 seconds remaining | Fan Speed 2689
Tue Dec 26 00:12:51 CET 2023 | 53 Β°C | 59 seconds remaining | Fan Speed 2688
Tue Dec 26 00:12:52 CET 2023 | 54 Β°C | 58 seconds remaining | Fan Speed 2684
Tue Dec 26 00:12:53 CET 2023 | 54 Β°C | 57 seconds remaining | Fan Speed 2690
Tue Dec 26 00:12:54 CET 2023 | 54 Β°C | 56 seconds remaining | Fan Speed 2690
Tue Dec 26 00:12:55 CET 2023 | 55 Β°C | 55 seconds remaining | Fan Speed 2687
Tue Dec 26 00:12:56 CET 2023 | 56 Β°C | 54 seconds remaining | Fan Speed 2687
Tue Dec 26 00:12:57 CET 2023 | 56 Β°C | 53 seconds remaining | Fan Speed 2687
Tue Dec 26 00:12:58 CET 2023 | 55 Β°C | 52 seconds remaining | Fan Speed 2692
Tue Dec 26 00:13:00 CET 2023 | 55 Β°C | 50 seconds remaining | Fan Speed 2688
Tue Dec 26 00:13:01 CET 2023 | 57 Β°C | 49 seconds remaining | Fan Speed 2689
Tue Dec 26 00:13:02 CET 2023 | 55 Β°C | 48 seconds remaining | Fan Speed 2689
Tue Dec 26 00:13:03 CET 2023 | 57 Β°C | 47 seconds remaining | Fan Speed 2694
Tue Dec 26 00:13:04 CET 2023 | 57 Β°C | 46 seconds remaining | Fan Speed 2690
Tue Dec 26 00:13:05 CET 2023 | 56 Β°C | 45 seconds remaining | Fan Speed 2695
Tue Dec 26 00:13:06 CET 2023 | 56 Β°C | 44 seconds remaining | Fan Speed 2691
Tue Dec 26 00:13:07 CET 2023 | 56 Β°C | 43 seconds remaining | Fan Speed 2690
Tue Dec 26 00:13:08 CET 2023 | 56 Β°C | 42 seconds remaining | Fan Speed 2691
Tue Dec 26 00:13:09 CET 2023 | 57 Β°C | 41 seconds remaining | Fan Speed 2695
Tue Dec 26 00:13:11 CET 2023 | 56 Β°C | 39 seconds remaining | Fan Speed 2697
Tue Dec 26 00:13:12 CET 2023 | 56 Β°C | 38 seconds remaining | Fan Speed 2693
Tue Dec 26 00:13:13 CET 2023 | 57 Β°C | 37 seconds remaining | Fan Speed 2693
Tue Dec 26 00:13:14 CET 2023 | 58 Β°C | 36 seconds remaining | Fan Speed 2694
Tue Dec 26 00:13:15 CET 2023 | 58 Β°C | 35 seconds remaining | Fan Speed 2699
Tue Dec 26 00:13:16 CET 2023 | 58 Β°C | 34 seconds remaining | Fan Speed 2694
Tue Dec 26 00:13:17 CET 2023 | 57 Β°C | 33 seconds remaining | Fan Speed 2694
Tue Dec 26 00:13:18 CET 2023 | 57 Β°C | 32 seconds remaining | Fan Speed 2700
Tue Dec 26 00:13:19 CET 2023 | 58 Β°C | 31 seconds remaining | Fan Speed 2701
Tue Dec 26 00:13:20 CET 2023 | 57 Β°C | 30 seconds remaining | Fan Speed 2701
Tue Dec 26 00:13:22 CET 2023 | 58 Β°C | 28 seconds remaining | Fan Speed 2702
Tue Dec 26 00:13:23 CET 2023 | 58 Β°C | 27 seconds remaining | Fan Speed 2702
Tue Dec 26 00:13:24 CET 2023 | 58 Β°C | 26 seconds remaining | Fan Speed 2702
Tue Dec 26 00:13:25 CET 2023 | 58 Β°C | 25 seconds remaining | Fan Speed 2703
Tue Dec 26 00:13:26 CET 2023 | 58 Β°C | 24 seconds remaining | Fan Speed 2704
Tue Dec 26 00:13:27 CET 2023 | 58 Β°C | 23 seconds remaining | Fan Speed 2705
Tue Dec 26 00:13:28 CET 2023 | 58 Β°C | 22 seconds remaining | Fan Speed 4370
Tue Dec 26 00:13:29 CET 2023 | 59 Β°C | 21 seconds remaining | Fan Speed 4411
Tue Dec 26 00:13:30 CET 2023 | 58 Β°C | 20 seconds remaining | Fan Speed 4427
Tue Dec 26 00:13:31 CET 2023 | 58 Β°C | 19 seconds remaining | Fan Speed 4427
Tue Dec 26 00:13:32 CET 2023 | 58 Β°C | 17 seconds remaining | Fan Speed 4437
Tue Dec 26 00:13:34 CET 2023 | 60 Β°C | 16 seconds remaining | Fan Speed 4449
Tue Dec 26 00:13:35 CET 2023 | 59 Β°C | 15 seconds remaining | Fan Speed 4456
Tue Dec 26 00:13:36 CET 2023 | 58 Β°C | 14 seconds remaining | Fan Speed 4476
Tue Dec 26 00:13:37 CET 2023 | 60 Β°C | 13 seconds remaining | Fan Speed 4476
Tue Dec 26 00:13:38 CET 2023 | 59 Β°C | 12 seconds remaining | Fan Speed 4493
Tue Dec 26 00:13:39 CET 2023 | 58 Β°C | 11 seconds remaining | Fan Speed 4503
Tue Dec 26 00:13:40 CET 2023 | 60 Β°C | 10 seconds remaining | Fan Speed 4507
Tue Dec 26 00:13:41 CET 2023 | 58 Β°C | 9 seconds remaining | Fan Speed 4516
Tue Dec 26 00:13:42 CET 2023 | 59 Β°C | 8 seconds remaining | Fan Speed 4516
Tue Dec 26 00:13:44 CET 2023 | 60 Β°C | 6 seconds remaining | Fan Speed 4532
Tue Dec 26 00:13:45 CET 2023 | 60 Β°C | 5 seconds remaining | Fan Speed 4532
Tue Dec 26 00:13:46 CET 2023 | 58 Β°C | 4 seconds remaining | Fan Speed 4545
Tue Dec 26 00:13:47 CET 2023 | 60 Β°C | 3 seconds remaining | Fan Speed 4556
Tue Dec 26 00:13:48 CET 2023 | 58 Β°C | 2 seconds remaining | Fan Speed 4563
Tue Dec 26 00:13:49 CET 2023 | 60 Β°C | 1 seconds remaining | Fan Speed 4569
stress: info: [1579] successful run completed in 60s

You see fan speed jumping at around 60Β°C

And it goes down quickly once stress test finished.

root@DietPi5:~# cat /sys/devices/platform/cooling_fan/hwmon/hwmon2/fan1_input
2817
root@DietPi5:~# cpu

 ─────────────────────────────────────────────────────
 DietPi CPU Info
 Use dietpi-config to change CPU / performance options
 ─────────────────────────────────────────────────────
 Architecture |     aarch64
 Temperature  |     52 Β°C / 125 Β°F : Running warm, but safe
 Governor     |     schedutil

                 Current Freq    Min Freq   Max Freq
 CPU0         |      1500 MHz      1000 MHz    2400 MHz
 CPU1         |      1500 MHz      1000 MHz    2400 MHz
 CPU2         |      1500 MHz      1000 MHz    2400 MHz
 CPU3         |      1500 MHz      1000 MHz    2400 MHz

[ INFO ] DietPi-CPU_info | The current CPU frequency may be affected by processing this script itself.

root@DietPi5:~#
dirkhh commented 9 months ago

Mine doesn't show fan speed. And quickly reaches 74ΒΊC:

 Stress Test
─────────────────────────────────────────────────────
 Mode: Running stress test for 300 seconds

[ INFO ] DietPi-Config | To terminate, type: killall stress
stress: info: [2473654] dispatching hogs: 8 cpu, 4 io, 4 vm, 0 hdd
Mon Dec 25 15:48:23 PST 2023 | 63 Β°C | 300 seconds remaining
Mon Dec 25 15:48:24 PST 2023 | 65 Β°C | 298 seconds remaining
Mon Dec 25 15:48:26 PST 2023 | 70 Β°C | 297 seconds remaining
Mon Dec 25 15:48:27 PST 2023 | 68 Β°C | 296 seconds remaining
Mon Dec 25 15:48:28 PST 2023 | 68 Β°C | 295 seconds remaining
Mon Dec 25 15:48:30 PST 2023 | 69 Β°C | 293 seconds remaining
Mon Dec 25 15:48:31 PST 2023 | 70 Β°C | 292 seconds remaining
Mon Dec 25 15:48:32 PST 2023 | 70 Β°C | 291 seconds remaining
Mon Dec 25 15:48:34 PST 2023 | 71 Β°C | 289 seconds remaining
Mon Dec 25 15:48:35 PST 2023 | 71 Β°C | 288 seconds remaining
Mon Dec 25 15:48:36 PST 2023 | 72 Β°C | 287 seconds remaining
Mon Dec 25 15:48:38 PST 2023 | 73 Β°C | 285 seconds remaining
Mon Dec 25 15:48:39 PST 2023 | 72 Β°C | 284 seconds remaining
Mon Dec 25 15:48:40 PST 2023 | 71 Β°C | 283 seconds remaining
Mon Dec 25 15:48:41 PST 2023 | 72 Β°C | 282 seconds remaining
Mon Dec 25 15:48:43 PST 2023 | 73 Β°C | 280 seconds remaining
Mon Dec 25 15:48:44 PST 2023 | 72 Β°C | 279 seconds remaining
Mon Dec 25 15:48:46 PST 2023 | 74 Β°C | 277 seconds remaining
Mon Dec 25 15:48:47 PST 2023 | 72 Β°C | 276 seconds remaining
Mon Dec 25 15:48:48 PST 2023 | 72 Β°C | 275 seconds remaining
Mon Dec 25 15:48:49 PST 2023 | 74 Β°C | 274 seconds remaining

So that makes me think that something's off on mine...

dirkhh commented 9 months ago

Oddly, the fan input, when read manually, shows a higher RPM than yours:

root@DietPi:~# cat /sys/devices/platform/cooling_fan/hwmon/hwmon2/fan1_input
5358
hra42 commented 9 months ago

I will try to make a fresh install of raspberry pi os (for the raspberry pi 5) and then apply the script.. should work like the "upgrade"

Joulinar commented 9 months ago

Mine doesn't show fan speed

Yes I added a hack to the script. Which fan you are using? The original active fan or the one within the case?

Joulinar commented 9 months ago

I will try to make a fresh install of raspberry pi os (for the raspberry pi 5) and then apply the script..

RPI OS for RPi5 should have the new file system layout already. Therefore, no need to run any migrations script.

dirkhh commented 9 months ago

Interesting, a few minutes into the test it suddenly fairly briefly spins the fan up higher:

root@DietPi:~# cat /sys/devices/platform/cooling_fan/hwmon/hwmon2/fan1_input
7593
Stress test results: 
- Start Time: Mon Dec 25 15:48:23 PST 2023 
- End Time  : Mon Dec 25 15:53:24 PST 2023 
- Duration  : 301 seconds 
- Min Temp  : 62 Β°C 
- Max Temp  : 74 Β°C

But just like in your case, temp quickly drops back down to 59ΒΊC

hra42 commented 9 months ago

I will try to make a fresh install of raspberry pi os (for the raspberry pi 5) and then apply the script..

RPI OS for RPi5 should have the new file system layout already. Therefore, no need to run any migrations script.

so I can just run the Dietpi installer and everything should work out of the box? :o

Joulinar commented 9 months ago

Interesting, a few minutes into the test it suddenly fairly briefly spins the fan up higher:

Yes, see RPi docs, fan speed depends on temperature. https://www.raspberrypi.com/documentation/computers/raspberry-pi-5.html#cooling-raspberry-pi-5

dirkhh commented 9 months ago

Mine doesn't show fan speed

Yes I added a hack to the script. Which fan you are using? The original active fan or the one within the case?

That feels like a trick question :) I have the red/white original case with fan - and the fan connects to the PCM/fan connector on board. PXL_20231225_235823765~2

Joulinar commented 9 months ago

so I can just run the Dietpi installer and everything should work out of the box?

Nope, the installer did not support PRi5 yet πŸ˜‰

dirkhh commented 9 months ago

Interesting, a few minutes into the test it suddenly fairly briefly spins the fan up higher:

Yes, see RPi docs, fan speed depends on temperature. https://www.raspberrypi.com/documentation/computers/raspberry-pi-5.html#cooling-raspberry-pi-5

Interesting. So I guess when it went noticeably louder that was it briefly hitting 75ΒΊC and going to 100%, then dropping back down to lower RPM when the temperature dropped to 70ΒΊC Still. I think I'd like to have lower threshold temperatures for higher RPM in order to keep the chip a bit cooler...

Is this configurable somewhere?

Joulinar commented 9 months ago

I have the red/white original case with fan

Ok, I have the Active Cooler, which seems to be much better in terms of cooling. https://www.raspberrypi.com/documentation/computers/raspberry-pi-5.html#active-cooler

dirkhh commented 9 months ago

Mine doesn't show fan speed

Yes I added a hack to the script. Which fan you are using? The original active fan or the one within the case?

TBH - I think that would be a great addition to the default behavior of the script. Maybe something that we could add?

Joulinar commented 9 months ago

nteresting. So I guess when it went noticeably louder that was it briefly hitting 75ΒΊC and going to 100%, then dropping back down to lower RPM when the temperature dropped to 70ΒΊC Still. I think I'd like to have lower threshold temperatures for higher RPM in order to keep the chip a bit cooler...

There you go. Official RPI docs confirm difference in cooling possibility between case fan and active cooler https://www.raspberrypi.com/documentation/computers/raspberry-pi-5.html#thermals

dirkhh commented 9 months ago

There you go. Official RPI docs confirm difference in cooling possibility between case fan and active cooler https://www.raspberrypi.com/documentation/computers/raspberry-pi-5.html#thermals

I was just about to send the same link. IOW - your results and my results exactly match the expected behavior. I like it when that happens.

hra42 commented 9 months ago

so I can just run the Dietpi installer and everything should work out of the box?

Nope, the installer did not support PRi5 yet πŸ˜‰

yep, you are right. Currently not possible to upgrade a fresh raspberry pi os out of the box. But thats due to the script failing to run without a reboot after dietpi-installer runs.

I'm sure you could get it to run relativly easy, but I don't have the time to dig in too deep. I just get the error, that you need to have bookworm or pixie for the script to run...

so that must be due to:

[[ $G_DISTRO == [78] ]] || { G_DIETPI-NOTIFY 1 'You can run this script on Debian Bookworm or Trixie systems only!'; exit 1; }
hra42 commented 9 months ago

run...\n\nso that must be due to:\n\n[[ $G_DISTRO == [78] ]] || {

Screenshot_20231226_030304_Termius.jpg

works perfectly now, even the fan works out of the box!

Joulinar commented 9 months ago

even the fan works out of the box!

For me the fan is working ootb running a converted RPi4 DietPi image on RPi5

MichaIng commented 9 months ago

@Kreeblah and others, I am suspecting an issue why at least some overlays do not load:

You can check this:

ls -l /boot/firmware/overlays/vc4-kms-v3d.dtbo

Strangely I did not recognise this on my RPis, but maybe for some reason only some files affected which my systems did not rely on. Will check this tonight.

Solution for our script is to move the symlink away before purging the old packages, and back in afterwards. For you it is to manually copy the missing overlay files from /usr/lib/something.

terminet85 commented 9 months ago

@MichaIng

Not in my case too

root@sdomotica:/# ls -l /boot/firmware/overlays/vc4-kms-v3d.dtbo
-rwxr-xr-x 1 root root 2760 Dec 21 13:09 /boot/firmware/overlays/vc4-kms-v3d.dtbo
MichaIng commented 9 months ago

@srs4511351 Also pinging you here. Does the overlay exist in your case as well? And does the vc4-fkms-v3d.dtbo do? The latter may have been removed intentionally with the new kernel packages, along with parts of the legacy GPU stack, AFAIK. The console does still work via framebuffer without KMS enabled, but probably legacy GPU/camera APIs and related config.txt settings have all been removed. At least those have all been removed from official RPi docs: https://github.com/raspberrypi/documentation/issues/2942

Also good to know: RealVNC is not supported on Bookworm anymore: https://github.com/raspberrypi/documentation/blob/develop/documentation/asciidoc/computers/remote-access/vnc.adoc Makes sense since it used MMAL, at least on 32-bit. We'll just remove it as well from dietpi-software, it was complicated to maintain it already on Bullseye. TigerVNC is available and as well suggested by the RPi docs.

We will just switch to the modern GPU stack with all DietPi features and software titles and either enable KMS OOTB or with any GUI software and dietpi-config display option.

srs4511351 commented 9 months ago

vc4-fkms-v3d.dtbo does not exist on my system after running the migration script, nor do any of the vc4 overlays, including vc4-kms-v3d.dtbo. There were other things missing also. I don't remember if /boot/firmware/overlays was empty. It is in the overlays folder in the backup that the script makes which means that it had not been removed intentionally and does exist on the latest Raspberry Pi OS. RPI does state that it is no longer supported, but it does work on DietPi. vc4-kms-v3d.dtbo is supported on Raspberry Pi OS. Copying the overlay files does restore the functionality of vc4-fkms-v3d.dtbo

In my applications, graphics are faster with vc4-fkms-v3d.dtbo and vc4-kms-v3d.dtbo. HDMI audio devices are better supported with vc4-fkms-v3d.dtbo

MichaIng commented 9 months ago

Did you really test whether fake KMS does work properly, i.e. applications which use the legacy APIs (like DispmanX)? Ah, probably it does work as long as libraspberrypi0 is still installed (not on RPi OS Bookworm anymore). We will not ship it anymore either.

Btw, vcgencmd, previously shipped with the now obsoleted libraspberrypi-bin has moved to the raspi-utils package, along with some other tools: https://github.com/raspberrypi/utils

Quite a radical change away from all the legacy (since Bullseye deprecated) VideoCore features.

Note to self: Migrate Amiberry RPi builds from DispmanX to SDL2 video stack, i.e. align with all other ARM builds.

srs4511351 commented 9 months ago

vc4-kms-v3d is specified by default in config.txt in the latest Raspberry Pi OS Bookworm. Current versions work adequately. Raspberry Pi OS Bookworm will not boot with vc4-fkms-v3d I do test it with SDR++, as it is more sensitive to it. Performance is greatly degraded without one of the overlays. Other applications show performance degradation to a lesser degree.

Anyway, my point is that the overlays are not being copied over with the migration script. /boot/firmware/overlays was most likely empty. I am not completely sure, as I only was looking for the vc4 overlays.

MichaIng commented 9 months ago

The overlays are not intended to be copied by our script, but this is done by the new firmware/kernel packages. However, purging the old ones removes (some of) them again (in some cases). This is what we need to prevent.

srs4511351 commented 9 months ago

The new firmware/kernel packages did not install them and are shown as up to date. This leaves the system in an unsatisfactory state.

Kreeblah commented 9 months ago

@MichaIng - Copying over the missing overlays from /usr/lib/linux-image-6.1.0-rpi7-rpi-v8/overlays to /boot/firmware/overlays does get me up and running with both of the missing devices (/dev/pps0 and /dev/rtc0). After copying them over and rebooting, everything works how I'd expect.

So, yeah, it seems that the incomplete installation of overlay files to /boot/firmware/overlays (or, rather, removal of many of them by the packaging system when the old kernel package is purged) is what's causing my issue. When I looked before copying them over, there were only 39 files in /boot/firmware/overlays, which was obviously too few to be right.

matttttttttttttt commented 9 months ago

Untitled

Does anyone else gets this weird kernel version error?

I am not the only one (https://www.reddit.com/r/raspberry_pi/comments/18ptik1/weird_kernel_version_error/)

When trying to update the kernel version I got this message:

root@DietPi:~# sudo apt install linux-image-6.1.0-rpi7-rpi-v8 Reading package lists... Done Building dependency tree... Done Reading state information... Done linux-image-6.1.0-rpi7-rpi-v8 is already the newest version (1:6.1.63-1+rpt1).

KapriQ commented 9 months ago

Please how can i change Fan speed based on temperatures ?

/sys/devices/virtual/thermal/thermal_zone0/trip_point_0_temp: 110000 /sys/devices/virtual/thermal/thermal_zone0/trip_point_1_temp: 50000 /sys/devices/virtual/thermal/thermal_zone0/trip_point_2_temp: 60000 /sys/devices/virtual/thermal/thermal_zone0/trip_point_3_temp: 67500 /sys/devices/virtual/thermal/thermal_zone0/trip_point_4_temp: 75000

This is from official RPI documentation:

below 50Β°C, the fan does not spin at all (0% speed)
at 50Β°C, the fan turns on at a low speed (30% speed)
at 60Β°C, the fan speed increases to a medium speed (50% speed)
at 67.5Β°C, the fan speed increases to a high speed (70% speed)
at 75Β°C the fan increases to full speed (100% speed)

Is there way to change %? I would like to change it like this:

at 50Β°C, the fan turns on at a low speed (40% speed) +10%
at 60Β°C, the fan speed increases to a medium speed (60% speed) +10%
at 67.5Β°C, the fan speed increases to a high speed (80% speed )+10%
at 75Β°C the fan increases to full speed (100% speed)

Thanks

Joulinar commented 9 months ago

As far as I know this is provided by RPi firmware. I guess you need to ask RPi developer if this is possible and if yes, how.

Just2Confuse commented 9 months ago

Does anyone else gets this weird kernel version error?

I am not the only one (https://www.reddit.com/r/raspberry_pi/comments/18ptik1/weird_kernel_version_error/)

When trying to update the kernel version I got this message:

as i wrote it there. Update via "sudo rpi-update" will do the job.