Avatar for user111703

user111703

Member since Apr 2020 • Last active Apr 2020
  • 2 conversations
  • 12 comments

Most recent activity

  • in ESP32
    Avatar for user111703

    Of course , I delete new line chars, but more easy to fix it source code.

      **const reg= /\r\n/gi;
      pem=pem.replace(reg, '');
      var sr=atob(pem);**
    

    // var st="";
    // for (var prop in sr){st+=sr.charCodeAt(prop).toString(16)­+',';}
    // console.log(st);

      if(flash.writeFileSync("certificate.cer"­, sr)) {
        console.log('New sertificate data saved...');
    
  • in ESP32
    Avatar for user111703

    I see that problem is some symbols of line control that must be ignored by 'atob', but they decoded as 0x00 so that final decode is inccorrect.

  • in ESP32
    Avatar for user111703

    When use function atob ('base64_text') then result not matched to binary data. For example first bytes of TLS key is 0x30, 0x82, 0x03... is "MIID...", but Espruino decode this string start from 0x00.

  • in ESP32
    Avatar for user111703

    Additionally some troubles with events:

    1. wifi.on('sta_left' )- reacted on events when client leave AP point in mode STA+AP
    2. mqtt.on('disconnected') - after 7-8 hours of work loose events.
  • in ESP32
    Avatar for user111703

    Yea, but it is need install SDK for build firmware with this option. Actually I looking for easy way to fix it. Because if deploy SW what reason to use JS ?, native C or C++ and ASM is not problem for me. Now, JS sketch is finished just I was forget to test for TLS, because using free MQTT and HTTP servers. Could you share/send ,If you has bin file with extended heap settings?

  • in ESP32
    Avatar for user111703

    Ok, but now I use simple JS sketch that not call 'fs' or 'flash' .
    var pem='MIIDbzCCAlegAwIBAgIJQgAAEjteoAbPMA0­GCSqGSIb3DQEBCwUAMFQxGTAXBgNV'+
    'BAoMEEFPIEthc3BlcnNreSBMYWIxNzA1BgNVBAM­MLkthc3BlcnNreSBBbnRpLVZp'+
    'cnVzIFBlcnNvbmFsIFJvb3QgQ2VydGlmaWNhdGU­wHhcNMTkwNDIzMDg1NjQ3WhcN'+
    'MjEwNDIyMDg1NjQ3WjBoMQswCQYDVQQGEwJVUzE­TMBEGA1UECBMKQ2FsaWZvcm5p'+
    'YTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzETMBE­GA1UEChMKR29vZ2xlIExMQzEX'+
    'MBUGA1UEAxMOd3d3Lmdvb2dsZS5jb20wggEiMA0­GCSqGSIb3DQEBAQUAA4IBDwAw'+
    'ggEKAoIBAQCkFcSa7T6ZGdyKtisfgGxAI4ZpcHY­K4pw/NMWBqEzGvc4IHkw5S4cv'+
    '8UBHM3T77VmpCPJab6BZ2mJs9d6mc3VhZ6zKn0W­f8UlfpHE+zOeW1/Es7OegXAsa'+
    '13xrwpQ6oFu+EaOQBJpMtN0wRk8fzpAv3UZzq0i­QKrgfq5wPCk+1B22GkTU5sBjV'+
    'GTFjgT2l3iIs1C/K7zNgQfMoXlLULm3W7fn91ye­LF/kqwZhqx2G7KThmqn1iSLd6'+
    'ilu6WW0qLhEHOnPsB7DK1tmuSQv6/eahpKE6sL2­HRSZC2DdUla4I5jOfOiCwMTLB'+
    'b9bfSYDWNUN4DOfWZatMVp3yRfpWikGZAgMBAAG­jMDAuMAsGA1UdDwQEAwIFoDAf'+
    'BgNVHREEGDAWhwSs2RlEgg53d3cuZ29vZ2xlLmN­vbTANBgkqhkiG9w0BAQsFAAOC'+
    'AQEAFLxHgjDQhc7kOGMV/Zhy6ZBPdTY4o7nIQz/­WTVhN4Yq6cwZbDN7DD0GPMt0Q'+
    'BuQE+nAudU7pzQ9PnwBeaPgswpuETxK5dswsanw­PyU7g6v5+jIvwI9/LHqTojlCl'+
    'CeJxxDe3XQYUR0CN6/e+VdnWw1jYXCZ0QglvPsN­8I1Y+toXokLgIsMsZAGYVWZDm'+
    'QGV/V99wqZYCP17lIdt4ZjGvdX6ae6DoqwM/xoH­JVZc+eIsKYY9zULwS1ZEuOoG1'+
    '04vuFYfO8k+7lOt1nxFqPZHlEXNvenwLgP/DENn­BhY7jGxTJ5ANJpbpy4bOPVSNx'+
    'Vi00nQHpR7Dd30VPLcUpBHuagQ==';//+
    //'-----END CERTIFICATE-----';
    ////////////////////////////////////////­////////////////////////////////////
    setTimeout(function() {
    console.log(wifi.getDetails(),ESP32.getS­tate());
    var options=url.parse("https://www.google.com", true);
    options.cert=atob(pem);
    require("http").get(options, function(res) {

    res.on('data', function(data) { console.log(data); });
    

    });
    console.log(ESP32.getState());
    }, 5000);

  • in ESP32
    Avatar for user111703

    Sorry,I cant build, but any way in my final sketch I use file system for upload PEM certificate using HTML5 on web page for user.

  • in ESP32
    Avatar for user111703

    Not fix and Heap less then before BLE was enable.

Actions