API Command to switch off Raspberry PI
API Command to switch off Raspberry PI
Isn't there a API command I can call in a custom gauge or by a press of a button that can shut down the Raspberry Pi(s)?
Why I am asking is because I run Air Manager 3.0 on my laptop and on my cockpit I run multiple Air Player Desktops and RPi. But my laptop is not always at my sim. When shutting down the sim I switch off all the PC's, then I have to walk over to my laptop, open Air Manager and then shut down the Raspberry remotely.
I would like to link a switch to a RPI or Arduino and pressing that button/switch must command all the Raspberry Pis to switch off. Or is there a GPIO pin on the RPi that will trigger a shutdown?
Fritz
Why I am asking is because I run Air Manager 3.0 on my laptop and on my cockpit I run multiple Air Player Desktops and RPi. But my laptop is not always at my sim. When shutting down the sim I switch off all the PC's, then I have to walk over to my laptop, open Air Manager and then shut down the Raspberry remotely.
I would like to link a switch to a RPI or Arduino and pressing that button/switch must command all the Raspberry Pis to switch off. Or is there a GPIO pin on the RPi that will trigger a shutdown?
Fritz
Last edited by fweinrebe on Mon Feb 05, 2018 5:59 am, edited 1 time in total.
Re: API Command to switch of Raspberry PI
After some research I found a Python script that monitors a GPIO pin using Python. On detection that a button was pressed on that pin, it then calls the shutdown of the PI.
What I plan to do is connect a relay to an Arduino pin. I can then in my gauge trigger the relay. That will toggle the value on the GPIO pin of the Pi calling for the shutdown. My PC's are also set to shutdown when I press the power button, so the same Arduino is gonna pulse the power buttons thereby switching off the whole simulator.
Hopefully Air Player will not interfere with the Python script also monitoring a GPIO pin?
What I plan to do is connect a relay to an Arduino pin. I can then in my gauge trigger the relay. That will toggle the value on the GPIO pin of the Pi calling for the shutdown. My PC's are also set to shutdown when I press the power button, so the same Arduino is gonna pulse the power buttons thereby switching off the whole simulator.
Hopefully Air Player will not interfere with the Python script also monitoring a GPIO pin?
Re: API Command to switch of Raspberry PI
Hi,
To be honest, I'm not sure if it would interfere. I think both systems only read the same registry, so that might work fine.
Having said that, I will implement this feature in Air Manager / Air Player. It might take a while though before it is part of a new release, I have put it on the TODO list.
Might become something like this:
Expect something along the lines of two months.
Corjan
To be honest, I'm not sure if it would interfere. I think both systems only read the same registry, so that might work fine.
Having said that, I will implement this feature in Air Manager / Air Player. It might take a while though before it is part of a new release, I have put it on the TODO list.
Might become something like this:
Code: Select all
shut_down("SYSTEM")
shut_down("APPLICATION")
shut_down("INSTRUMENT")
shut_down("PANEL")
Expect something along the lines of two months.
Corjan
Re: API Command to switch of Raspberry PI
Thanks very much Corjan.Corjan wrote: ↑Thu Jan 25, 2018 12:40 pm Having said that, I will implement this feature in Air Manager / Air Player. It might take a while though before it is part of a new release, I have put it on the TODO list.
Might become something like this:Expect something along the lines of two months.Code: Select all
shut_down("SYSTEM") shut_down("APPLICATION") shut_down("INSTRUMENT") shut_down("PANEL")
Re: API Command to switch of Raspberry PI
Hi,
No problem,
I have implemented the shut_down function in our codebase. Only the "APPLICATION" and "SYSTEM" types.
Next week, I will probably create a new Air Player BETA for Raspberry Pi, it will be included in that version.
Corjan
No problem,
I have implemented the shut_down function in our codebase. Only the "APPLICATION" and "SYSTEM" types.
Next week, I will probably create a new Air Player BETA for Raspberry Pi, it will be included in that version.
Corjan
Re: API Command to switch off Raspberry PI
I know it's bad form, but I just shut off the mains and dump the PIs - so far, never knackered one after probably 200 such dumps over last three months. I was expecting to have to reflash occasionally, but so far so good.
FSX/P3D/XP11 - i7@5Ghz, GTX1080, 4 screens + Air Manager screen + custom hardware & Avionics COM, GPS, Radios, XPOND, AP (www.simav8.com)
Re: API Command to switch off Raspberry PI
Hi,
is this in the latest beta yet? Just asking if I should download that beta or not, this would be the only reason for me as I am pretty happy with the stable.
Best regards,
Pavel
is this in the latest beta yet? Just asking if I should download that beta or not, this would be the only reason for me as I am pretty happy with the stable.
Best regards,
Pavel
Pavel Brodský
Prague, Czech Republic
Prague, Czech Republic
Re: API Command to switch off Raspberry PI
Hi,
Unfortunately, I don't know anymore I think it is...
I will make a new BETA tomorrow anyways, so it is definitely in there.
Corjan
Unfortunately, I don't know anymore I think it is...
I will make a new BETA tomorrow anyways, so it is definitely in there.
Corjan
Re: API Command to switch off Raspberry PI
Working perfectly with the latest beta, thank you so much!
Pavel
Pavel
Pavel Brodský
Prague, Czech Republic
Prague, Czech Republic
Re: API Command to switch off Raspberry PI
No problem.
And sorry for the delay,
Corjan
And sorry for the delay,
Corjan