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

Setting up broadcast packages ble4.2

Hello,

For my project I want to use broadcast packages to send data to multiple devices at the same time.

I've seen that there is a beacon application that "should" broadcast but I've noticed that it just sends out advertisement packages with manufacture specific data in it.

This isn't really helpful because not all devices scan at the exact same moment so the chance of missing a package is quite large.

Furthermore I saw that when setting up a characteristic, you can change the property to broadcast, char_md.char_props.broadcast   = 1;

But what does this do? Do I set the data in att_char_value.p_value? Can this be variable data or is it static?

My goal is to have a piconet of one central and multiple servers, the central should broadcast a specific package to all devices simultaneous.

If anyone can help me with this I can appreciate it a lot.

Kind regards,

T IJ

Parents
  • I've seen that there is a beacon application that "should" broadcast but I've noticed that it just sends out advertisement packages with manufacture specific data in it.

     You can easily change what's inside the advertisement package. Check out the BLE Advertising Tutorial to get a better understanding.

     

    This isn't really helpful because not all devices scan at the exact same moment so the chance of missing a package is quite large.

    Even though the devices don't scan at the same time, they can still see the broadcasting. This is because the beacon device will send several advertising packets. You can change the number of packets sent in a given period, by changing the advertising interval.

     

    Furthermore I saw that when setting up a characteristic, you can change the property to broadcast, char_md.char_props.broadcast   = 1;

     If you are only going to broadcast data using a beacon, you don't need to use char_md and its underlying structures, since it will define a characteristics metadata. For broadcasting/advertising, you don't need to set up characteristics, since they are only used once a connection is set up.

    But what does this do? Do I set the data in att_char_value.p_value? Can this be variable data or is it static?

     Same as the answer above, you don't need to use this since it only concerns characteristics.

    My goal is to have a piconet of one central and multiple servers, the central should broadcast a specific package to all devices simultaneous.

    I assume you mean one broadcaster and multiple observers? Learn the difference between these roles in this thread. But to answer your question, I would recommend you to go through the following tutorials (which will help you understand how to set up one broadcaster that broadcast to multiple observers simultaneously):

    Best regards,

    Simon

  • Hey Simon,

    Even though the devices don't scan at the same time, they can still see the broadcasting. This is because the beacon device will send several advertising packets. You can change the number of packets sent in a given period, by changing the advertising interval.

    I always thought broadcasting was done at channel 0.

    I have tested the beacon app and configured multiple servers to listen to advertisement packages with a specific uuid, upon match I blink a LED.

    The problem that I face is that not all LEDs blink at the same moment, I believe from the 6 devices I got a maximum of two LEDs blinking simultaneous.

    In the end I want to have my beacon transmit a special package every 1, 2 or 3 seconds or so but all devices must receive this package.

Reply
  • Hey Simon,

    Even though the devices don't scan at the same time, they can still see the broadcasting. This is because the beacon device will send several advertising packets. You can change the number of packets sent in a given period, by changing the advertising interval.

    I always thought broadcasting was done at channel 0.

    I have tested the beacon app and configured multiple servers to listen to advertisement packages with a specific uuid, upon match I blink a LED.

    The problem that I face is that not all LEDs blink at the same moment, I believe from the 6 devices I got a maximum of two LEDs blinking simultaneous.

    In the end I want to have my beacon transmit a special package every 1, 2 or 3 seconds or so but all devices must receive this package.

Children
  • T IJ said:
    I always thought broadcasting was done at channel 0.

     Advertising is done on the advertising channels (37, 38 & 39). Read more about it here.

     

    T IJ said:

    The problem that I face is that not all LEDs blink at the same moment, I believe from the 6 devices I got a maximum of two LEDs blinking simultaneous.

    In the end I want to have my beacon transmit a special package every 1, 2 or 3 seconds or so but all devices must receive this package.

    Try to set scan interval equal to scan window in the observers, which will make the devices scan all the time, and catch all the advertising packets. Read more in this ticket.

    Best regards,

    Simon

Related