cron

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
trendkill
Normal user
Posts: 26
Joined: 22 Feb 2022, 09:04

cron

#1 Post by trendkill » 25 Feb 2023, 18:17

Hello guys, could someone show me the right way how to use cron with espeasy? I tried this example, but no luck:

on System#Boot do
cron,00 06 18 * * *,gpio,13,0
Endon

I tried it with ESP_Easy_mega_20230225_normal_ESP8266_4M1M Feb 25 2023 and the latest stable release too.
I would like to set up an irrigation schedule timer, and cron would be the best for it.

Thank you!

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: cron

#2 Post by TD-er » 25 Feb 2023, 20:49

Have you looked at the documentation page of the cron plugin?
https://espeasy.readthedocs.io/en/lates ... #p081-page

User avatar
Ath
Normal user
Posts: 3418
Joined: 10 Jun 2018, 12:06
Location: NL

Re: cron

#3 Post by Ath » 25 Feb 2023, 21:30

And the Cron plugin isn't included in the Normal build you have installed. You'll need either a Collection build (any of the A..F builds) or the Climate build installed for the availability of the Cron plugin. And of course the Max builds.
The Collection builds have all plugins available in the Normal build also available. You can upgrade via the Tools/Update Firmware button, as long as you use the same Flash layout (4M1M in your case).
/Ton (PayPal.me)

trendkill
Normal user
Posts: 26
Joined: 22 Feb 2022, 09:04

Re: cron

#4 Post by trendkill » 26 Feb 2023, 00:24

Ohh okey my bad! Yes I read the wiki, but still couldn't figure it out how is it work. Will try again with the correct build, let's see.
Thank you!!
Ath wrote: 25 Feb 2023, 21:30 And the Cron plugin isn't included in the Normal build you have installed. You'll need either a Collection build (any of the A..F builds) or the Climate build installed for the availability of the Cron plugin. And of course the Max builds.
The Collection builds have all plugins available in the Normal build also available. You can upgrade via the Tools/Update Firmware button, as long as you use the same Flash layout (4M1M in your case).

trendkill
Normal user
Posts: 26
Joined: 22 Feb 2022, 09:04

Re: cron

#5 Post by trendkill » 26 Feb 2023, 08:54

trendkill wrote: 26 Feb 2023, 00:24 Ohh okey my bad! Yes I read the wiki, but still couldn't figure it out how is it work. Will try again with the correct build, let's see.
Thank you!!
Ath wrote: 25 Feb 2023, 21:30 And the Cron plugin isn't included in the Normal build you have installed. You'll need either a Collection build (any of the A..F builds) or the Climate build installed for the availability of the Cron plugin. And of course the Max builds.
The Collection builds have all plugins available in the Normal build also available. You can upgrade via the Tools/Update Firmware button, as long as you use the same Flash layout (4M1M in your case).
OK, so I installed Colection_A build. Added the example Cron#foo event to the rules. But how can I add the cron expressions?
Thank you!

User avatar
Ath
Normal user
Posts: 3418
Joined: 10 Jun 2018, 12:06
Location: NL

Re: cron

#6 Post by Ath » 26 Feb 2023, 09:25

On the Devices page you will need to add a Cron task, where you can set the cron-expression(s) for your schedule. Don't forget to enable the task!
/Ton (PayPal.me)

trendkill
Normal user
Posts: 26
Joined: 22 Feb 2022, 09:04

Re: cron

#7 Post by trendkill » 26 Feb 2023, 10:14

Ath wrote: 26 Feb 2023, 09:25 On the Devices page you will need to add a Cron task, where you can set the cron-expression(s) for your schedule. Don't forget to enable the task!
All right, I got this. I was expecting something like a crontab file as in linux. Unfortunately this won't work for me, since one scheduled job takes one task space. And I need a lot. Probably will use the Clock#Time instead. Can I use more than 8 TimerSet somehow? I would probably need 32 or 64. Thank you!

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: cron

#8 Post by TD-er » 26 Feb 2023, 21:46

If you can write it in cron syntax, then there is some repeatability.
So why do you need so many timers?

trendkill
Normal user
Posts: 26
Joined: 22 Feb 2022, 09:04

Re: cron

#9 Post by trendkill » 26 Feb 2023, 22:30

TD-er wrote: 26 Feb 2023, 21:46 If you can write it in cron syntax, then there is some repeatability.
So why do you need so many timers?
There are many device to turn on and off in different times for different duration. Not sure yet if I need that many timers, but theorically what could be the maximum number of timers without freezing the device?

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: cron

#10 Post by TD-er » 26 Feb 2023, 22:37

It used to be 8, but I'm not 100% sure if that limit is still there.
Try using timer 10 and see what happens :)

User avatar
Ath
Normal user
Posts: 3418
Joined: 10 Jun 2018, 12:06
Location: NL

Re: cron

#11 Post by Ath » 26 Feb 2023, 22:50

We have a current limit of 128 timers in ESPEasy (we looked that up a few weeks back ;))
/Ton (PayPal.me)

trendkill
Normal user
Posts: 26
Joined: 22 Feb 2022, 09:04

Re: cron

#12 Post by trendkill » 26 Feb 2023, 22:55

Ath wrote: 26 Feb 2023, 22:50 We have a current limit of 128 timers in ESPEasy (we looked that up a few weeks back ;))
I tried with the 20221224 normal build and only 8 worked for me. 128 is in the new beta image?

User avatar
Ath
Normal user
Posts: 3418
Joined: 10 Jun 2018, 12:06
Location: NL

Re: cron

#13 Post by Ath » 26 Feb 2023, 23:18

Hm, that 128 was from memory, but now that I've looked it up in the source it's actually 256, and that limit was last changed ~3 years ago, and handling of the TimerSet/LoopTimerSet commands was changed about 2.5 year ago, in Release 20200812 AFAICS...
/Ton (PayPal.me)

trendkill
Normal user
Posts: 26
Joined: 22 Feb 2022, 09:04

Re: cron

#14 Post by trendkill » 26 Feb 2023, 23:31

Ath wrote: 26 Feb 2023, 23:18 Hm, that 128 was from memory, but now that I've looked it up in the source it's actually 256, and that limit was last changed ~3 years ago, and handling of the TimerSet/LoopTimerSet commands was changed about 2.5 year ago, in Release 20200812 AFAICS...
Wow, that's cool. I'll try it again, thanks!


Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 34 guests