You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • It's still working without the println. It seems very stable...

    But yes, if I add the Bluetooth.println it prints a solid wall of text and starts locking up after a while. Even this does it:

    NRF.setScan(function(device) {
      Bluetooth.println(JSON.stringify(device)­);
    });
    

    but if I throttle it down enough, it doesn't do it:

    var n=0;
    NRF.setScan(function(device) {
      n++;
      if (n&15) return;
      Bluetooth.println(JSON.stringify(device)­);
    });
    

    When printing fast and connected by serial, I seem to be able to get out of memory errors as well - which will be due to all the advertising packets queuing up in memory and not being handled fast enough.

    Honestly, I'm not sure there's much I can do. Bluetooth LE can only transmit data so fast. If you're printing data faster than it can be output, something has to give.

    I'll file a bug for the subsequent crash and will try and sort that out - but even if that's fixed, your code isn't going to work with the print statements in it like that.

About

Avatar for Gordon @Gordon started