This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

BLE sensor implementation questions

Hello All,

I'm developing a BLE sensor based on the nRF52832 which needs to do the following:

  • Use an (i)Beacon for the user to find the sensor with an App on a mobile phone within a 20 meter radius.
  • Provide the App the option to adjust certain parameters such as advertising interval, time-out etc for testing.
  • Have the option to use DFU to update the firmware of the device with a phone.

I already got DFU working and added a timeout to the bootloader, so it won't stay in the bootloader when a valid application is present. I've also found the beacon example and noticed that the example description said it can be converted to an iBeacon easily. So this should be straightforward. Adjusting the parameters for development is still something I'm not sure about. I could use the uart over BLE to adjust settings or create a service like the heartbeat sensor example, but I'm not familiar with the limitations or how difficult this would be to implement.

Another thing I'm curious about is how to solve is the power consumption. I could keep the device broadcasting as a beacon continously, but the required interval is quite high to give the mobile phone application a low response time. Is there an option to provide a signal to increase the interval? The idea I had is as following: The sensor advertises on a very low interval 5/10seconds to ocnserve power, but does not provide a beacon. When the user connects to the BLE sensor start a beacon with a high interval and a 1 minute timeout after which the sensor return to its low interval advertising.

Should I only activate the DFU service when the settings have been set to activate by the app, so DFU isn't advertised continously? I have created my own keys and rebuild the bootloader, but would it be wise to add an additionaly layer of security, so DFU can't be activated/accessed by anyone eventough they don't have the correct firmware zip file?

Would love to know what you think is the best solution and or suggestions.

  • Your beacon sensor is running as a GAP peripheral correct? Once the user (the GAP central) connects to your beacon it won't advertise anymore. Or do I misread your use case description here?

  • Hello Matt,

    My application is currently running a GAP peripheral equal to that of the buttonless DFU example. I've not included the beacon in my current project as I had some troubles copying the buttonless DFU example.

    My main problem is as following: Should I always have my beacon active on a low interval, as well as advertising an GAP peripheral for DFU and another service for configuring some application settings or should I only start the beacon after a connection has been made to the GAP peripheral or when the settings service receives a command to enable the beacon? What would be the best methode to implement the settings configuration?

    My applications purpose is to use an mobilephone app to locate the BLE device within a radius of 20 meter of the device. I'm not developing the phone App, that's done by another thrird party. In order to let the application feel responsive, I would like to have the option to increase the beacon advertising interval when the phone App signals it's looking for this particulair device.

  • Is there an option to provide a signal to increase the interval? The idea I had is as following: The sensor advertises on a very low interval 5/10seconds to ocnserve power, but does not provide a beacon. When the user connects to the BLE sensor start a beacon with a high interval and a 1 minute timeout after which the sensor return to its low interval advertising.

    What kind of signal? After you have connected? If you advertise with a big interval it could take some time before you are able to connect. Why would you event need to advertise beacon info after you have connected? I'm having trouble understanding, sorry.

  • There is only "one" advertising from the beacon (GAP peripheral), and when you connect (as GAP central) to the beacon then you can discover the services (DFU, service to reconfigure tx power, advertising window & interval, ... etc).

    should I only start the beacon after a connection has been made

    You cannot connect to the beacon if it is not "started"/advertising in the first place.

Related