You are reading a single comment by @countxerox and its replies. Click here to read the full conversation.
  • Hi, I let the program run for 25 hrs, sending to google every 2 minutes but when I look at google for the responses only 417 responses have been logged. It didn't crash but after the first few successful sends it either has the memory error, handshake failed or it works.

    >Connecting with TLS...
    Loading the CA root certificate...
    Loading the Client certificate...
    Loading the Client Key...
    Performing the SSL/TLS handshake...
    Verifying peer X.509 certificate...
    it works
    >Connecting with TLS...
    Loading the CA root certificate...
    Loading the Client certificate...
    Loading the Client Key...
    ERROR: Failed! mbedtls_ssl_setup: Not enough memory
    ERROR: Unable to create socket
    Connecting with TLS...
    Loading the CA root certificate...
    Loading the Client certificate...
    Loading the Client Key...
    ERROR: Failed! mbedtls_ssl_setup: Not enough memory
    ERROR: Unable to create socket
    >Connecting with TLS...
    Loading the CA root certificate...
    Loading the Client certificate...
    Loading the Client Key...
    Performing the SSL/TLS handshake...
    ERROR: Failed! mbedtls_ssl_handshake returned -0x4290
    >Connecting with TLS...
    Loading the CA root certificate...
    Loading the Client certificate...
    Loading the Client Key...
    Performing the SSL/TLS handshake...
    ERROR: Failed! mbedtls_ssl_handshake returned -0x4290
    >process.memory();
    ={ "free": 3920, "usage": 1180, "total": 5100, "history": 1,
      "stackEndAddress": 536958120, "flash_start": 134217728, "flash_binary_end": 377416, "flash_code_start": 134234112, "flash_length": 393216 }
    >Connecting with TLS...
    Loading the CA root certificate...
    Loading the Client certificate...
    Loading the Client Key...
    Performing the SSL/TLS handshake...
    Verifying peer X.509 certificate...
    it works
    

    Is there something wrong with my code again?

    function onInit() {
      USB.setConsole(1);
      var lastTemp = "";
      var lastHumidity = "";
      var lastLight = "";
      var lastmeasure ="";
      
      I2C3.setup({sda:B4,scl:A8});
      var bh=require("BH1750").connect(I2C3);
    
      var dht = require("DHT11").connect(B5);
      
      clearInterval();
      
      setTimeout(function() {   
        Serial1.setup(115200, { rx: B7, tx : B6 });
        wifi = require("ESP8266WiFi_0v25").connect(Seri­al1, function(err) {  
          if (err) throw err;
          wifi.connect("xxx", "xxx", function(err) {
            if (err) throw err;
              LED2.set();
              setInterval(function() {
                dht.read(function (a) {
                  lastTemp = a.temp.toString();
                  lastHumidity = a.rh.toString();
                });
                bh.start(3,1);
                lastLight = Math.round(bh.read()).toString();
      
                var n=0,i=100;
                while (i--) n+=analogRead(A7);
                lastmeasure = (100-Math.round(n)).toString();
      
                setTimeout(function() {
                  sendForm(lastTemp, lastHumidity, lastLight, lastmeasure);
                }, 5000);
              }, 120000); // once every 2min
          });
        });
      }, 2000); 
    }
    
About

Avatar for countxerox @countxerox started