Avatar for VSerain

VSerain

Member since Oct 2021 • Last active Nov 2021
  • 2 conversations
  • 6 comments

Most recent activity

    • 7 comments
    • 1,371 views
  • in General
    Avatar for VSerain

    Hello,
    I think save crontab in flash and load file at every minutes.

    Good day,
    Victor

  • in General
    Avatar for VSerain

    For bangle,
    I have think at two methods in Bangle object, Bangle.createCron and Bangle.removeCron or Bangle.cron.create/remove.

    Create method have two parameters, first is a time string ("* * ...") and second is name of file ("myapp.[CRON_NAME].cron.js").
    This data is writing in file or in config to not lose their after reboot.

    Remove method have same parameters, and we remove data in file/config.

    And regularly (e.g. at all minutes) the cron engine, read cron file (or config file). And check if this now match with time string.
    If it is true we load file script.

    The cron engine can be writing in C or in JS.
    Surely you know which languages it is best for ?

    We need to define what we want to allow as a time value?
    Support just minimal (hours and minutes) or full cron support or another ?

    If cron engine is good, we can use engine for alarm and calendar event.

  • in General
    Avatar for VSerain

    Hello,
    I wonder if adding a "cron" feature in Espruino or just in Bangle would be a good idea ?

    For my case, i want start a buzz at every hour. I can use setTimeout or setInterval.
    But if many app use setTimeout/Intervale, in internal we check at all loop turn if this timeout is done and if is true, we start the callback.
    It can be memory and cpu intensive.

    If we add a simply cron (just hours and minutes) we have one interval (one minutes) and at all minutes check if many tasks match with this time.

    In memory it would be enough to store the pointer of callback and one string (e.g.: "* 0" all hours at zero minutes).

    What's do you think ?

    Good day,
    Victor

  • in Bangle.js
    Avatar for VSerain

    Oh yes that was there before !
    Thanks for review and for your times. 
    Good day !

  • in Bangle.js
    Avatar for VSerain

    I am not sure understand, you say Bangle kill app when the screen is off ?

    In my case, i just shut down compass when screen is off.

    And i have found a bug, on the interval that call "reading" method.
    An interval can be triggered several times without stopping the previous interval.
    So it is impossible to stop the previous loops.

  • in Bangle.js
    Avatar for VSerain

    Hello,

    I was wondering if there was a process to propose a new update for an app that we did not create?

    For example, I want to update the 'arrow' app, to disable compass when the screen off. (https://github.com/espruino/BangleApps/p­ull/856)

    Thanks for your time, and sorry for my english.

    Victor

Actions