You are reading a single comment by @Nic and its replies. Click here to read the full conversation.
  • Hi,

    I'm trying to use a collection of pucks as both iBeacons and to report sensor information. I use them to automate lights, heating and track our position in the house. My implementation is rather hacky at the moment. I'm trying to refactor the code but I'm struggling to utilise setAdvertising as shown in the examples across the documentation.

    In the two examples shown below I'm led to believe I can send both iBeacon and sensor readouts in sequential packets.

    NRF.setAdvertising([
      {0x180F : [Puck.getBatteryPercentage()]}, // normal advertising, with battery %
      require("ble_ibeacon").get(...), // iBeacon
      require("ble_eddystone").get(...), // eddystone
    ],{interval:500});
    
    NRF.setAdvertising([
      require("ble_ibeacon").get(...),
      require("ble_eddystone").get(...),
      {} // this will add a 'normal' advertising packet showing name/etc  
      ], {interval:100});
    

    I'm using Noble on a RPi to pick up the broadcasts and the reason I post both examples is because the first does not work for me at all. If any packet exists before the iBeacon package then I don't seem to pick anything up.

    I have more success with the second example code but Noble only seems to pick up the iBeacon broadcast and not the temperature. If I drop the iBeacon require then the temperature broadcast is picked up as expected.

    The actual code I want to run is a little more involved, and didn't work, which led me to use the basic examples exactly as shown above just to make sure I was on the right track, but I can't get them to work. To be clear I've limited the code to exactly the code above and am having no success.

    Am I missing something? Really I'm looking for reassurance that something isn't broken at a deeper level than I can fix/understand. If it's my setup then I can investigate further but fear at this stage I might be wasting my time.

    Deeply greatful to anyone who replies or has any ideas of something I can try.

    Thanks,

    Nic

About

Avatar for Nic @Nic started