• Happened really fast the first time, now seems to be running stable for a while
    Edit: Now closing in on 5 hrs running continuously. Heading to bed.

    All of these errors were appearing in rapid succession, meaning it was trying to log much more frequently than it should have been - the onslaught was such that the trace and everything else got pushed out. Is there a way to make the IDE log to a file, so I wouldn't miss the results of trace() and the events surrounding the initial event?

    In any event, there is no way that the espruino was running for 44494 seconds, nor had it been running for ~25k seconds when the failure occurred.

    !!?!?!

    http://drazzy.com/espruino/v58devfailure­.txt

    I'm rather confused by the early failure, followed by a very stable run....

  • Yes... I had that once - but then it went away. I wonder whether it was something strange to do with the firmware update....

    Let me know whether it happens again though (and if you find a way to reproduce it). Glad it's looking more stable now!

  • Failed at some point during the night with the same symptom. Again, by the time I'd found it, the original trace() was long since pushed off the console, and disk errors coming rapidly while the getTime increased far too fast. Last log entry was at 28802.

  • Strange. I've been running it overnight here (not with filesystem writes, but with a clock using setInterval) and it's spot on :(

  • Yeah, I've only seen it when I'm doing fs writes. It's as if the SD card failure breaks the timer somehow...

    Seems to work fine just sitting there reading dht's.

    Edit: Just got another failure, this one much faster - and I got the whole trace this time because it froze entirely at the end

    http://drazzy.com/espruino/v58devfailure­2.txt

    (note that I'd created a demo array to show my friend the WS2812's, that's why there's a graphics object in the trace)

  • Thanks - just wanted to check - are you using setDeepSleep at all?

  • Nope, no deep sleep.

  • The timer bug can be reproduced with this code:

    
    var fs;
    var interv;
    var t=-1;
    var rh=-1;
    
    
    
    function onInit() {
        setTimeout("doInit();",2000);
    }
    
    function doInit() {
        fs=require("fs");
        fs.appendFile("timetemp.log","Espruino restarted")
        interv=setInterval(function(){dologs();}­,5000);
        setBusyIndicator(A13);
    }
    
    function dologs() {
        console.log("trying to log..."+getTime().toFixed());    
        var ti = getTime();
        if (!fs.appendFile("diskerrator.log","DHT11­,"+t.toString()+","+rh.toString()+",Time­,"+getTime().toFixed()+"\n")){
            console.log("FAIL before "+ti+" after "+getTime());
        }
    }
    
    
    save();
    
    

    Ran it overnight, and woke up to it broken. Manually cleared the interval, and typed getTime() a few times. These were typed a couple of seconds apart at most:

    ERROR: Unable to write file : DISK_ERR
    FAIL before 45778185.87560272216796 after 45778190.38722991943359
    trying to log...45778199
    ERROR: Unable to write file : DISK_ERR
    FAIL before 45778211.53864669799804 after 45778216.05158138275146
    trying to log...45778225
    ERROR: Unable to write file : DISK_ERR
    FAIL before 45778237.20124530792236 after 45778241.71224975585937
    trying to log...45778250
    ERROR: Unable to write file : DISK_ERR
    FAIL before 45778262.85095405578613 after 45778267.36160087585449
    trying to log...45778276
    ERROR: Unable to write file : DISK_ERR
    FAIL before 45778288.36543083190917 after 45778292.84815883636474
    trying to log...45778302
    ERROR: Unable to write file : DISK_ERR
    FAIL before 45778314.20237731933593 after 45778316.91917991638183
    trying to log...45778319
    ERROR: Unable to write file : DISK_ERR
    FAIL before 45778324.45648479461669 after 45778326.43975925445556
    trying to log...45778329
    ERROR: Unable to write file : DISK_ERR
    FAIL before 45778333.97615909576416 after 45778336.01252174377441
    clearInterval(inter);
    =undefined
    getTime();
    =45802702.42679214477539
    getTime();
    =45814433.28411769866943
    getTime();
    =45828450.28250503540039
    reset();
    =undefined
     _____                 _ 
    |   __|___ ___ ___ _ _|_|___ ___ 
    |   __|_ -| . |  _| | | |   | . |
    |_____|___|  _|_| |___|_|_|_|___|
              |_| http://espruino.com
     1v58 Copyright 2014 G.Williams
    
    =undefined
    >getTime();
    =46298892.14406204223632
    >getTime();
    =46307856.84639739990234
    

    (in above, I had to remove the > prompt, otherwise the forum mangled it)

    Last entries in the log:

    DHT11,-1,-1,Time,11087
    DHT11,-1,-1,Time,11092
    DHT11,-1,-1,Time,11097
    DHT11,-1,-1,Time,11102
    DHT11,-1,-1,Time,11107
    DHT11,-1,-1,Time,11112
    DHT11,-1,-1,Time,11117
    DHT11,-1,-1,Time,11122
    DHT11,-1,-1,Time,11127
    DHT11,-1,-1,Time,11132
    DHT11,-1,-1,Time,11137
    DHT11,-1,-1,Time,11142
    DHT11,-1,-1,Time,11147
    DHT11,-1,-1,Time,11152
    DHT11,-1,-1,Time,11157
    DHT11,-1,-1,Time,12697
    DHT11,-1,-1,Time,12697
    DHT11,-1,-1,Time,12697
    DHT11,-1,-1,Time,12697
    DHT11,-1,-1,Time,12697
    DHT11,-1,-1,Time,12697
    DHT11,-1,-1,Time,16339
    DHT11,-1,-1,Time,16339
    DHT11,-1,-1,Time,16339
    DHT11,-1,-1,Time,16339
    DHT11,-1,-1,Time,16339
    
  • You know you can just wrap code in three backtick marks? I just edited your post to add it.

    Thanks for cutting it down - I'll try that code out and see what I can get to happen with it.

  • Yeah - I knew about the backticks (and used them for the js code - or I thought I did), but didn't think to use it on the logs - I was in a hurry since I was posting it while not before I left for work.

    What's strange is how it gets 11 writes off (in two bursts) shortly after things have started going off the rails.

  • Right - just reproduced. Mine did it early too:

    trying to log...4033
    trying to log...4038
    trying to log...4043
    trying to log...4050
    ERROR: Unable to write file : DISK_ERR
    FAIL before 4052.196215629577636718 after 4060.322003364562988281
    trying to log...4078
    ERROR: Unable to write file : DISK_ERR
    FAIL before 4080.756432533264160156 after 4088.670434951782226562
    trying to log...4095
    ERROR: Unable to write file : DISK_ERR
    FAIL before 4097.461118698120117187 after 4105.502131462097167968
    

    I'll see what I can do about fixing this next week.

  • Just a thought - this will be some issue with the code that keeps the system tick timer in sync with the RTC.

    As a workaround, try setDeepSleep (1) and power from a charger/battery so it enters sleep. That will almost certainly solve your problems.

    It also explains why one of mine has been running all week and is still keeping good time.

  • Could you give this a go please? http://www.espruino.com/binaries/git/com­mits/e85fa5a013c3a1469635b92e12a35591eb2­589d8

    I've been running it for the past 6 hours or so with your logger and it appears to be fine.

  • So far it's been running over night without issue. Will keep letting it run.

  • Wohoo! 1v59 (just released) has the fix in too.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

ERROR: Unable to write file : DISK_ERR, leads to Out of Memory errors.

Posted by Avatar for DrAzzy @DrAzzy

Actions