Skip to content

Cron not working for latest release #2080

@ghost

Description

Please note that the cron module works using build from branch 2.1.0-master_20170521 but doesn't work using the latest release (master branch) from the cloud build service.

8<------------------------ BUG REPORT -----------------------------------------

Expected behavior

Output using nodemcu firmware from branch 2.1.0-master_20170521.

NodeMCU 2.1.0 build unspecified powered by Lua 5.1.4 on SDK 2.1.0(116b762)

Time Sync 2017/08/17 08:32:21
Every Minute: 2017/08/17 08:32:21
Every Minute: 2017/08/17 08:33:00
Every Minute: 2017/08/17 08:34:00

...and so on with output of same format as above with different time every minute on new line.

Actual behavior

Output using nodemcu firmware from the cloud build service.

NodeMCU custom build by frightanic.com
branch: master
commit: b62fae9
SSL: false
modules: cron,file,gpio,net,node,rtctime,sntp,tmr,uart,wifi
build built on: 2017-08-17 06:35
powered by Lua 5.1.4 on SDK 2.1.0(116b762)

Time Sync 2017/08/17 07:16:31

...and no further output.

Test code

Provide a Minimal, Complete, and Verifiable example which will reproduce the problem.

-- add code here
function sync_success()
    tm = rtctime.epoch2cal(rtctime.get())
    print(string.format("Time Sync  %04d/%02d/%02d %02d:%02d:%02d", tm["year"], tm["mon"], tm["day"], tm["hour"], tm["min"], tm["sec"]))
    cron.schedule("* * * * *", function(e) 
		      tm = rtctime.epoch2cal(rtctime.get())
		      print(string.format("Every Minute: %04d/%02d/%02d %02d:%02d:%02d", tm["year"], tm["mon"], tm["day"], tm["hour"], tm["min"], tm["sec"]))
    end)
end

wifi.eventmon.register(wifi.eventmon.STA_GOT_IP, sntp.sync(nil, sync_success, nil, nil))
    
wifi.setmode(wifi.STATION)
    
station_cfg={}
station_cfg.ssid="xxxx"
station_cfg.pwd = "xxxx"
wifi.sta.config(station_cfg)
wifi.sta.connect()

NodeMCU version

The build for which the above code doesn't work is from the master branch from the cloud build website (https://nodemcu-build.com/index.php) so the branch must be 2.1.0-master_20170811.

Please note that my code works for the previous release of branch 2.1.0-master_20170521.
I used Docker to build the previous release.

Hardware

I am using the D1 mini with no special hardware setup.

8<------------------------ END BUG REPORT -------------------------------------

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions