Step 5: Setting Up the Scheduler (cronie)

In order to automatically update the weather on reboot and refresh the weather on occasion, we are going to use cron jobs. To do that, we first have to install cronie (a crontab service) on the Edison. We’ll install cronie using the AlexT repo we used before to install Apache2 and php. The commandline to install cronie is:

opkg install cronie

Now that cronie is installed we’ll need to use VI to create two cron jobs. The first cron job will update the weather every 5 minutes and the second will update the temperature every 6 minutes. Feel free to adjust these values to whatever you want. The two cron jobs are:

*/5 * * * * curl --silent ''
*/6 * * * * curl --silent ''

You can set them up using the command:

crontab -e

Then verify they were successfully created using:

crontab -l

…which should show:

*/5 * * * * curl --silent ''
*/6 * * * * curl --silent ''

We are now setup to refresh the weather and temperature automatically.

<p>Thankyou man<br>And good luck with your new project!</p>
<p>ohh yeah and when is 2.0 coming out?</p>
<p>Honestly I'm not sure. I'm currently working on a new project (with the MediaTek LinkIt One) and then my schedule starts to get pretty tight with the holidays.</p>
<p>Heym this project is amazing.<br>I was wondering, how could i modify this so instead of just showing current weather conditions, it would show the current condition and conditions for later on in the day. An answer would be great thanks!</p>
<p>Sure... Off the top of my head you could either:<br>- have two (smaller?) separate grids or one grid and two LCDs</p><p>- have it alternate colors for current and future conditions</p><p>- have the current weather in the grid and the future weather in the LCD</p><p>Whichever way you did it, you would then just adjust the PHP script (add more querystring options), and then add the new PHP functions to the cron tab.</p>
<p>Great project and very well explained!</p>
<p>I posted a link to this project on 2 weather forums. </p>
<p>Cool thanks.</p>
<p>Nice project! I like the front plate design and weathered look.</p><p>Did you consider mounting some dividers inside to prevent unwanted images to light up?</p>
<p>&gt;&gt; Did you consider mounting some dividers inside to prevent unwanted images to light up?</p><p>Yup. That's one of the changes I'm going to add to my 2.0 build. That said, in person the bleed isn't nearly as bad as it looks in the pictures.</p>
<p>looking forward to the 2.0 version. Good luck!</p>

About This Instructable




More by nam37:The Weather Grid (Powered By Intel Edison) 
Add instructable to: