EasyManua.ls Logo

UUGear Witty Pi 4 - Integrate with Other Programs

Default Icon
53 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
31
12. Integrate with Other Programs
Witty Pi’s software is written in BASH, and it is very easy to modify and integrate with other programs.
The daemon.sh script is registered to be executed after boot, and this registration was done by the
installation script (using update-rc.d command). In the daemon.sh script, it will run beforeScript.sh
before executing the schedule script (schedule.wpi), and run afterStartup.sh file before waiting for
GPIO-4 falling, and also run the beforeShutdown.sh before actually shutdown Raspberry Pi.
If you want to run your own program before executing the schedule script (e.g. your program will
generate a new schedule script file), you can put your program command(s) in beforeScript.sh.
If you want to run your own program after executing the schedule script (e.g. your program will use
the scheduled date time for next shutdown), you can put your program command(s) in
afterStartup.sh.
If you want to run your own program before shutting down your Raspberry Pi (e.g. your program will
send out an email before shutdown), you can put your program command(s) in beforeShutdown.sh.
Please keep in mind the daemon.sh script will be executed by root user, which means it may not
Startup
Run beforeScript.sh
Execute schedule script
Run afterStartup.sh Wait for GPIO-4 falling
Run beforeShutdown.sh
Shutdown

Table of Contents