🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    [M5Stack] BLE Beacon RSSI 0

    SOFTWARE
    1
    1
    3.3k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P
      peperone92
      last edited by

      Hi,
      I have a platform.io project in which I'm trying to setup an iBeacon and it seems to work except the RSSI is 0.

      Using different scanner applications I can see the generated iBeacon (right UUID, major, and minor) but like I mentioned the RSSI is always 0.
      I would appreciate any (general) pointers as to what could be the root cause. Also, if anyone has or knows of a working example I could use that.

      Note that I also tried to use the NimBLE library with the same issue.

      The relevant part of the code:

      #include <BLEDevice.h>
      #include <BLEServer.h>
      #include <BLEBeacon.h>
      #include <Ticker.h>
      
      bool is_advertising;
      Ticker switchAdertising;
      BLEAdvertising *pAdvertising;
      
      void setup_beacon()
      {
        BLEDevice::init("BleBrain");
        BLEServer *pServer = BLEDevice::createServer();
      
        BLEBeacon myBeacon = BLEBeacon();
        myBeacon.setManufacturerId(0x4C00);
        myBeacon.setMajor(beacon.major);
        myBeacon.setMinor(beacon.minor);
        BLEUUID bleUUID = BLEUUID(IBEACON_UUID);
        bleUUID = bleUUID.to128();
        myBeacon.setProximityUUID(BLEUUID(bleUUID.getNative()->uuid.uuid128, 16, true));
        myBeacon.setSignalPower(0xc5);
      
        BLEAdvertisementData advertisementData;
        advertisementData.setFlags(0x1A);
        advertisementData.setManufacturerData(myBeacon.getData());
      
        pAdvertising = pServer->getAdvertising();
        pAdvertising->setAdvertisementData(advertisementData);
        pAdvertising->start();
        is_advertising = true;
      };
      
      void advertising_switch()
      {
        if (is_advertising)
        {
          pAdvertising->stop();
        }  else {
          pAdvertising->start();
        }
      };
      
      1 Reply Last reply Reply Quote 0
      • First post
        Last post