New Raspberry PI 5

Raspberry PI specific forum
User avatar
mk-soft
Always Here
Always Here
Posts: 5384
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

New Raspberry PI 5

Post by mk-soft »

I needed something new to play with again.

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 :wink:

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()
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
mk-soft
Always Here
Always Here
Posts: 5384
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: New Raspberry PI 5

Post by mk-soft »

Update
- Bugfix path to fan1_input
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
idle
Always Here
Always Here
Posts: 5081
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: New Raspberry PI 5

Post by idle »

The PI 5 speed will be almost on par with desktops now.
User avatar
mk-soft
Always Here
Always Here
Posts: 5384
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: New Raspberry PI 5

Post by mk-soft »

That's right. ;)
The programs also start very quickly (with SSD) and run smoothly.
Unfortunately, there are no running screensavers for Wayland for the Raspberry yet.
That's why I first switched to X11 with raspi-config and installed the xscreensaver.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Post Reply