kiln-controller-max31856/docs/schedule.md

75 wiersze
3.0 KiB
Markdown
Czysty Zwykły widok Historia

2022-11-04 17:11:12 +00:00
Scheduling a Kiln Run
=====================
2022-11-04 17:30:03 +00:00
Our lives are busy. Sometimes you'll want your kiln to start at a scheduled time. This is really easy to do with the **at** command. Scheduled events persist if the raspberry pi reboots.
2022-11-04 17:11:12 +00:00
## Install the scheduler
This installs and starts the **at** scheduler.
sudo apt-get update
sudo apt-get install at
### Verify Time Settings
2022-11-04 17:27:00 +00:00
Verify the date and time and time zone are right on your system:
2022-11-04 17:11:12 +00:00
date
2022-11-04 17:20:16 +00:00
If yours looks right, proceed to **Examples**. If not, you need to execute commands to set it. On a raspberry-pi, this is easiest by running...
2022-11-04 17:11:12 +00:00
sudo raspi-config
Localisation Options -> Timezone -> Pick one -> Ok
## Examples
2022-11-04 17:27:00 +00:00
Start a biscuit firing at 5am Friday morning:
2022-11-04 17:11:12 +00:00
at 5:00am friday <<END
curl -d '{"cmd":"run", "profile":"cone-05-long-bisque"}' -H "Content-Type: application/json" -X POST http://0.0.0.0:8081/api
END
2022-11-04 17:27:00 +00:00
Start a glaze firing in 15 minutes and start a kiln watcher. This is really useful because the kiln watcher should page you in slack if something is wrong with the firing:
2022-11-04 17:11:12 +00:00
at now +15 minutes <<END
curl -d '{"cmd":"run", "profile":"cone-6-long-glaze"}' -H "Content-Type: application/json" -X POST http://0.0.0.0:8081/api
source ~/kiln-controller/venv/bin/activate; ~/kiln-controller/watcher.jbruce.py
END
Start a biscuit fire at 1a tomorrow, but skip the first two hours [120 minutes] of candling because I know my wares are dry. Start a kiln watcher 15 minutes later to give the kiln time to reach temperature so the watcher does not page me.
2022-11-07 22:41:35 +00:00
2022-11-04 17:20:16 +00:00
at 1am tomorrow <<END
curl -d '{"cmd":"run", "profile":"cone-05-long-bisque","startat":120}' -H "Content-Type: application/json" -X POST http://0.0.0.0:8081/api
END
at 1:15am tomorrow <<END
source ~/kiln-controller/venv/bin/activate; ~/kiln-controller/watcher.jbruce.py
END
2022-11-04 17:20:16 +00:00
2022-11-04 17:27:00 +00:00
Stop any running firing at 3pm tomorrow:
2022-11-04 17:20:16 +00:00
at 3pm tomorrow <<END
curl -d '{"cmd":"stop"}' -H "Content-Type: application/json" -X POST http://0.0.0.0:8081/api
END
2022-11-05 15:31:26 +00:00
Start a 15 hour long glaze firing in 5 minutes and schedule for graphs from [kiln-stats](https://github.com/jbruce12000/kiln-stats) to be created on the raspberry-pi afterward and make the graphs available via a web server running on port 8000. You can do all kinds of interesting things with this. You could create a single job for the webserver and a job per hour to update the graphs. This way you can see detailed graphs of PID params and how the system is responding to them.
2022-11-04 20:50:51 +00:00
2022-11-04 20:52:45 +00:00
at now + 5 minutes <<END
curl -d '{"cmd":"run", "profile":"cone-6-long-glaze"}' -H "Content-Type: application/json" -X POST http://0.0.0.0:8081/api
END
at now + 16 hours <<END
2022-11-04 21:31:42 +00:00
source ~/kiln-stats/venv/bin/activate; cd ~/kiln-stats/scripts/; cat /var/log/daemon.log |~/kiln-stats/scripts/log-splitter.pl |grep ^1>~/kiln-stats/input/daemon.log; ~/kiln-stats/scripts/go; cd ~/kiln-stats/output; python3 -m http.server
2022-11-04 20:52:45 +00:00
END
2022-11-04 20:50:51 +00:00
2022-11-04 17:11:12 +00:00
List scheduled jobs...
atq
Remove scheduled jobs...
atrm jobid
where jobid is an integer that came from the atq output