Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Auro Run A Script In Terminal MOde On Boot

119 views
Skip to first unread message

Dr Stephen Strange

unread,
Oct 31, 2023, 5:29:30 AM10/31/23
to
I am running Bookworm Lite on a Rspberry Pi Zero 2 W

I have written a python script to display the output from my Solar
Panels. The script works well.

How do I get the Pi to run this script on boot and display it on the
screen ie in a form of Kiosk Mode I suppose?

R.Wieser

unread,
Oct 31, 2023, 5:52:15 AM10/31/23
to

Dr Stephen Strange

unread,
Oct 31, 2023, 5:57:49 AM10/31/23
to
Many thanks

56d.1152

unread,
Nov 6, 2023, 11:40:45 PM11/6/23
to
Be aware of the limitations of root-level autostarts
however - esp for "graphical" apps. When a user gets
fully logged in there is a "screen" on which all the
graphical stuff can be displayed. However if using
root crontab or a number of other tricks they run
early, BEFORE the individual user. There's no screen.

Recently wanted a user to autologin - easy - and then
for a specific python script to run. Worked on a Pi3,
but NOT on a Pi4 ... very strange. All the usual
tricks ... /home/pi/.config/lxsession/LXDE-pi/autostart ...
did NOT work. Couldn't even get to start from .profile
or .bashrc

Find my other recent thread about how to get around
this odd Pi4+Bookworm issue.

56d.1152

unread,
Nov 9, 2023, 11:39:06 PM11/9/23
to
Followup -

The failure of /home/pi/.config/lxsession/LXDE-pi/autostart
appears to be linked to use of the Wayland display system.
Switching back to X11 it all works like it used to.



Martin Gregorie

unread,
Nov 10, 2023, 6:00:02 AM11/10/23
to
Follow-up to your follow-up

I trust that you've also posted a bug report to
https://www.raspbian.org/RaspbianBugs


--

Martin | martin at
Gregorie | gregorie dot org

Chris Elvidge

unread,
Nov 10, 2023, 6:47:37 AM11/10/23
to
No. It's linked to the fact that Wayland doesn't use LXDE but wayfire
and wf-panel-pi.


--
Chris Elvidge, England
I WILL NOT GO NEAR THE KINDERGARTEN TURTLE

56d.1152

unread,
Nov 11, 2023, 12:09:20 AM11/11/23
to
Nope. It's clearly a Wayland issue - one of MANY.

NOT a 'Pi" issue per-se. Almost not a Deb issue,
except that Deb is kinda pushing Wayland.

Wayland has had a LONG time - but it's seriously
incompatible with vast numbers of existing apps
and techniques at the high and low levels.

IMHO, only those who NEED the "speed" - and it's
not THAT much better - like for stupid games should
think about Wayland. Everyone else, stick to X11.

Some use Linux for "fun" - and that's fine so far
as it goes. However the biggest and most important
use for Linux is for SERIOUS BUSINESS ... like
keeping the whole hidden infrastructure going.
IBM didn't buy M$, it bought RHEL. That's where
the Real Stuff is happening, the LiniVerse.

And yea, the BSDs are maybe even better at some
stuff, esp 'security' and overall 'solidness' - but
are also behind the curve in some important ways too.
However, if I had to build a whole new corporate
system NOW ... I'd use OpenBSD as the foundation.

LONG LONG back I found Red Hat on the software
shelf at WalMart (yes, they had that). A bunch
of 5 1/4 floppies were in there. After a
few days of messing around and downloading a
few things over dial-up, I actually got "X" and
the keyboard/mouse to work - and was happy.
However, other than being "Not Windows" it
didn't DO much of interest - so I ignored it.

A couple years later I found the green/white
SUSE LINUX box on a shelf (Best Buy ?) and
it was a CD. It was drastically easier to
install and had a much more interesting
selection of apps. NEXT to it on the shelf
was a very cheap box containing Oracle DB,
ported to Linux. NOW I was much more interested.

Kinda never went back after that. SUSE was
a serious supp, eventually replacement, for
more and more Winders Infrastructure stuff.

Alas, of late, OpenSUSE has kinda gone downhill.
It's no longer the "Cadillac System" it used
to be - I think a result of the IBM buyout of
RHEL. It's been the DebiVerse thereafter - for now.
Depends on how STUPID Deb gets with STUPID changes.

Yea, yea, X11 *is* a kinda complicated mess at
this point. However it's extremely WELL DOCUMENTED
and it WORKS with everything. Sometimes it's better
to stick with the Devil You Know.

