• Hi all,

    I've been knocking together an IoT device using Espruino and came across an issue whilst testing in the centre of London. Where I am sat, wifi.scan() is returning around 30 access points which is eating up approximately 26% of the 1700 js variables I have available on the ESP8266.

    Obviously the memory used will vary based on location and therefore is a pretty serious point of failure in my project.

    Can I suggest an additional feature to limit the number of returned access points (i.e. Wifi.scan(callback, limit)) such that the first 0-limit elements are added to RAM?

    Thanks for your help in advance.


    Note: I've raised this as an issue here .

  • Hi I can't replicate this. I have 34 APs available in my location. Following a reset() and wifi.scan() , process.memory().free reports 1649 jsvars.

    Maybe the issue is what you are doing with the data post-scan? Can you provide more info on what your code is doing?

  • Thanks for taking a look at this Ollie.

    I've had the same results doing as you've done. I believe the garbage collector is admirably quick. My code is separated in such a way its not easy to copy and paste here.

    Effectively I'm trying to scan for available networks then iterate over them to see if I have an associtated ssid-password pair stored in eeprom. Then with those available, attempt to connect.

    I'm trying an approach which limits the scope (therefore lifetime) of the larger lists as well as exploring compiling the Espruino binaries as per https://github.com/espruino/Espruino/blo­b/master/README_Building.md#for-esp8266

    Thanks again

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

ESP8266 - Wifi.scan() causing "Out of Memory" error.

Posted by Avatar for user75246 @user75246