running ble on ESP-IDF release 3.0,

Posted on
  • My first test.
    Download the files from here: http://microcosm.app/out/DsGCh
    I threw the files on esp32 and started collecting my ruuvi tags.
    My ruuvi tags emit raw sensor data, so no connection is required.
    It all runs stable.
    Good work.

     
    WARNING: check error not implemented yet:0
    WARNING: Stop scan successfully
    WARNING: check error not implemented yet:0
    found devices:  7
    count: 14
       Sted  Rssi  Temp  Humi   Dewi  Bati
        Ude: -90  13.35  87.5  11.33  2971
    Drivhus: -77  16.98  73.5  12.23  2977
        Bad: -78  23.05  45.0  10.52  2977
       Stue: -85  23.15  47.5  11.42  2959
       test: -95  22.20  47.5  10.55  2947
      test1: -75  23.04  46.5  10.99  3181
     
    WARNING: check error not implemented yet:0
    WARNING: Stop scan successfully
    WARNING: check error not implemented yet:0
    found devices:  8
    count: 15
       Sted  Rssi  Temp  Humi   Dewi  Bati
        Ude: -86  13.33  87.0  11.22  2989
    Drivhus: -78  16.97  74.0  12.32  2983
        Bad: -79  23.05  45.0  10.52  2983
       Stue: -82  23.15  47.5  11.42  2947
       test: -89  22.20  47.5  10.55  2947
      test1: -72  23.03  46.5  10.99  3187
     
    WARNING: check error not implemented yet:0
    WARNING: Stop scan successfully
    WARNING: check error not implemented yet:0
    found devices:  7
    count: 16
       Sted  Rssi  Temp  Humi   Dewi  Bati
        Ude: -86  13.33  87.0  11.22  2989
    Drivhus: -74  16.96  74.0  12.31  2977
        Bad: -81  23.05  45.0  10.52  2983
       Stue: -83  23.15  47.5  11.42  2953
       test: -89  22.20  47.5  10.55  2947
      test1: -74  23.03  46.5  10.99  3181
    
    
  • Nice work @JumJum :)

  • @Frida

    Would you mind sharing your code so that we can add it to the tests?

  • I'm back again.
    Here is my test code.

    // esp32test_00
    
    var darray = {};
    var count = 0;
    
    
    function getDewpoint(temp, humi) {
    
      var C = {
        a1 : 8.1332,
        b1 : 1762.39,
        c1 : 235.66
      };
    
      PP = Math.pow(10,C.a1 - C.b1 / (this.temp + C.c1));
      this.dewp = -((C.b1 / (Math.log(this.humi * PP / 100) / Math.log(10) - C.a1)) + C.c1);
      return this.dewp.toFixed(2);
    }
    
    function bprint(dada, navn) {
      if(dada != 'undefined') {
        humi = dada.data[8] / 2;
        temp = dada.data[9] + dada.data[10] / 100;
        if(temp >128) {temp = 128 - temp;}
        bati = (dada.data[19] * 256 + dada.data[20]);
        dewi = getDewpoint(temp, humi);
        console.log(navn +
                    dada.rssi +
                    '  ' + temp.toFixed(2) +
                    '  ' + humi.toFixed(1) +
                    '  ' + dewi +
                    '  ' + bati);
      }
    }
    function cprint(didi) {
      console.log('count: ' + count++);
      console.log('   Sted  Rssi  Temp  Humi   Dewi  Bati');
      bprint(didi[0], '    Ude: ');
      bprint(didi[1], 'Drivhus: ');
      bprint(didi[2], '    Bad: ');
      bprint(didi[3], 'Udestue: ');
      bprint(didi[4], '   Stue: ');
      bprint(didi[5], '   test: ');
      bprint(didi[6], '  test1: ');
      console.log(' ');
    }
    
    
    function find() {
      NRF.findDevices(function(devices) {
        console.log('found devices: ', devices.length);
        for(i=0;i<devices.length;i++) {
    
          if(devices[i].id == 'ce:5c:55:08:22:5a') {
            darray[0] = devices[i];
          }
    
          if(devices[i].id == 'da:dc:f2:19:d4:e3') {
            darray[1] = devices[i];
          }
          if(devices[i].id == 'fa:2e:7b:6d:97:e0') {
            darray[2] = devices[i];
          }
    
          if(devices[i].id == 'fc:62:2d:b7:96:30') {
            darray[3] = devices[i];
          }
    
          if(devices[i].id == 'f9:1c:5f:be:b1:ec') {
            darray[4] = devices[i];
          }
    
          if(devices[i].id == 'c7:cf:a0:a7:86:d0') {
            darray[5] = devices[i];
          }
    
          if(devices[i].id == 'de:b4:9d:e1:39:08') {
            darray[6] = devices[i];
          }
        }
        cprint(darray);
      }, 5000);
    }
    
    find();
    setInterval(function () {
      find();
    }, 30000);
    
    
    
  • Thanks. The ble code has been added to master, so this will be part of the normal build now.

    Best to erase the flash as the partition table has changed. Sadly there is only 2500 vars now as ble consumes more precious memory. There is more space allocated for js code - 256k - so if you have set up to save code in flash there will be plenty of space for run time jsvars.

    Depending on demand, we might need a way of turning on and off ble. And if it off - allocate for space for js vars..

    Then there is the vroom with an extra 20,000k of ram - however the support in the ESP-idf 3.0 is not there yet.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

running ble on ESP-IDF release 3.0,

Posted by Avatar for Frida @Frida

Actions