Private BLE Beacons with nRF52840



  • Thanks to the thread Everything nRF52840 from NeverDie I found the courage to start a project for developing my own Beacons based on the Bluetooth Core Specification 5.2, Volume 6. The idea is also, to use broadcasts for providing sensor data to any interested listener in my home network. For this I defined a PDU with 12 measurement values of 16 bit and some additional management information. The result is a BLE advertising packet with the maximum payload of 31 bytes.

    My development environment is Eclipse/Sloeber (Eclipse C++ with an Arduino Plugin) and an Arduino Nano BLE 33. I do not use the mbed-OS nor the BLE library of the Nano board, but started to program the nRF52840 directly.

    The current hurdle is to receive data with the smartphone. I programmed a BLE-Scanner on Android and tested it with some bought Beacons by displaying the address, the rssi-value and the payload bytes (I hope, I can trust the getBytes-function of the accordingly subclass in ScanResult, because the data of the bought Beacons seem to be encrypted).
    But my Ardunino board is not seen.

    Does someone know, whether the BLE-Scanner of Android detects simple advertizing packets (not scannable and not connectable)?

    My next step will be to program a scanner with the Arduino board to prove, that my advertiser is running.


  • Mod

    For iOS, I use https://apps.apple.com/us/app/bluecap/id931219725
    It does not seem to be available for Android unfortunately but https://play.google.com/store/apps/details?id=uk.co.alt236.btlescan&hl=en&gl=US seems to offer similar functionality.



  • Hello @mfalkvidd ,
    thank you very much for the valuable link to the Android app, which I followed further to the sources on Github. It seems, that the author uses other vocabulary for the features of BLE than those described in the BLE specification (v 5.2), which makes it difficult for me to understand his program at once. The libraries I used are part of the IDE (Android Studio) and offer similar resources.

    I just started to develop a scanner based on my Beacon software for the Arduino Nano BLE 33. As soon as the radio data exchange between two Arduino boards is running, I will care again for the Android app.



  • I'm happy, finally I got it working. Not all, what I wanted, but at least I detected the limits.

    So for those, who are interested in direct programming the nRF52840 on the Arduino Nano BLE 33 (ask me if you have questions about that):

    My Scanner (on the Nano) runs perfect and detects all Advertisers around (a Beacon from EM Microelectronic, the default Advertiser of the Nordic nRF52840 DK and my own private Beacon on the second Nano).

    But ... my Android App does not detect my private Beacon. And now I can see the difference. The EM Beacon does scannable and and connectable advertising (pdu type ADV_IND) and the Nordic does scannable (pdu type SCAN_RSP). My own Beacon does non-connectable and non-scannable advertising (pdu type ADV_NONCONN_IND), which is obviously ignored by the Android BLE library (and I do not know, how to make that working or if it is possible at all).
    I tested several scanner Apps on Android and they behave the same way as my App. So it seems to be a fundamental problem and I will have to wait for an Android expert.


  • Banned

    Does it only work for Arduino nano? I have an Arduino UNO board and I don't know if I can achieve the same function.


  • Hardware Contributor

    @Ivanli said in Private BLE Beacons with nRF52840:

    Does it only work for Arduino nano? I have an Arduino UNO board and I don't know if I can achieve the same function.

    Only on Nano BLE 33 not on classic nano which has no Bluetooth connectivity 😉


Log in to reply
 

Suggested Topics

  • 5
  • 2
  • 6
  • 26
  • 13
  • 7
  • 2
  • 37

83
Online

10.3k
Users

10.7k
Topics

109.6k
Posts