You are reading a single comment by @Pinnchus and its replies. Click here to read the full conversation.
  • Tried to reduce JSVARs by changing the 40,000 value in ...../targets/esp32/main.c (Did not find any other place to do it)

    static void espruinoTask(void *data) {
      int heapVars;
      PWMInit();
      RMTInit();
      SPIChannelsInit();
      initADC(1);
      jshInit();     // Initialize the hardware
      heapVars = (esp_get_free_heap_size() - 40000) / 16;  //calculate space for jsVars **** modified 40,000 to 60,000
      heapVars = heapVars - heapVars % 100; //round to 100
      if(heapVars > 20000) heapVars = 20000;  //WROVER boards have much more RAM, so we set a limit
      jsvInit(heapVars);     // Initialize the variables
      // not sure why this delay is needed?
      vTaskDelay(200 / portTICK_PERIOD_MS);
      jsiInit(true); // Initialize the interactive subsystem
      if(ESP32_Get_NVS_Status(ESP_NETWORK_WIFI­)) jswrap_wifi_restore();  
    [#ifdef](http://forum.espruino.com/searc­h/?q=%23ifdef) BLUETOOTH
      bluetooth_initDeviceName();
    [#endif](http://forum.espruino.com/searc­h/?q=%23endif)
      while(1) {
        jsiLoop();   // Perform the primary loop processing
      }
    }
    

    With little or not success, JSVARS reduced, but still not working.

    >process.memory()
    ={ free: 267, usage: 33, total: 300, history: 7,
      gc: 0, gctime: 0.388 }
    >WARNING: Scan stop failed
    WARNING: set rssi scan not implemeted yet
     ____                 _
    |  __|___ ___ ___ _ _|_|___ ___
    |  __|_ -| . |  _| | | |   | . |
    |____|___|  _|_| |___|_|_|_|___|
             |_| espruino.com
     2v04.300 (c) 2019 G.Williams
    Espruino is Open Source. Our work is supported
    only by sales of official boards and donations:
    http://espruino.com/Donate
    >started
    ERROR: Wifi: event_handler STA_START: esp_wifi_connect: 12298(SSID is invalid)
    WARNING: Wifi:startMDNS - espressif
    Connected to Wifi.  IP address is: 192.168.2.54
    Uncaught InternalError: Not enough memory to allocate SSL socket
     at line 13 col 6
        });
         ^
    in function called from system
    >WARNING: Scan stop failed
    WARNING: set rssi scan not implemeted yet
    

    My be this is exceeding my knowledge, will wait for @maze1980 version.

    Thanks to all, for your efforts.

  • Mon 2019.12.23

    'Tried to reduce JSVARs by changing the 40,000 value in .....'

    My belief is that the understanding of what a JsVar really is, is well, . . . misunderstood.

    https://www.espruino.com/Internals

    From L2, the available memory 267 free blocks is an indication here as the board started with 2300 originally.

    As @MaBe is pointing out, it will be necessary to remove those sections of un-necessary code to allow the compiler to build a version that takes up less memory, than the one currently at release.

About

Avatar for Pinnchus @Pinnchus started