AMI-system / ami_setup

AMI configuration files
MIT License
0 stars 2 forks source link

Check if witty pi schedule exists. #17

Open albags opened 1 month ago

albags commented 1 month ago

Possible solution propose by @abhimandela:

  1. IF shutting down due to low voltage threshold (checks to be made in beforeShutdown.sh using something like tail -n 10 wittypi.log | grep “shutdown message seen in log” ) THEN run WittyPi schedule generation (before the delay) to make sure systems turns ON as per schedule . But this is a rare issue and maybe concerned with a damaged witty pi so I will let you all decide the best course of action for this.

  2. IF (current_time > end_time in schedule.wpi ) OR (ON due to 5V / USB connected message in wittypi.log) OR (no schedule.wpi file present) THEN run Witty Pi schedule generation in afterStartup.sh

albags commented 1 month ago

As a temporary solution, the wpi_script_generator_ags.py will run in the crontab every day at midnight and 5 minutes and in the the afterStartup.sh file.