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

Sending and receiving beacons on demand.

Our device using nRF52840 is running an external (non-BT) radio most of the time. We need to send and receive data In between operations of this other radio.  At any given time, there will be one sender and multiple receivers.  Since there will be no BLE connection or interaction, this is essentially a beacon operation except for the scheduling.  We are trying to understand if it is possible to manually send and receive without running a BLE schedule and without any interaction between sender and receiver.  

We are assuming/hoping this will be possible using L2CAP functions instead of GAP/GATT functions and never starting any GATT scheduling.  However the L2CAP message sequence charts in SD140 v7.0.1 all show two-way communication.

Please clarify how the scheme described here can be accomplished.

The overall schedule will be something like

Receive-only devices:

  1. Receive other radio
  2. Receive BLE (20-40ms interval)
  3. (repeat steps 1 & 2 indefinitely)

Receive/Transmit devices:

  1. Receive other radio
  2. Receive BLE (20-40ms interval)
  3. (repeat steps 1 & 2 N times)
  4. Transmit other radio
  5. Transmit BLE
  6. (repeat steps 1 - 5 indefinitely)
  • Hello,

    What size is the data that you are looking to broadcast on the BLE transmit?
    As you said, the beacon functionality might be useful for your application.
    Beacons broadcast their data as part of the Manufacturer Specific Data field of their advertising packages.
    Have you seen the BLE Beacon example? If you are not familiar with advertising in BLE, I suggest reading this short tutorial.
    The main things for you to note here is the limited size of advertising packets, and that you may change your advertising interval period, to configure how often the transmits happen.

    Since I do not know what other radio protocol you are using, I assume that you know you have sufficient time to switch between BLE and the other radio.

    We are assuming/hoping this will be possible using L2CAP functions instead of GAP/GATT functions and never starting any GATT scheduling.  However the L2CAP message sequence charts in SD140 v7.0.1 all show two-way communication.

    Is this only because you want to have a non-connectable, broadcasting device?
    If you, I think the beacon functionality might be what you are looking for.

    Please have a look at the BLE Beacon & Advertising tutorial, and get back to me with how you think this might fit with your application.

    Best regards,
    Karl

     

  • What size is the data that you are looking to broadcast on the BLE transmit?

    small, likely 2-3 bytes.

    Since I do not know what other radio protocol you are using, I assume that you know you have sufficient time to switch between BLE and the other radio

    We have a 20ms window to switch, transmit, switch back.  The receivers will be listening for as much of that 20ms as they can.  My calculations say this is enough.

    Have you seen the BLE Beacon example? If you are not familiar with advertising in BLE, I suggest reading this short tutorial.

    I have not, I have used nRF parts & SD in classical peripheral devices but learning about beacons now.  I will read both of these and reply here if I have any questions.

    Is this only because you want to have a non-connectable, broadcasting device?

    Correct.

    thank you

  • Based on your replies I think you will find the BLE Beacon example very helpful.
    Please also see the short tutorial I linked, as it details how you can easily set up the broadcasting/beacon in the manufacturer specific data field of the advertisement packets.

    ilnadi said:
    thank you

    No problem at all, I am happy to help!
    Let me know if you should encounter any issues or questions moving forward.

    Best of luck with you development!

    Best regards,
    Karl

  • Please also see the short tutorial I linked, as it details how you can easily set up the broadcasting/beacon in the manufacturer specific data field of the advertisement packets.

    I have read the tutorial and run the example and they are both based on GAP/GATT-based scheduling (i.e. they use sd_ble_gap_adv_start() ). 

    I need to be able to send the beacon on my own schedule

    • fortunately the main schedule is divisible by 625usec. 
    • unfortunately the beacon must fall in a specific 20ms window.  Is there a way to make the advertising scheduled synchronized or start i at a particular time?
    • unfortunately the customer has additional requirements for repeating the information asynchronously based on criteria outside BLE considerations.

    All of this leads me to think we need to go back to L2CAP so we can

    • on the sender "send this packet now" (see message flow)
    • on the receiver "turn on receiver" then after the window is over, "turn off receiver" (see message flow)

    Are there any examples of L2CAP usage?  The only thing I can fidn related to L2CAP in the SDK (15.3.0) is related to serialization.

  • Hello,

    I understand.
    This is demonstrated in the Solar Beacon example. Note how the sensor_handler is called at an interval, every time a reading is to be done and thereafter transferred, the rest of the time the device consumes very little power.
    To make sure that the intervals are synchronized with your other device, could you for example use a GPIO interrupt? Would that be feasible?

    ilnadi said:
    unfortunately the beacon must fall in a specific 20ms window.  Is there a way to make the advertising scheduled synchronized or start i at a particular time?

    Yes, this is possible. See the Solar Beacon example I linked above for an example on how to do this.

    ilnadi said:
    unfortunately the customer has additional requirements for repeating the information asynchronously based on criteria outside BLE considerations.

    I am not sure I understood what you meant here. Is the intervals for transmission changing? If so, the GPIO interrupt might solve this as well.

    I would recommend using the Beacon examples as a basis for your application, instead of going the route with L2CAP.

    Looking forward to solving this issue together!

    Best regards,
    Karl

Related