Scheduler / Cron job on FX30

I am working with the FX30 for the first time and trying to determine the best technique for scheduling.

I have written a few python scripts that can take a reading and push data to the cloud or echo to the screen, but I have to run manually on command line.

I have found where you can put the device to sleep and have it wake every so often but no mention of how scheduling works in the unit between applications. I kind of assumed their would be a scheduling app, but I have read through a lot of the Legato docs, and searched and don’t find anything.

I found an old post where someone tried to install cron:

Cron is how you would normally do it in Linux, put it seems to me they would have included cron, if that is how you are supposed to do it.

So a basic application might be: Check IO2 (analog input) every 15 minutes and then push the data to the cloud. Or call a python script which would take a reading, if out of range, send an alarm.

Any help is appreciated…

Thanks in advance.

What is the problem now?
You cannot make the device sleep and wake to run the python script?
Or you cannot include the cron in yocto image?

My questions are:

  1. Is there a scheduler built into the legato environment to accomplish various different tasks?

I am just getting started, but it seems like you might have several different tasks or functions that happen at different times, and it would be nice to be able to use a scheduler for that to happen.
For example, take a GPS reading every hour, if location is different than previous reading, send an update.
Take a IO2 (analog) reading every 15 minutes, if it has changed send an update.
Run another script every Y minutes to poll a PLC or data collector and report if needed.

In linux this would usually be done with a cron job. I assume they have something different in mind with legato, since they don’t have cron installed by default.

  1. If there is not a scheduler, then how are people accomplishing various task that happen periodically, but may not always at the same time?

Thanks!

how about using a one-shot timer or periodic timer?
Here is an example of using periodic timer with GPIO function:
Timer and accessing GPIO in Legato application.docx (71.0 KB)

Of course you can also try with cron