Rpi4 shutdown

Support for Air Player desktop on ARM devices, like the Raspberry Pi.

Moderators: russ, Ralph

Message
Author
jetelectro
Posts: 6
Joined: Wed May 17, 2023 9:50 am

Rpi4 shutdown

#1 Post by jetelectro »

I searched here for "shutdown" and was unable to find the answer, I am a new user and have two 3.5 inch screens on the pi4, I tried using the shutdown button on the AIR MANAGER but this just closes the Airplayer app, Is it possible to cause the Rpi to gracefully shutdown completely when I close the Airmanager app? Or perhaps there is a better way to achieve this. At the moment I have to risk either removing the power to the Rpi or remote access and close down the Rpi manually. Any help on how to todo this greatly appreciated.

I am using Xplane12. perhaps there is a way to send shutdown instruction(s) to the Rpi from XPlane??


Thanks

SimPassion
Posts: 5336
Joined: Thu Jul 27, 2017 12:22 am

Re: Rpi4 shutdown

#2 Post by SimPassion »


User avatar
Ralph
Posts: 7876
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: Rpi4 shutdown

#3 Post by Ralph »

You would have to put this script into an instrument, then attach a button to the Pi to trigger this script.

jetelectro
Posts: 6
Joined: Wed May 17, 2023 9:50 am

Re: Rpi4 shutdown

#4 Post by jetelectro »

Thanks Ralph and Simpassion, I will have a try at your suggestion.

jetelectro
Posts: 6
Joined: Wed May 17, 2023 9:50 am

Re: Rpi4 shutdown

#5 Post by jetelectro »

So I get the add the instrument and hardware button to work just fine but I have to restart Airplayer manually because I need to use the I/O support on the Rpi,

4. Start Air Player manually
For I/O support on the Raspberry Pi run Bootloader as root:

$ sudo ./Bootloader

It seems to just start as a regular user, I have searched all the directories on the Rpi for these directories ~/.config/autostart

How can I find and edit the file so the AirPlayer starts with I/O support automatically?
Could we have an option to create the autostart file with a choice of either regular or root user?

User avatar
Ralph
Posts: 7876
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: Rpi4 shutdown

#6 Post by Ralph »

You can run the installer again and make sure that you choose auto start in the installation options.

jetelectro
Posts: 6
Joined: Wed May 17, 2023 9:50 am

Re: Rpi4 shutdown

#7 Post by jetelectro »

Thanks , but I have done that Ralph, I am thinking the script only auto starts AirPlayer as regular user and consequently I am unable to use the I/O resources on the Pi, I need to start AirPlayer with root privileges ? If I do the following manually everytime then everything is fine but I want to do achieve this using the auto start feature.

4. Start Air Player manually
For I/O support on the Raspberry Pi run Bootloader as root:

$ sudo ./Bootloader

User avatar
Ralph
Posts: 7876
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: Rpi4 shutdown

#8 Post by Ralph »

Might depend on how you did the installation. I would have to ask my colleague.

jetelectro
Posts: 6
Joined: Wed May 17, 2023 9:50 am

Re: Rpi4 shutdown

#9 Post by jetelectro »

The problem is trying to access shutdown & reboot menu is awkward to say the least, the pi is connected via HDMI 2 x 3.5" screens, One for clock and temp/volts the other is driving the the COM/TRANSPONDER module. I want solve this before having everything fitted permanently and the panels painted etc.
IMG_2365.jpeg

bmcmullan
Posts: 23
Joined: Sat Sep 02, 2017 2:33 pm
Location: Louisville, KY USA
Contact:

Re: Rpi4 shutdown

#10 Post by bmcmullan »

You could send shutdown command remotely to Pi from another machine.. I use this Windows batch file to shutdown the PI and Windows, adapt as needed.

@rem ----------------------------------------------------------------------------------
@rem THIS SHUTS DOWN THE PI, THEN SHUTS DOWN WINDOWS
@rem
@rem README install PUTTY PACKAGE ( https://www.chiark.greenend.org.uk/~sgt ... atest.html )
@rem 64 or 32 bit; the package includes putty, plink, psftp, etc
@rem The installer prompts to add putty folder to PATH, you WANT this
@rem this calls Plink relying PATH being updated
@rem STEP 1: putty SSH (console) into the Pi once to get host fingerprint recorded in putty (plink uses that too)
@rem Change IP address to your PI
@rem ----------------------------------------------------------------------------------

plink -batch -ssh pi@192.168.2.23 -pw raspberry "sudo shutdown -h now"

@echo Shutting down Windows
%windir%\System32\shutdown.exe /s /t 5 /c "Shutting down Windows"
FSX/P3D/XP11 - i7@5Ghz, GTX1080, 4 screens + Air Manager screen + custom hardware & Avionics COM, GPS, Radios, XPOND, AP (www.simav8.com)

Post Reply