docs: Add cronjob setup instructions to README
This commit is contained in:
@@ -24,11 +24,26 @@ Please refer to the [arcade-button-wiring.md](arcade-button-wiring.md) file for
|
|||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
1. Make sure your audio file (`Laid Back - Sunshine Reggae.mp3` or any other MP3 you prefer) is in the project directory.
|
1. Make sure your audio file (`Laid Back - Sunshine Reggae.mp3` or any other MP3 you prefer) is in the project directory.
|
||||||
2. Run the alarm clock script:
|
2. Run the alarm clock script manually:
|
||||||
```bash
|
```bash
|
||||||
python3 wecker.py
|
python3 wecker.py
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Automating with Cron
|
||||||
|
To have the alarm start automatically at a specific time (e.g., 6:45 AM on weekdays), you can set up a cronjob.
|
||||||
|
|
||||||
|
1. Open your crontab configuration:
|
||||||
|
```bash
|
||||||
|
crontab -e
|
||||||
|
```
|
||||||
|
2. Add the following line at the end of the file (adjust the paths if your setup differs):
|
||||||
|
```bash
|
||||||
|
45 6 * * 1-5 cd /home/pi/workspace/wecker && /usr/bin/python3 wecker.py > /home/pi/workspace/wecker/cron.log 2>&1
|
||||||
|
```
|
||||||
|
* `45 6`: Runs at 6:45 AM.
|
||||||
|
* `* * 1-5`: Runs from Monday (1) to Friday (5). Skips the weekend.
|
||||||
|
* It ensures the script runs in the correct directory so it can find the audio file.
|
||||||
|
|
||||||
## How the Puzzle Works
|
## How the Puzzle Works
|
||||||
1. **Ringing:** The music plays in an endless loop.
|
1. **Ringing:** The music plays in an endless loop.
|
||||||
2. **Start:** Press the arcade button once to start the puzzle. Wait 3 seconds.
|
2. **Start:** Press the arcade button once to start the puzzle. Wait 3 seconds.
|
||||||
|
|||||||
Reference in New Issue
Block a user