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

How to send data while advertising with RedBear Blend/nRF8001

Hey ho, I'm new to BLE and Nordic. I'm a student from Germany and i want to realize one simple function with Arduino (RedBear Blend with nRF8001) and Android.

I want my Arduino to work like a beacon (i don't want to pair my Arduino with smartphone) and in addition while advertising send data (just one string which can be changed within Arduino program).

So it should work like this: Beacon sends continuously "hey, I'm here" with an string to my smartphone. If the smartphone is in range from the beacon and the smartphone app is working, the smartphone app should show me "hey, I'm here" with the string.

Is this possible with RedBear Blend / nRF8001 ? Or should I buy a nRF51288 ?

Can someone tell me what i have to write/change in the Arduino sketch that this is working?

Thanks a lot in advance and i apologize for my bad english skills.

Dennis

  • There's a example in the nRF8001 Arduino SDK named "ble_broadcast" that will do exactly this. Doenload the SDK from here and have a look.

  • Thank you for your answer Asbjørn, i have this library already installed, i took a quick look through the sketch "ble_broadcast" but i have no idea what is all the code for. If i load that sketch to my board, i can't find it anymore from smartphone. I want to broadcast the current GPS position of my GPS Shield as (let's call it) "service data", while my nRF8001 is working as a beacon.

    Which part do i have to change? Sorry, but there is so much for me to learn.

    EDIT: maybe you can tell me where i can read more about what i want to do, that i understand more of broadcasting information in beacon-mode.


    EDIT: Now i'm on the right way. My BLE_broadcast.ino is working without an error, but i can't find it at all as an BLE Device. Both Smartphones (Galaxy S3 with 4.3 and iPhone 6 with iOS8.1) don't see the BLE Device. What do i have to do that my device is broadcasting it's name ? Do i need a further pipe for this?

  • test_lib_aci_broadcast.xmlThis is possible, the ble_broadcast is a simple application to only broadcast the name and change the name as the device is advertising. Set the Characteristic that you want to broadcast with the "broadcast" property. I have attached sample nRFgo studio XML file.

    Once the nRF8001 sends the ACI Device Started Standby event, you can use the ACI OpenAdvPipe command on the broadcast pipe.

    The functions to use the ACI commands are present in the lib_aci.h ( lib_aci_open_adv_pipes , lib_aci_set_local_data )

    Then start advertising using the ACI broadcast command.

    You can update the data in the Pipe by using the ACI Set Local Data command.

  • Thanks again for your great answer. I used your xml file to create that pipe in the "ble_broadcast.xml" and it compiles without an error. Know it comes to the tricky part, i want to edit the "ble_broadcast.ino" but i don't know where i can find ACI OpenAdvPipe (i think this is bool whether it is open or not?) and where i can find ACI broadcast command & ACI Set Local Data comman. As i said, i'm a newbie to all this stuff. Never had such a great help from a company. i really enjoy it!

    Maybe you can provide me a link where i can read of all the functions i can use to create my own application. I took a look at devzone.nordicsemi.com/.../ and that helped me to understand how everything is working together. Do you have more webinars like this?

  • Edited my answer to add the references to the lib_aci.h and the function interfaces for the AdvOpen and SetLocalData

Related