Now if you're doing "headless", non-GUI, uses of
Linux ... pure servers and such ... then the "X"/
Wayland thing is of almost zero interest. I'd
suggest staying away from the RHEL derivatives
because you're now essentially beta-testers
for RHEL instead of fully with it. Deb is still
quite good for "pure", though NetworkManager
makes me wonder.

Arch derivs are good - though the package/ports
system IS unnecessarily weird. Slack IS still out
there too. The BSDs remain strong/safe competitors
for certain kinds of "servers" too - and more
diversity is being seen in that universe.
"Dragonfly" is a fairly nice GUI/Desktop BSD,
gotta admit, and there are a few competitors now.

And there's always the infamously-difficult Plan-9 :-)
DID get it to do SOME useful stuff, after a lot of
effort ........

HOPING for a modernized VMS ... it was WAY ahead
of it's time ! Still have a 300+ page, small-print,
manual ......

Oops ... too much ?

56d.1152

unread,
Nov 11, 2023, 12:22:53 AM11/11/23
to
That's part of the issue - very much. Thing IS that Wayland
isn't - and IMHO will NEVER be - really Ready For Prime Time.
It has a *niche* - mostly "gamers" - but for extreme compatibility
with All That Has Come Before you should stick to X11.

You CAN use Linux for "games" - but the 99% Real World use
is NOT for "games" but for The Infrastructure. If you're
doing GUI, stick with X11 for max compatibility. If you're
doing "headless"/non-gui, servers, then it barely matters.

Ahem A Rivet's Shot

unread,
Nov 11, 2023, 4:30:04 AM11/11/23
to
On Sat, 11 Nov 2023 00:09:08 -0500
"56d.1152" <56d....@ztq9.net> wrote:

> LONG LONG back I found Red Hat on the software
> shelf at WalMart (yes, they had that). A bunch
> of 5 1/4 floppies were in there. After a
> few days of messing around and downloading a
> few things over dial-up, I actually got "X" and
> the keyboard/mouse to work - and was happy.
> However, other than being "Not Windows" it
> didn't DO much of interest - so I ignored it.

Around the same time (perhaps a little earlier) I found SLS for
sale on floppies. I had been a unix developer for several years at that
time and was very happy to have a unix workstation at home. Windows was of
no interest to me - I was seriously disgusted when it first appeared and I
found it incapable of running multiple DOS applications in parallel - after
all DesqView could! I soon found FreeBSD which lacked all of the
shortcomings of early Linux (the original TCP stack was crap!) and have
been using it ever since - for the last thirty years it has failed to let
me down or piss me off. Windows lasts less than thirty minutes before doing
one or both - Linux lasts longer if the installation doesn't drive me
demented (there's a Linux VM that I use for a handful of applications I
can't be bothered to make work under compatibility) - but nothing has had
the staying power of FreeBSD.

I'm really not sure in which ways it is behind the curve - but not
in any ways that have ever mattered to me.

For work I use a Macbook (they're paying) - it handles the MS
orifice stuff perfectly well and provides a POSIX compliant shell.

--
Steve O'Hara-Smith
Odds and Ends at http://www.sohara.org/
Host: Beautiful Theory meet Inconvenient Fact
Obit: Beautiful Theory died today of factual inconsistency

The Natural Philosopher

unread,
Nov 11, 2023, 5:45:53 AM11/11/23
to
X11 is, like PostScript*, Systemd , and even MSDOS and Windows, a total
disaster of a protocol written by ComputerScientists, who are arguably
even worse than ArtStudents when let near a computer.

However as the only game in town, software engineers have spent many
lifetimes avoiding and hiding its completely unnecessary features and
getting it's necessary ones to work, hiding its sheer ugliness under
graphical toolkits that are almost useable.

Like a Porsche 911, it is now a triumph of development over design.

Stick to the roads more travelled.

*The original Apple Laserwriter PostScript Printer cost more, and had a
bigger CPU and more RAM than the Apple desktops that drove it.

--
“Progress is precisely that which rules and regulations did not foresee,”

– Ludwig von Mises

Ahem A Rivet's Shot

unread,
Nov 11, 2023, 7:00:04 AM11/11/23
to
On Sat, 11 Nov 2023 10:45:51 +0000
The Natural Philosopher <t...@invalid.invalid> wrote:

> X11 is, like PostScript*, Systemd , and even MSDOS and Windows, a total
> disaster of a protocol written by ComputerScientists, who are arguably
> even worse than ArtStudents when let near a computer.

One thing X11 and PostScript in common is remarkable staying power,
extensibility is one (possibly the only one) thing computer scientists tend
to do well.

> However as the only game in town, software engineers have spent many
> lifetimes avoiding and hiding its completely unnecessary features and
> getting it's necessary ones to work, hiding its sheer ugliness under
> graphical toolkits that are almost useable.

One thing X11 had over everything else was portability, you can run
it on anything with sufficient (not very much) capability. The first time I
had X11 running at home it was on an Interactive Unix for PC old enough that
it lacked TCP/IP and shared memory which left pseudo-tty pairs as the only
client server communication supported (every window a separate pair) - and
the that was only implemented on one side on the X11R5 tape (server IIRC)
so I had to write the other side myself.

It took me two weeks to get a moving X on a black background, and
another day to get twm and a bunch of applications up.

Note that portability is what kept unix going from 1975 until the
PC became the dominant server architecture, at first the PC was just yet
another platform to unix system developers.

> Like a Porsche 911, it is now a triumph of development over design.
>
> Stick to the roads more travelled.

Oh and if you think that PostScript is a mess for page layout then
please take a good look at XSL-FO and the fun and games involved in using
XSLT (the only language I know of where an important flow control mechanism
is essentially COME-FROM with wildcards) to translate a markup language
like dockbook XML into XSL-FO and the even more extreme fun and games
involved in correctly rendering XSL-FO on a printer or even just as an
array of pixels. It makes HTML and CSS look sane.

By comparison troff and PostScript are wondrously straightforward
and sensible designs.

56d.1152

unread,
Nov 11, 2023, 11:04:05 PM11/11/23
to
On 11/11/23 6:41 AM, Ahem A Rivet's Shot wrote:
> On Sat, 11 Nov 2023 10:45:51 +0000
> The Natural Philosopher <t...@invalid.invalid> wrote:
>
>> X11 is, like PostScript*, Systemd , and even MSDOS and Windows, a total
>> disaster of a protocol written by ComputerScientists, who are arguably
>> even worse than ArtStudents when let near a computer.
>
> One thing X11 and PostScript in common is remarkable staying power,
> extensibility is one (possibly the only one) thing computer scientists tend
> to do well.

Agreed. X11 is *ancient* - yet still doing serious work.
Also, many little utils and such just EXPECT X11 ... my
recent experience with /home/pi/.config/lxsession/LXDE-pi/autostart
not working was due to Wayland. Gotta put autostart in a different
place with Wayland, and it's not quite as flexible.

Wayland, well, let the "gamers" have it. I'm not interested
in "games" but "infrastructure/devices". For that I want
everything as super-compatible as possible.

X11 *is* a mess, no question, but it WORKS WELL.

The Natural Philosopher

unread,
Nov 12, 2023, 6:17:58 AM11/12/23
to
It works well because thousands of man hours have been put into it to
*make* it work well.

Same as systemd and PostScript. And a Porsche 911. And Windows.

If that effort had been put into Wayland instead we would have a
graphics interface that use way less CPU and RAM.

But it's all too late, now. We have to make the best of a bad job.


--
"When a true genius appears in the world, you may know him by this sign,
that the dunces are all in confederacy against him."

Jonathan Swift.

Ahem A Rivet's Shot

unread,
Nov 12, 2023, 9:00:06 AM11/12/23
to
On Sun, 12 Nov 2023 11:17:56 +0000
The Natural Philosopher <t...@invalid.invalid> wrote:

> If that effort had been put into Wayland instead we would have a
> graphics interface that use way less CPU and RAM.

Perhaps, but by the time Wayland appeared most of that effort had
already taken place, it would have been a long wait for a graphical
interface, X11 dates back to 1984 while Wayland didn't turn up until 2008.
Finally Wayland doesn't work over a network which is one of X11s great
strengths and a feature I use quite often.

The Natural Philosopher

unread,
Nov 12, 2023, 10:11:52 AM11/12/23
to
On 12/11/2023 13:46, Ahem A Rivet's Shot wrote:
> On Sun, 12 Nov 2023 11:17:56 +0000
> The Natural Philosopher <t...@invalid.invalid> wrote:
>
>> If that effort had been put into Wayland instead we would have a
>> graphics interface that use way less CPU and RAM.
>
> Perhaps, but by the time Wayland appeared most of that effort had
> already taken place,

I am not arguing with that.

> it would have been a long wait for a graphical
> interface, X11 dates back to 1984 while Wayland didn't turn up until 2008.
> Finally Wayland doesn't work over a network which is one of X11s great
> strengths and a feature I use quite often.
>

I tried to use it and it was pants.

--
It is the folly of too many to mistake the echo of a London coffee-house
for the voice of the kingdom.

Jonathan Swift


Ahem A Rivet's Shot

unread,
Nov 12, 2023, 12:00:04 PM11/12/23
to
On Sun, 12 Nov 2023 15:11:50 +0000
The Natural Philosopher <t...@invalid.invalid> wrote:

> On 12/11/2023 13:46, Ahem A Rivet's Shot wrote:

> > it would have been a long wait for a graphical
> > interface, X11 dates back to 1984 while Wayland didn't turn up until
> > 2008. Finally Wayland doesn't work over a network which is one of X11s
> > great strengths and a feature I use quite often.
> >
>
> I tried to use it and it was pants.

It's crap over a WAN IME (mind you I haven't tried across a WAN
since I got FTTH) but on a LAN most applications work fine. Here's one I
use regularly - my Calibre book repository lives in a jail (container in
linux speak) on my NAS, so to run the GUI on my workstation I run (canned
in a menu entry in my WM):

ssh calibre@library -f calibre

and up pops the perfectly responsive application window. The old way
of permitting access to the X server directly from the host library would be
even faster but very insecure. The big advantage over the remote desktop
approach is that library isn't running any kind of graphical interface.

The Natural Philosopher

unread,
Nov 12, 2023, 4:10:42 PM11/12/23
to
On 12/11/2023 16:37, Ahem A Rivet's Shot wrote:
> On Sun, 12 Nov 2023 15:11:50 +0000
> The Natural Philosopher <t...@invalid.invalid> wrote:
>
>> On 12/11/2023 13:46, Ahem A Rivet's Shot wrote:
>
>>> it would have been a long wait for a graphical
>>> interface, X11 dates back to 1984 while Wayland didn't turn up until
>>> 2008. Finally Wayland doesn't work over a network which is one of X11s
>>> great strengths and a feature I use quite often.
>>>
>>
>> I tried to use it and it was pants.
>
> It's crap over a WAN IME (mind you I haven't tried across a WAN
> since I got FTTH) but on a LAN most applications work fine. Here's one I
> use regularly - my Calibre book repository lives in a jail (container in
> linux speak) on my NAS, so to run the GUI on my workstation I run (canned
> in a menu entry in my WM):
>
> ssh calibre@library -f calibre
>
> and up pops the perfectly responsive application window. The old way
> of permitting access to the X server directly from the host library would be
> even faster but very insecure. The big advantage over the remote desktop
> approach is that library isn't running any kind of graphical interface.
>
Now try streaming video over it

