You are reading a single comment by @gdanov and its replies. Click here to read the full conversation.
  • Sat 2021.05.08

    re 'again via setInterval I push the collected strings'
    re 'Also, the device works for few hours and then stops sending data'

    New interpreter error: CALLBACK,MEMORY
    



    Hi @gdanov , what techniques are being used to check memory? There really isn't enough here to make a definitve response. The above however, leads me to believe that memory is being gobbled up. It is quite possible that a setInterval is buried inside a repetative loop, or something of the sort, from which then, Espruino is being blocked from perfofming the necessary garbage collection.

    Has process.memory() been viewed to determine usage as time moves along? Please post before, during and after.


    'but it looks like both setInterval handlers are cancelled?'

    Is the trailing question mark indicating a guess here, was a check actually done?

    If it hasn't been discovered yet, these commands entered into L-Hand WebIDE console will reveal the state of memory.

    console.log(global["\xFF"].timers); //nice, less info
    
    trace(global["\xFF"].timers); //full info
    

    As @MaBe pointed out in post #2 it'll be much easier to assist with the actual code. Please post.

  • Thanks for the debugging hints. I knew none of this. Where should I look for more debugging hints?

    setInterval is called once from the main context. These are my timers in normal situation:

    global["\xFF"].timers
    =[
      undefined,
      undefined,
      undefined,
      { time: 140550, interval: 300000,
        callback: function (undefined) { ... }
       },
      { time: 1342468, interval: 3000000,
        callback: function (undefined) { ... }
       }
     ]
    

    this is memory (again under normal conditions)

    { free: 1563, usage: 737, total: 2300, history: 23,
      gc: 538, gctime: 2.717, blocksize: 16 }
    

    I'll definitelly incorporate your and @AkosLukacs hints into the error handling and debugging when it crashes again.

  • re: 'Where should I look for more debugging hints?'
    re: 'I knew none of this. '

    Hi @gdanov As an enduser like yourself, I've watched the Espruino site grow over the last five years. I started with absolutely no experience with microcontrollers, and gained my knowledge by just helping others through the forum, demonstrating how to 'turn over the rocks' to learn the idiosyncrasies. Surprisingly, all the info is there and well laid out. With the wealth of tutorials and user examples, the site is expansive and complete.

    The easiest and most obvious is to start with any Espruino page and from the menu find the 'Quick Start' info pages.

    Espruino.com >> Menu >> Documentation >> Quick Start
    

    or

    Espruino.com >> Menu >> Support >> Getting Started
    

    Traversing the forum section is another place to pick up all these hints. A few years back, I created a summary page with the best links in it, and can be found at the top of the 'Tutorials' forum section.

    Tutorials:   http://forum.espruino.com/microcosms/130­/

    Open the cream colored pinned top-most 'Writing an effective forum post' and find the heading: 'in addition have these excellent pages been reviewed' found a third the way down the page.

    As a suggestion, keep asking questions, then search out the solution. As I mentioned, most can be found with a small amount of digging.

    Keep turning those rocks over . . . .

  • 'setInterval is called once from the main context'

    What method is being used to end or remove each defined interval?

    From that statement, I'd only expect one timer to show active, but two(five) are shown in the response in post #9


    'this is memory (again under normal conditions)'

    There appears to be plenty available. re: free



    Again, as the others and I have requested, best to post some code, so as not to guess here!

About

Avatar for gdanov @gdanov started