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

iBeacon emulator without SDK

Hi,
I am trying to make the iBeacon emulator using nRF52840-DK without SDK. I have found the iBeacon packet format.

When I send this packet using SDK, that worked. Now I want to change the MAC address to emulate hundreds of beacons, so I used NRF_RADIO to send the packet and change the channels. But I have no way to change the MAC address, and found the following packet format.

I can guess that the red area is MAC and the blue is iBeacon packet, but what is the green area?
Also what I have to do the more to emulate hundreds of iBeacons using NRF_RADIO without SDK?
I got started with this example.

Parents
  • Hi

    The green area is the HCI header, and you can find the full description at page 2382 of the Bluetooth 5.2 specification (Vol 4, Part E, Section 7.7.65.2). 

    0x04 marks this as an HCI event.
    0x3E is the event code shared by all LE events. 
    0x2A is the length of the packet
    0x02 marks this as an advertising report event
    0x01 is the number of responses in the event
    0x00 means it is a connectable and scannable undirected advertising packet (ADV_IND)
    0x01 mean the device is using a random device address

    And the final 0xB4 at the end of the packet is the RSSI value. 

    While you can use one device to simulate multiple beacons, one thing this will not allow you to simulate is how real beacons will have independent timing, and will at times get into timing conflicts where two or more beacons send data at the same time. 

    In order to simulate this behavior you need to use multiple beacon emulators, but at a minimum you can use this method to simulate more beacons than you would otherwise be able to. 

    While we don't have an official example showing how to implement a beacon from scratch, I would suggest having a look at hal_radio.c from the solar panel beacon example on Github:
    https://github.com/NordicPlayground/solar_sensor_beacon/blob/master/src/hal_radio.c#L89

    The function l linked to will set up the radio to be compatible with BLE, including the access address used for Bluetooth advertise packets. 

    Best regards
    Torbjørn

Reply
  • Hi

    The green area is the HCI header, and you can find the full description at page 2382 of the Bluetooth 5.2 specification (Vol 4, Part E, Section 7.7.65.2). 

    0x04 marks this as an HCI event.
    0x3E is the event code shared by all LE events. 
    0x2A is the length of the packet
    0x02 marks this as an advertising report event
    0x01 is the number of responses in the event
    0x00 means it is a connectable and scannable undirected advertising packet (ADV_IND)
    0x01 mean the device is using a random device address

    And the final 0xB4 at the end of the packet is the RSSI value. 

    While you can use one device to simulate multiple beacons, one thing this will not allow you to simulate is how real beacons will have independent timing, and will at times get into timing conflicts where two or more beacons send data at the same time. 

    In order to simulate this behavior you need to use multiple beacon emulators, but at a minimum you can use this method to simulate more beacons than you would otherwise be able to. 

    While we don't have an official example showing how to implement a beacon from scratch, I would suggest having a look at hal_radio.c from the solar panel beacon example on Github:
    https://github.com/NordicPlayground/solar_sensor_beacon/blob/master/src/hal_radio.c#L89

    The function l linked to will set up the radio to be compatible with BLE, including the access address used for Bluetooth advertise packets. 

    Best regards
    Torbjørn

Children
Related