--
“it should be clear by now to everyone that activist environmentalism
(or environmental activism) is becoming a general ideology about humans,
about their freedom, about the relationship between the individual and
the state, and about the manipulation of people under the guise of a
'noble' idea. It is not an honest pursuit of 'sustainable development,'
a matter of elementary environmental protection, or a search for
rational mechanisms designed to achieve a healthy environment. Yet
things do occur that make you shake your head and remind yourself that
you live neither in Joseph Stalin’s Communist era, nor in the Orwellian
utopia of 1984.”

Vaclav Klaus

Ahem A Rivet's Shot

unread,
Nov 12, 2023, 5:00:04 PM11/12/23
to
On Sun, 12 Nov 2023 21:10:40 +0000
The Natural Philosopher <t...@invalid.invalid> wrote:

> On 12/11/2023 16:37, Ahem A Rivet's Shot wrote:

> > ssh calibre@library -f calibre
> >
> > and up pops the perfectly responsive application window. The
> > old way of permitting access to the X server directly from the host
> > library would be even faster but very insecure. The big advantage over
> > the remote desktop approach is that library isn't running any kind of
> > graphical interface.
> >
> Now try streaming video over it

That's not going to work well.

56d.1152

unread,
Nov 12, 2023, 10:15:32 PM11/12/23
to
On 11/12/23 6:17 AM, The Natural Philosopher wrote:
> On 12/11/2023 04:03, 56d.1152 wrote:
>> On 11/11/23 6:41 AM, Ahem A Rivet's Shot wrote:
>>> On Sat, 11 Nov 2023 10:45:51 +0000
>>> The Natural Philosopher <t...@invalid.invalid> wrote:
>>>
>>>> X11 is, like PostScript*, Systemd , and even MSDOS and Windows, a total
>>>> disaster of a protocol written by ComputerScientists, who are arguably
>>>> even worse than ArtStudents when let near a computer.
>>>
>>>     One thing X11 and PostScript in common is remarkable staying power,
>>> extensibility is one (possibly the only one) thing computer
>>> scientists tend
>>> to do well.
>>
>>    Agreed. X11 is *ancient* - yet still doing serious work.
>>    Also, many little utils and such just EXPECT X11 ... my
>>    recent experience with /home/pi/.config/lxsession/LXDE-pi/autostart
>>    not working was due to Wayland. Gotta put autostart in a different
>>    place with Wayland, and it's not quite as flexible.
>>
>>    Wayland, well, let the "gamers" have it. I'm not interested
>>    in "games" but "infrastructure/devices". For that I want
>>    everything as super-compatible as possible.
>>
>>    X11 *is* a mess, no question, but it WORKS WELL
>
> It works well because thousands of man hours have been put into it to
> *make* it work well.
>
> Same as systemd and PostScript. And a Porsche 911. And Windows.


