×

INDI Library v2.0.6 is Released (02 Feb 2024)

Bi-monthly release with minor bug fixes and improvements

How to shut down a Pi from EKOS

  • Posts: 194
  • Thank you received: 20
James,
I've done what I believe is correct, which is exactly what you've done. The script executes in terminal but when it says it is running in ekos it does not do what it is supposed to do. I'm going to suggest that there is something I don't know about how Ekos executes shutdown scripts. I used to use scripts all of the time to move images from the default directories to the proper directories in between each capture and that worked perfectly.
Dave
2 years 9 months ago #72431

Please Log in or Create an account to join the conversation.

  • Posts: 44
  • Thank you received: 2
Thanks for checking and glad to hear it's not just me. I was getting to all kinds of crazy python code when I saw your message!

So unfortunately I can't execute a shutdown script, are there any other options to make the pi shutdown at a fixed time do you know?
2 years 9 months ago #72433

Please Log in or Create an account to join the conversation.

  • Posts: 194
  • Thank you received: 20
I always have a VNC open and manually shut the Pi down with sudo shutdown -h now, which I assume works because the Pi goes away. I would test it on my Pi, but the Pi is outside and the ambient temp is 115F. I'l have to wait until it cools off a little before I go out and power it up. I will later. I have to know.
2 years 9 months ago #72434

Please Log in or Create an account to join the conversation.

  • Posts: 194
  • Thank you received: 20
I think I figured it out.
#!/bin/bash
killall /usr/bin/indiserver
exit 0
Works in the scheduler as a shutdown script. When bash closes, it gives a return code.
2 years 9 months ago #72435

Please Log in or Create an account to join the conversation.

  • Posts: 194
  • Thank you received: 20
Of course you don't want to kill indiserver - I just used that so I could see it working.
2 years 9 months ago #72442

Please Log in or Create an account to join the conversation.

  • Posts: 44
  • Thank you received: 2
Hi, this will be an unattended observatory so a manual shutdown is a no go

The killall approach will happily kill indiserver, how do I translate that to shut down though?
2 years 9 months ago #72445

Please Log in or Create an account to join the conversation.

  • Posts: 44
  • Thank you received: 2
So, after downloading the EKOS source code and getting to the point where the QT process launches for shutdown I finally managed to figure it out, I was simply missing #!/bin/bash from the start of the script, this works:

#!/bin/bash
shutdown now
exit 0
 
2 years 9 months ago #72449

Please Log in or Create an account to join the conversation.

  • Posts: 1067
  • Thank you received: 140
I did mention a lot of posts ago when I gave you my examples that you needed that, it’s not a script without it…I said it had to be a bash script and you said you had done that…?? could have saved yourself a bit of time there….
2 years 9 months ago #72451

Please Log in or Create an account to join the conversation.

  • Posts: 44
  • Thank you received: 2
When I asked explicitly "Does it care about any headers or file extensions or should it literally just contain that one line?" I needed "No, it has to have a header" :)

All the examples were just one liners but it needs to be a defined script at the top (not necessarily bash I might add), I'm getting there now though but thanks for chipping in
2 years 9 months ago #72452

Please Log in or Create an account to join the conversation.

  • Posts: 1067
  • Thank you received: 140
This was my example….from earlier not a 1 liner…its not a script without the bin/bash, I also posted that too….
but never mind you have sorted it now…. :)

Have you tried 
#!/bin/bash
sudo systemctl poweroff
2 years 9 months ago #72454

Please Log in or Create an account to join the conversation.

Time to create page: 1.292 seconds