So I treated myself to the new Raspberry PI 5. (As a bundle with raspi case with fan and heat sink, power supply, etc)
I use an external usb SSD as a drive. (EMTEC SSD X210 128GB)
The PI 5 is really much faster than the PI 4, compiling from the PureBasic IDE is more than 3 times faster.
The new fan control is better than described.
Small Fan Speed Viewer

Update
- Bugfix path to fan1_input
Code: Select all
;- TOP by mk-soft, v1.01.2, 16.02.2024
; Raspberry PI 5 Fan Speed
; Folder "/sys/devices/platform/cooling_fan/hwmon/*/fan1_input"
Enumeration Window
#Main
EndEnumeration
Enumeration Gadgets
#Label
#Speed
EndEnumeration
Global file, fan1.s, speed.s
Procedure InitProgram()
Protected path.s, path2.s
path.s = "/sys/devices/platform/cooling_fan/hwmon/"
If ExamineDirectory(0, path, "hwmon*")
While NextDirectoryEntry(0)
If DirectoryEntryType(0) = #PB_DirectoryEntry_Directory
path2 = DirectoryEntryName(0)
Break
EndIf
Wend
FinishDirectory(0)
EndIf
If path2
fan1.s = path + path2 + "/fan1_input"
file = ReadFile(#PB_Any, fan1)
If file
speed = ReadString(file)
EndIf
EndIf
ProcedureReturn file
EndProcedure
Procedure ReleaseProgram()
If file
CloseFile(file)
EndIf
EndProcedure
Procedure UpdateSpeed()
FileSeek(file, 0)
speed = ReadString(file)
SetGadgetText(#Speed, speed + " rpm")
EndProcedure
Procedure Main()
If Not InitProgram()
MessageRequester("Error", "Fan Speed Inut Not Found!")
End -1
EndIf
If OpenWindow(#Main, #PB_Ignore, #PB_Ignore, 240, 80, "Fan Speed", #PB_Window_SystemMenu)
TextGadget(#Label, 10, 10, 100, 25, "Fan-Speed")
StringGadget(#Speed, 120, 5, 100, 25, speed + " rpm", #PB_String_ReadOnly)
BindEvent(#PB_Event_Timer, @UpdateSpeed())
AddWindowTimer(#Main, 1, 1000)
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
UnbindEvent(#PB_Event_Timer, @UpdateSpeed())
Break
EndSelect
ForEver
EndIf
ReleaseProgram()
EndProcedure : Main()