Well ... maybe not Winders .... :-)


> If that effort had been put into Wayland instead we would have a
> graphics interface that use way less CPU and RAM.
>
> But it's all too late, now. We have to make the best of a bad job.

X11 isn't "bad" - it's just a long-clunked-together
and forever-debugged display system. Yep, in THEORY,
Wayland can be smaller/faster ... but in PRACTICE I
just don't see it becoming 'generally useful' since
SO many of the bits and pieces of the LiniVerse just
ASSUME X11.

The FIRST Linux I ever bought - RedHat off a WalMart
shelf - had X11. I remember the low-rez base screen
with a big "X". Took me a week to get the KB/Mouse
working right. BUT, it WAS a GUI for Linux. Got
SUSE a couple years later, MUCH easier to get going.
That's when I started to dump Winders. I own NO
Winders devices ... haven't for a LONG time now.

Hmmm ... maybe an "AI" can go over X11 and tighten
it up a bit ? Bound to be a lot of redundancies
and un-optimized code in there.

Oh, and as the HARDWARE keeps getting faster, does
the "slower" aspect of X11 really MATTER so much ?
The Pi4 is often at least twice as fast as the Pi3,
and the Pi5 is reputed to be 2-3X faster than the Pi4
for many uses.

56d.1152

unread,
Nov 12, 2023, 10:32:42 PM11/12/23
to
On 11/12/23 4:49 PM, Ahem A Rivet's Shot wrote:
> On Sun, 12 Nov 2023 21:10:40 +0000
> The Natural Philosopher <t...@invalid.invalid> wrote:
>
>> On 12/11/2023 16:37, Ahem A Rivet's Shot wrote:
>
>>> ssh calibre@library -f calibre
>>>
>>> and up pops the perfectly responsive application window. The
>>> old way of permitting access to the X server directly from the host
>>> library would be even faster but very insecure. The big advantage over
>>> the remote desktop approach is that library isn't running any kind of
>>> graphical interface.
>>>
>> Now try streaming video over it
>
> That's not going to work well.

I understand that there are NO "perfect fixes" here.

X11 has issues, Wayland has WAY more issues. Any
Linux video stuff has issues. Win 3.11 is really
not a viable option .....

I'm just trying to find the "best" way to MY particular
goal of the week. "Best" does NOT mean re-writing half
the OS or X11 ........

I've tried several approaches using Python/OpenCV. Too
much buffering - which is basically impossible to turn
off ... the designers "made a decision" long ago.

Going around buffering by downloading cam stills with
wget/curl to a file and then just using OpenCV for its
handy crop/resize/display trix ... wget and curl are
TOO SLOW plus I get way too many partial frames. NOT
sure how Motion (usually) detects a 'complete' JPG.
Must read 'em byte by byte ... which ain't easy from
a remote http device.

So ... what I was trying to get away from ... gonna
have to use a BROWSER reading Motion streams plus
kinda ugly. hard to tune, WebKit stuff to do the
cropping/resizing/placement. I've used Chromium in
the past, with a few tweaks to get past stupid
error/debug messages. I'll just recycle the old
web pages I'd made for Chromium a bit, and feed
it Motion mjpeg frames directly into iframes. Kinda
clunky, but I think it'll be the superior result.
0 new messages