Raspberry Pi oddities

I’m using the standard Pi OS (Raspbian as was IIRC). Debugging remotely.

  1. The Window.Resizing event appears not to fire. This may not be quite so odd since windows don’t in any case appear to resize live at all. Can anyone confirm this? The Window.Resized event does fire and can be used.

  2. Target. How do I detect that I’m running on a Pi. ARM by itself is no good, and neither is Linux. I could say TargetARM and TargetLinux, but then I’d get a hit even if the Pi is running Mint (which I suppose it could). What are people doing for this?

Use a shell, perhaps in App.Open, and run this:

cat /etc/os-release

In the result string, parse for either “NAME=”, or the more florid “PRETTY_NAME=”, as you wish. :slight_smile:

1 Like

On reflection, I see this too doesn’t help you detect the machine as being a Pi with another distro.

You piqued my curiosity. “uname -a” might also be useful. I’m not certain, though, whether it will fulfill your apparent aim, of detecting Pi hardware even when running Ubuntu or something. But it looks as if it might.

Check “cat /proc/cpuinfo”
Or just use a textInputStream and read it line by line.
There should be a line saying a revision code:

One or more these tells you it’s a raspberry pi

Maybe easier would be to check if you can read the file:

/sys/firmware/devicetree/base/model

It should (if readable and existing) read a line with actually “Raspberry Pi model …”

You should again be able to use a TextInputStream to read this path or use a shell and add "cat " before the path.

1 Like

“cat /proc/cpuinfo”

Way down at the bottom of the output, this gets me:

Model : Raspberry Pi 4 Model B Rev 1.2

Tim could also run my earlier suggestion of cat /etc/os-release if he also wants the specific distro. :slight_smile:

2 Likes

Thanks for all the suggestions. It would be the OS rather than the hardware, since that’s what I have to code for. If it were runnning Linux, then presumably it will run a linux build of any app.

Hmmm, OK, I guess it is running Linux :thinking: but then why isn’t it doing live window-resizing?

Well, Raspberry PI OS/Raspian “is” Linux (a fork of Debian.) I hope someone can chime in on the window resizing.

Edit: I do think that getting hardware AND OS version (distro) would be good :slight_smile:

Created a bugreport?

Xojo bug most likely

1 Like

Mmmm, unclear. Raspbian windows don’t appear to resize properly until you stop dragging and release the mouse. So you’d get one resizing event rather than a contnuous stream. Hmmm again, that’d still be useful.

Could it be a limitation of the graphics horsepower in a Pi?

Seems likely, based on some messages I’ve seen on other forums. But then the app must be being notified at the end of the resize, since the Resized event fires, once for each resizing. As that is the case, I can’t see a reason why the resizing event can’t be fired once too.

If we’re not getting them from the OS, then you don’t either. Adding them artificially may cause issues if the OS ever did start sending them.

1 Like
Forum for Xojo Programming Language and IDE. Copyright © 2021 Xojo, Inc.