Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5076

Advanced users • Re: KEEP autostart terminal open like in UI

$
0
0
  1. You should really be using your user's autostart file not the systemwide one. in /etc.
  2. Your autostart line doesn't run your code with sudo yet your manual command does. This may be a factor but it may also be an unnecessary use of sudo
  3. Assuming your command is correctly passed to lxterminal, the echo won't run until your python script exits.
  4. I've no idea whether the quoting around your -e argument will be enough. It may not be being interpreted correctly. Put those three command into a shell script and call the shell script from autostart instead.
So I did remove the system wide autostart changes and went to the user autostart here

Code:

cd /home/pi/.config/lxsession/LXDE-pi/
Then I reused the shell script which I had called in the very first test which did not work out back then.
Now I have put the same call (and also moved the grott directory from Desktop to /home/pi/grott therefore a different code right now) into the user autostart and rebooted the pi.

Code:

lxterminal --geometry=120x40 --title=Updating -e bash -c  '/home/pi/grott/autostartgrott.sh' 
the result is pretty much the same which means that the script is running the code cause in case I open a terminal and run

Code:

python3 /home/pi/Desktop/grott/grott.py -v
manually then I get this error which you get if you start the py script a second time - so it is running and I also get the mqtt messages.

Code:

Traceback (most recent call last):  File "/home/pi/grott/grott.py", line 33, in <module>    proxy = Proxy(conf)  File "/home/pi/grott/grottproxy.py", line 112, in __init__    self.server.bind((conf.grottip, conf.grottport))OSError: [Errno 98] Address already in use
But the terminal is gone or closed already even though I need the terminal to see the progress.
It is a phyton script that runs 247 until you press ctrl & c

And my main goal was a visible terminal where the pyhton code is already running.
Everything else was working already except the terminal window had disappeared.

Statistics: Posted by typxxi — Tue Mar 19, 2024 7:20 pm



Viewing all articles
Browse latest Browse all 5076

Trending Articles