Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


enable gpio output when boot is complete
#5
(09-09-2021, 12:17 PM)adrii Wrote: Hi Wallyboy

I use the following in a (longer) shell script to pause until the Moode boot has completed (it doesn't check that MPD has started)


Code:
  ...
  # wait for worker to start to ensure start flag is set to 0
   until ps -C worker.php > /dev/null; do
      sleep 2
   done
   sleep 1     # extra time allow to set flag
   until test $(moodeutl -q "select value from cfg_system where param='wrkready'") = "1"; do
      sleep 4
   done
...

If you are using a systemd service file then you can wait for a script to complete using an ExecStartPre line 

Adrian.
Hi folks, I'm back to this after a hiatus.  I need some help from you coding experts (I am a novice at best).  I understand the boot detection part, but I'm having a problem setting the GPIO pin in an sh script.  Should I be using python?. I can set a GPIO pin in python, but I don't see how to execute moodutl within a python script.  Any help or direction would be much appreciated. 

Kent
Reply


Messages In This Thread
RE: enable gpio output when boot is complete - by Wallyboy - 01-05-2024, 05:07 PM

Forum Jump: