Skip to content

Commit

Permalink
Move libraries to lib/
Browse files Browse the repository at this point in the history
Move test history dir out from t/
Update README
  • Loading branch information
duanemay committed Jun 11, 2023
1 parent e28b91a commit 218e0e5
Show file tree
Hide file tree
Showing 16 changed files with 11 additions and 16 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
*.o
*.pm.tdy
*.bs
history/

# Devel::Cover
cover_db/
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@ mySprinkler

Controller for a sprinkler that takes into account even/odd days and the past week's rainfall.

Before using you will need to get an API key from https://darksky.net/dev
and edit the values in sprinklerConfig.pm with your key and location.
Before using you will need to get an API key from https://www.visualcrossing.com/weather/weather-data-services#
and edit the values in lib/sprinklerConfig.pm with your key and location.

This now runs directly on the OSPi (or custom board with matching pins wired to a shift register and relays)
it no longer requires the C program nor the wiring library, to interact with the shift register.
This now runs directly on the OSPi (or custom board with matching pins wired to a shift register and relays). It no longer requires the C program nor the wiring library, to interact with the shift register.

## Cron

Expand All @@ -18,15 +17,16 @@ Add a line to your crontab like:
30 04 * 9 1-16 PERL5LIB=/home/pi/mySprinkler /home/pi/mySprinkler/sprinklerProgram.pl &>> /home/pi/log/sprinkler.log
```

make sure the log directory exists
make sure the log and history directories exists
```bash
mkdir /home/pi/log
mkdir /home/pi/history
```

You can also run the sprinklers if it is hot like this
```bash
# run sprinklers to cool down at 6:45PM
45 18 * 6,7,8 * PERL5LIB=/home/pi/mySprinkler /home/pi/mySprinkler/coolDown.pl &>> /home/pi/log/coolDownSprinkler.log
45 18 * 6,7,8 * PERL5LIB=/home/pi/mySprinkler/lib /home/pi/mySprinkler/coolDown.pl &>> /home/pi/log/coolDownSprinkler.log
```

## Manual Cycle
Expand All @@ -40,13 +40,13 @@ Cycle once through all zones for testing

Tests run with:
```bash
prove -I.
prove -l
```
Create a `history` dir to not have to re-download the weather data each time.

or use the history in the test dir with:
```bash
prove -I.. -r .
prove -l -r
```
or:
```bash
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 2 additions & 3 deletions sprinklerConfig.pm → lib/sprinklerConfig.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ package sprinklerConfig;

# Visual Crossing API Key and location
$apiKey = "ENTER YOUR API KEY HERE";
$weatherLatitude = "ENTER YOUR LATITUDE HERE";
$weatherLongitude = "ENTER YOUR LONGITUDE HERE";
$weatherLocation = "ENTER YOUR LOCATION HERE";

# number of zones and minutes to run per zone (up to 4x to avoid run off)
# these should match
$numberZones = 8;
@minutesToRunPerZone = (10,10,10,10,10,5,5,5);
@minutesToRunPerZone = (10,12,12,8,13,13,5,5);

# wait time between turning off a zone to turing on the next
$secondsDelayBetweenZones = 1;
Expand Down
File renamed without changes.
5 changes: 1 addition & 4 deletions testAll.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#!/bin/sh -f

SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"

cd "${SCRIPT_DIR}"/t || exit 1
prove -I.. -r .
prove -l -r

0 comments on commit 218e0e5

Please sign in to comment.