Detecting Hardware...such as the system is a Raspberry Pi

Is there a way in Xojo to determine hardware information? Like is the system a Raspberry Pi?

I know about the if TargetARM, TargetLinux, etc. I can see it would be easy to determine the CPU was an M1 by using TargetARM and TargetMacOS…But how would I know if a system is a Raspberry Pi?

Using TargetARM and TargetLinux could narrow it down to maybe a Raspberry Pi, but there are other ARM systems that Linux will run on, so how can the code be sure it’s a Pi?

Once you’ve determined it’s Linux you can read /etc/os-release to find out more about the system.

Thanks Tim! This gets me closer and has some useful info I can see using later. Unfortunately, it’s not a guarantee it’s a Raspberry Pi since it’s possible for a Pi to run other versions of Linux. I also noticed that on the 64 Bit Version of Linux installed on my Pi 4 doesn’t say Raspbian or Raspberry OS. With this in mind it could be hit and miss.

I was hoping to find some way to check the hardware to determine if it’s a Pi or not.

As always, I appreciate your suggestion and it will be helpful…Thanks again!

cat /proc/cpuinfo

And to read from that result you can look in this table

The table is old and lacks then newer models…I guess…

When checking my self then PI4 gives me:
Hardware : BCM2711
Revision : d03114
Model : Raspberry Pi 4 Model B Rev 1.4

Hardware : BCM2835
Revision : c03112
Model : Raspberry Pi 4 Model B Rev 1.2

(Guess not all my PI 4’s are born equal !!)

PI 4 can also give you this result:

Hardware : BCM2835
Revision : c03111
Serial :
Model : Raspberry Pi 4 Model B Rev 1.1

Reading that last line in the file for Model is perfect! It’s specific and gets me what I need.