I bought a Galileo gen 2 with hope to use cron to schedule simple arduino power switching and sensor reads. Background: I'm doing this to be able to take a vacation while keeping the garden fed. Now, I'm needed every day to mix four chemicals and check pH (by hand) to make 10-15 gallons of nutrient for the already too-expensive tomatoes. Quitting here would be to admit defeat.
I'm more comfortable writing the logic in a linux environment than managing layers of interrupts on the arduino, or communication and coordination between multiple simpler arduinos. I've found many examples of arduino code accessing linux facilities -- mostly file reads -- but none where linux causes execution on the arduino. Sure, I suppose I could write strings to a linux file, have the arduino read the file and execute local code, but I thought there would be something better than polling for a file change.
Any pointers to examples would be appreciated
If cron is installed (I didn't check and I don't have an Intel Galileo at hand) then I think it's possible, since it's Linux. However...
a) A sketch is an always-running process (setup-loop functions)... then you should manage kill and restart... killing is as simple as that, and there are several threads on running sketches, just like .
b) Did you think about using a plain delay for doing any task periodically? or maybe I'm missing something.
It would be necessary to check if the Cron package is already installed in the Galileo eglibc image. I'm sure it is not installed by default in the uClibc image, but you can get it from the AlexT repository (Cronie), you can check it here: http://repo.opkg.net/galileo/i586/ http://repo.opkg.net/galileo/i586/. If you're not sure how to download packages from his repository you can check his instructions here http://alextgalileo.altervista.org/package-repo-configuration-instructions.html http://alextgalileo.altervista.org/package-repo-configuration-instructions.html.
I was also looking for another way to install it and found this https://github.com/sarweshkumar47/Packages-Install-on-Intel-Galileo-Poky-os/tree/master/cron_service... https://github.com/sarweshkumar47/Packages-Install-on-Intel-Galileo-Poky-os/tree/master/cron_service.... You'll just need to run the cron_install_galileo.sh script and it will download and install Cronie for you.
There you have two options to get Cron running on your board, I would also suggest you to check this thread https://intel-openport-v8.hosted.jivesoftware.com/thread/60751 https://intel-openport-v8.hosted.jivesoftware.com/thread/60751.
As FGT mentioned in his comment, a sketch is an always running process, so take into account his instructions on using kill and restart.
Thank you all for your fast answers. I apologize for the delay in returning. Part of that delay is a change from Windows 7 to Debian and the expected and unexpected....
Fernando, the link you provided looked promising and once the dust settles I'll be back at this more regularly. Pablo, your links made me more aware of the OS choices. There was one that I wanted to follow up on, but just now, I'm without my notes. I know that it was part of an Intel project and that it was said to host a good development environment.
Again, Thanks all. And, again, I apologize for the delay. I wish that I could say when I'd back on this....