1
0
Fork 0
Browse Source

change info. about cronjob in README.

This is a minor change but I thought it was best to document it.

The factory typically shutdowns at 16:00  but for some reason I thought it was 18:00. Because of this, 'factory1' (the light-meter used for testing) was not shutting down properly. The factory's power was cut at the end of the day (again typically 16:00 but not always) and the Pi would have a dirty power-down. This, also, meant the server and its opposite relay [return-to-ritherdon/relay] would think it was still on but sending no new readings.

All of the above has no great effect of the **note** left in the README but I thought I should change it on the off-chance someone copies that line into a part of the system.
pull/2/head
Craig Oates 3 years ago
parent
commit
b7140cbf2b
  1. 4
      README.md

4
README.md

@ -135,9 +135,9 @@ When you are ready to run this project as intended, you can set-up a cron-job fo
```bash
@reboot bash /home/rtrp/repos/light-meter/startup.sh &
00 18 * * * /home/rtrp/repos/light-meter/shutdown.sh
00 16 * * * /home/rtrp/repos/light-meter/shutdown.sh
```
These tasks make the Raspberry Pi send a message to the sever to indicate its/their status ("on" or "off") and makes the "cli_meter.py" script run. At this point, you should be able to walk away and let the Pi do its thing. This is assuming the server is up and running and the Pi is connected to the world-wide-web. If all is successful, you will notice the Pi will turn itself off at 18:00 (6 p.m.) and will start sending light reading when you turn it on without any input from you. Unfortunately, the Pi can only manage the shutdown procedure on its own. You will need to turn it on. (This has been accounted whilst the exhibition is open.)
These tasks make the Raspberry Pi send a message to the sever to indicate its/their status ("on" or "off") and makes the "cli_meter.py" script run. At this point, you should be able to walk away and let the Pi do its thing. This is assuming the server is up and running and the Pi is connected to the world-wide-web. If all is successful, you will notice the Pi will turn itself off at 14:00 (4 p.m. -- when the factory begins shutting down for the day) and will start sending light reading when you turn it on without any input from you. Unfortunately, the Pi can only manage the shutdown procedure on its own. You will need to turn it on. (This has been accounted whilst the exhibition is open.)
To make sure the Pi sends a "powering down" message to the server, I tend you create an alias called `powerdown`. When you type this into the console, it runs the "shutdown.sh" script -- which has the shutdown command within it. To make the alias permanent, enter `alias='~/repos/light-meter/shutdown.sh'` into `~/.bashrc`. This is easier to test the bespoke shutdown procedure is working as intended. You can, also, adjust the time in the crontab or run the script by running the script like you normally would but I find them to be frustrating to do in this instance.