This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Newbie Smart Beacon Battery Level Question

Hi All,

Complete newbie here... Essentially I'd like to modify the nRF51822 smart beacon kit to also advertise it's battery level. From this link it certainly seems possible:

devzone.nordicsemi.com/.../

Some more digging around turned up this code which should do the trick:

github.com/.../nrf51-ble-app-temp

So am I right in assuming the following newbie procedure:

  1. Download and install the nRF51 SDK (and documentation) from here: developer.nordicsemi.com/.../ developer.nordicsemi.com/.../

  2. Download and install the latest SoftDevice (seems to be needed for compilation but not sure exactly why in this case?)

  3. Clone the git code I referenced above (though the README doesn't include the smart beacon on the list of supported devices...)

  4. Download and install the Keil MDK-ARMv5 from here: www.keil.com/.../

  5. Use Keil to compile the github code

  6. Grab the resulting .hex file and upload it using the android nRF Toolbox app to the beacon

  7. Grab the new readings... the code seems to put them in the "service_data" part of the beacon... I guess I can use other examples to instead fit this in the manufacturer data?

Thanks for your time and patience!

  • If you want to use the code as is, you can just use ble_app_temp.hex in the /arm/_build folder.

    You may want to figure out what SoftDevice that is on the kit. Check the chip version printed on the nRF51822 chip. If it is CEAADx the chip is an older version with SoftDevice 6.0.0. (Edit 12.05.2015, a few kits actually have CEAADx and SoftDevice 7.1.0) If it is CEAAEx or CFACAx it is a new version with SoftDevice 7.1.0.

    SoftDevice 6.0.0 doesn't support DFU of the SoftDevice, and is compatible with SDK 5.2.0. And SDK 5.1.0 used to developed your GitHub example.

    SoftDevice 7.1.0 supports DFU of the SoftDevice, and is compatible with SDK 7.2.0.

    If you have SoftDevice 6.0.0 and you want to modify the example you need to:

    1. Download SDK 5.2.0

    2. Clone or download the git code to the appropriate folder in the SDK.

    3. Download Keil

    4. Modify and compile

    5. Grab the resulting .hex file and upload it using the android nRF Toolbox app to the beacon

      Grab the new readings... the code seems to put them in the "service_data" part of the beacon... I guess I can use other examples to instead fit this in the manufacturer data?

    Yes. you can.

  • Thanks Petter!!

    It's unfortunately not working for me yet. I tried uploading the precomiled hex file by pressing SW1, getting the blue LED, and using the DFU section of the nRF Beacon app. It just gives "remote invalid DFU state".

    So I tried to compile it with Keil...I have the CEAADx chip, meaning I need SDK v5.2.0. Downloaded that, got Keil installed, and successfully compiled the github code using the Keil target of "nrf51822_xxaa_s110". I then got the resulting .hex file and again tried using the nRF beacon app (I tapped "no" when asked for a .dat file), but again it failed at the 2% upload mark with "remote DFU invalid state"

    Any ideas what i'm doing wrong?

    Thank you :)

  • I investigated some more, and it seems a few kits with CEAADx actually has SoftDevice 7.1.0. I did a test and you will get the remote DFU invalid state if you try to do DFU on SoftDevice 7.1.0 without using the init packet(.dat file) This means you should create your applications with SDK 7.2.0. If you want to use the example I think you need to port it to SDK 7.2.0. I'm sorry for giving you incorrect information. Please don't hesitate to add a new question if you are having trouble porting the example.

Related