Avatar for user111703


Member since Apr 2020 • Last active Jul 2020
  • 3 conversations

Most recent activity

  • in ESP32
    Avatar for user111703

    Just try to set NTP server by command
    wifi. setSNTP('us.pool.ntp.org', '0')
    As result MCU drop all time intervals in tasks to zero and program stay in loop.
    name of server or change time zone value is not significant, result always same.

  • 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' .
    //'-----END CERTIFICATE-----';
    setTimeout(function() {
    var options=url.parse("https://www.google.com", true);
    require("http").get(options, function(res) {

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

    }, 5000);