Getting manufacturerData from custom uuid device

Posted on
  • Hello Everyone!!

    I have been trying to get advertisement data from a custom ble device(with nRF52832 chip) that has been advertising ambient pressure every 5 minutes.

    When I use the below code snippet ,

    // Start scanning
    packets=10;
    NRF.setScan(function(d) {
      packets--;
      if (packets<=0)
        NRF.setScan(); // stop scanning
      else
        console.log(d); // print packet info
    });
    
    I could get the following
    
    BluetoothDevice: {
      "id": "90:6d:0f:4b:89:b4 public",
      "rssi": -76,
      "data": new Uint8Array([x, x, x, xx, x, x, x, x, x, x, xxx, xxx, xx, xxx, xxx, xx, xxx, x, xx, xxx, xx, x, x, xx, xx, xx, xx, xx, xx, xx, xx]).buffer,
      "shortName": "xxxxxxxx",
      "services": [
        "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
       ]
     }
    

    But I could not get the manufacturerData that has been advertised, which can be seen in "nRF Connect" mobile application.

    Simply I could not get the manufacturerData of 30 bytes, which is again shown in Raw data: part in mobile app.

    Any help is greatly appreciated

    Thanks in advance!!

  • What version of the Espruino firmware do you have? Manufacturer Data decoding got added ~6 months ago I think, so if you had an older version it wouldn't have been included.

    Just FYI but I'd consider using NRF.findDevices(print) for what you're doing too, as it aggregates multiple advertising packets.

  • @Gordon Thanks again for the quick reply there!!

    I'm using ESPRUINO version - v201

    please refer the attachment.

    There is another scenario where I could get manufacturer data from a ruuvi tag.

    But not this device alone.


    1 Attachment

    • Screenshot 2019-02-18 at 6.58.15 PM.png
  • That firmware should be fine. Since you blanked out the data array I can't see if the manufacturer data was actually in the advertising packet or not, but I'd be pretty sure it isn't if it's not being decoded.

    Which just leaves whether the data is the the 'scan response' packet - which would require an 'active' scan. That's something that you'd need a 'cutting edge' build for, and then I think NRF.findDevices(print, {active:true}) should do it.

  • @Gordon, I'm pretty sure that the manufacturer data is not in the packet since, I could not find the byte '0xff' that indicates the manufacturerData.

    Gordon by the way , you are right. It is an active scan. I have been searching on doing an active scan using ESPRUINO

    Let me try what you have suggested.

    Thanks Again!!

  • @Gordon, it still gives the same result.

    I could not see a data value that starts with "manufacturerData"

    I'm using the below code snippet.

    setInterval(function (devices) {
    console.log(NRF.findDevices(print, {active:true}));
    }, 5000);
    

    Please advise , what am I missing

  • Perhaps the device you're using to scan isn't in the beacon's whitelist? Sounds like that can cause issues sometimes - but I'm not sure what else to suggest.

    If this were an official board I could spend a bit more time helping you out - but I can't afford to spent time on support for non-official boards.

    Maybe someone else will be able to suggest something?

  • @Gordon, I'm using Taiyo Yudens ble 5 evaluation board with nRF52832 chip.

    Please refer me a link for whitelist.

    Thanks for your valuable time on this!!

  • @Gordon!!

    Thanks for your inputs. I have successfully implemented a back to back scan to get this done!!

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

Getting manufacturerData from custom uuid device

Posted by Avatar for rln22 @rln22

Actions