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

Parents
  • 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.

Reply
  • 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.

Children
  • 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

  • I make progess and it starts to make fun for me :) I've used ble_broadcast example, in "case ACI_DEVICE_STANDBY" i've added "lib_aci_open_adv" with the correct pipe, before it comes to "lib_aci_broadcast". After "lib_aci_broadcast" i've added "lib_aci_set_local_data" with the right expressions. When the program runs, Serial Monitor shows startup message and a few other messages, but after "Broadcastint started", there comes the ACI Command 1C, Evt cmd response: Error, Arduino is in a while(1) loop.

    It compiles without an error. What is wrong?

Related