Page 1 of 1

New Raspberry PI 5

Posted: Thu Feb 15, 2024 10:59 pm
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()

Re: New Raspberry PI 5

Posted: Fri Feb 16, 2024 12:03 pm
by mk-soft
Update
- Bugfix path to fan1_input

Re: New Raspberry PI 5

Posted: Sun Feb 18, 2024 12:49 am
by idle
The PI 5 speed will be almost on par with desktops now.

Re: New Raspberry PI 5

Posted: Sun Feb 18, 2024 3:31 pm
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.

Re: New Raspberry PI 5

Posted: Sun Jun 30, 2024 9:17 am
by macros
There are some workarounds to get xscreensaver working under wayland:
https://www.linux.org/threads/xscreensa ... and.43543/
and also
https://sr.ht/~mstoeckl/wscreensaver/

But as long as you are happy with X11, no need to switch just for the sake of novelty :)

Re: New Raspberry PI 5

Posted: Sun Dec 01, 2024 2:37 am
by RSrole
I had some time in the last few days to mess with this and it seems that the RPi people changed chips that control the gpio from pi4 to pi5. I bought the Pi5. Most of the libraries recommended don't work on the new hardware. Since Pi5 is it's own beast, it would seem that the RPi people should have provided a gpiSomething.so that's compatible with whatever version you buy. It's a very odd thing to sell a computer with gpio pins, but no clean way to get to them :( . Searching the web has you go down many rabbit holes and still no good solution. A shame.

I've written a few sketches for arduino and getting to the pins is a breeze, so it can be done if the manufacturer chooses to.

Re: New Raspberry PI 5

Posted: Mon Dec 02, 2024 1:45 pm
by CDXbow
mk-soft wrote: Sun Feb 18, 2024 3:31 pm 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.
I did exactly the same thing wrt Wayland. There doesn't seem to be many pluses to it, just a whole heap of things stop working. I have not yet added an SSD, I've wasted a bit of time building it into an old NBN modem box with an 15w per side amplifier.