Avatar for Sacha

Sacha

Member since Feb 2014 • Last active Jan 2019
  • 42 conversations
  • 232 comments

Most recent activity

    • 13 comments
    • 206 views
  • in Pico / Wifi / Original Espruino
    Avatar for Sacha

    Thanks again.

  • in Pico / Wifi / Original Espruino
    Avatar for Sacha

    Hi Gordon

    Thanks for your help. How much mem will eval use ? I think i allocate some spare space ?

    var evalneed='How much is needed for eval ?';
    if (x===undefined) { throw new Error("Not enough RAM for .bootcde"); }
        else {
             evalneed=''; // Required for eval
    // Ugly hack !
            eval('var x = E.toString(ST.read(".bootcde")); ST.eraseAll(); ST.write(".bootcde",x); console.log("survived");');
           // Here i do a reset via my custom watchdog function.
    }
    
  • in Pico / Wifi / Original Espruino
    Avatar for Sacha

    Hi Gordon

    After switching to "save to flash" in the IDE, i got a lot of more RAM free. After deleting all files except ".bootcde" and calling compact, nothing new. I do not get flashmemory back.

    Then i made a very ugly hack that seems to work!

    // ST is the storage object
    
    var x = E.toString(ST.read(".bootcde"));
        if (x===undefined) { throw new Error("Not enough RAM for .bootcde"); }
        else {
            // Ugly hack !
            eval('var x = E.toString(ST.read(".bootcde")); ST.eraseAll(); ST.write(".bootcde",x); console.log("survived");');
           // Here i do a reset via my custom watchdog function.
    }
    

    After the reboot everything is working fine, storage is freed and ready for reuse ;-)

    Sacha

  • in Pico / Wifi / Original Espruino
    Avatar for Sacha

    I've added to my wishlist a espruino wifi v2 with more RAM and more Flash ;-)

  • in Pico / Wifi / Original Espruino
    Avatar for Sacha

    Hi Gordon
    Thanks for your answer. I got "not enough RAM for varimg".
    Save() is not an option. After the reboot, i get errors in the console. Wifi communication fails.

    With the save to flash option in IDE i'm not familiar. Do you have a link where i can read about this ?

    EDIT: Found: https://www.espruino.com/Saving

    Thanks
    Sacha

  • in Pico / Wifi / Original Espruino
    Avatar for Sacha

    Hi Gordon

    I have several EspruinoWIFI distributed in my house.
    The Espruinos are "installed", in most cases difficult to connect via USB again.

    They all communicate to each other over IP. They know each other over UDP dynamicaly.

    Each espruino has a little "core" software saved.

    The over all configuration of all espruinos and additional code for different devices (Replays, Sensores, etc.)
    are dirtibuted over wifi to the espruinos as needed by the "core" software.

    Every espruino will get the config and the individual needed additional device code to use and store it on the storage.

    So i have a full redundancy. Each espruino has stored the config of all espruinos and several espruinos has stored small code for
    different devices like sensores etc.

    They inform each other about the newest config version and the version of the small code pieces over udp.

    If a espruino has a newer version of the config for all espruinos or a newer version of code for connected
    devices (Relay, Sensor etc.), the other espruinos will request and get them over tcp too.

    That is the reason why i use a lot of the storage and get in trouble with it.

    That's why i'm looking for a way to wipe out everything except the saved code from the storage.
    In that case the config and the needed additional code can be downloaded and stored again.

    Greetings

    Sacha

  • in Pico / Wifi / Original Espruino
    Avatar for Sacha

    Hi Gordon
    Thanks for your fast answer. I tried the latest 'cutting edge' build. Same result.
    After deleting everything exept the .varimg and calling compact(); again, i do not get any space back.

    It would be very nice if you could implement a way to delete the flash for reuse without deleting the saved code. Like eraseAll() but without deleting the saved code.

    Thanks
    Sacha

  • in Pico / Wifi / Original Espruino
    Avatar for Sacha

    Hello Gordon
    I tried the storage function on FW 2.00

    I transfered some files over wifi and stored them using the storage.write();
    After deleting all files exept the saved code, i do call storage.compact().

    But i do net get the space back ?

    >ST.getFree();
    =22516
    // Transferred some files and stored: 
    >ST.list();
    =[
      ".varimg",
      "init",
      "config",
      "CORE",
      "DOUT",
      "SW",
      "reboot"
     ]
    // New Free.
    >ST.getFree();
    =9504
    
    >ST.erase('init');
    =undefined
    >ST.erase('config');
    =undefined
    >ST.erase('CORE');
    =undefined
    >ST.erase('DOUT');
    =undefined
    >ST.erase('SW');
    =undefined
    >ST.erase('reboot');
    =undefined
    >ST.list();
    =[
      ".varimg"
     ]
    > ST.compact();
    =undefined
    // Free ?
    >ST.getFree();
    =9504
    

    Thanks for the help.

    Sacha

    P.S.: A storage.eraseAll() function that removes everything exept the saved code would be nice (As an option for eraseAll() ) ?

  • in Pico / Wifi / Original Espruino
    Avatar for Sacha

    Hi Gordon
    I would like to let you know that the following seems to work.
    When i catch the first Error: "InternalError: Timeout on I2C Write Transmit Mode 2"
    i call another I2c1.setup. Everything is working again.

    A test of 36 hours was successfull.

    Sacha

Actions