Avatar for Pinnchus

Pinnchus

Member since Apr 2015 • Last active Dec 2019
  • 4 conversations
  • 28 comments

Most recent activity

    • 13 comments
    • 441 views
  • in ESP32
    Avatar for Pinnchus

    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.

  • in ESP32
    Avatar for Pinnchus

    Thanks for the answers, will try to compile with less jsvars.

  • in ESP32
    Avatar for Pinnchus

    Thanks....

  • in ESP32
    Avatar for Pinnchus

    Hello everybody,
    I tried with different versions of firmware (2.04) and have every time the same issue:

    Uncaught InternalError: Failed! mbedtls_ssl_setup: Not enough memory
    
    >process.env
    ={
      VERSION: "2v04",
      GIT_COMMIT: "3956264e",
      BOARD: "ESP32",
      FLASH: 0, RAM: 524288,
      SERIAL: "240ac40a-ef84",
      CONSOLE: "Serial1",
      MODULES: "Flash,Storage,hea" ... "r,crypto,neopixel",
      EXPTR: 1073484860 }
    >process.memory()
    ={ free: 2267, usage: 33, total: 2300, history: 10,
      gc: 0, gctime: 1.86 }
    >WARNING: Scan stop failed
    WARNING: set rssi scan not implemeted yet
    

    Code Testing:

    var ssid = "******";
    var password = "*****";
    var port = 80;
    var wifi = require('Wifi');
    console.log("started");
    wifi.connect(ssid, {password: password}, function() {
        console.log('Connected to Wifi.  IP address is:', wifi.getIP().ip);
        var http = require('http');
        http.get("https://www.google.com", function(res) {
          res.on('data', function(data) {
            console.log(data);
          });
        });
        // wifi.save(); // Next reboot will auto-connect
    });
    

    Full Error:

     ____                 _
    |  __|___ ___ ___ _ _|_|___ ___
    |  __|_ -| . |  _| | | |   | . |
    |____|___|  _|_| |___|_|_|_|___|
             |_| espruino.com
     2v04 (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: Failed! mbedtls_ssl_setup: Not enough memory
     at line 13 col 6
        });
         ^
    in function called from system
    

    Any help will be appreciated

    Regards, pinnchus

    • 19 comments
    • 2,138 views
  • in Pico / Wifi / Original Espruino
    Avatar for Pinnchus

    I will try to clean the code, and trace the call´s order, and come back again tomorrow. But basically the call to start is in the require(ssd1306) callback.

    Thanks for your help.

    • 11 comments
    • 1,445 views
  • in Pico / Wifi / Original Espruino
    Avatar for Pinnchus

    OK, i found it. This SSD1306 module, apparently, need at least 1.5 seconds to stabilize.

  • in Pico / Wifi / Original Espruino
    Avatar for Pinnchus

    if I plug the USB, connect the IDE and execute "g = require("SSD1306").connect(i2c, start, { height : 32 });" from the console the display update all the information. Looking further to understand why...

Actions