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

Nordic nrf51822 beacon kit modify beacon properties not working

I'm trying to modify the beacon properties of the nrf Beacon in the nRF Beacon APP but it doesn't allow me to change those properties. If I use the Beacon scanner the device seems to not be connectable and i cannot see any service or characteristics that could be browsed. Is this supposed to be so with the nrf51822 beacon kit ? How can I enable connectable and browsable characteristics ? I'm using the version 1.1.1 firmware. I even tried to update the firmware using the hex app file in bundle with the firmware files, but nothing changed.

  • Hi Claudio

    Beacon firmware 1.1.1

    There is a MAGIC_FLASH_BYTE which is used to identify if the flash has been written with configuration data. This is checked in main before setting any config. The value of MAGIC_FLASH_BYTE is 0x42 (66). To change advertising parameters you need to erase the flash memory, which can be done with:

    1. Erase, the flash contents (press “Erase All” button in nRFgo Studio, or use command “nrfjprog –eraseall”),
    2. Program softdevice (in nRFgo studio: select the “Program Softdevice” tab, browse for softdevice 7.1.0 and program it to the beacon kit, see also devzone.nordicsemi.com/.../ ) ( in nrfjprog: nrfjprog –program s110_nrf51822_7.1.0_softdevice.hex)
    3. Program the beacon application (nrfgo Studio: . select the “Program Application” tab, browse for the beacon application and program it to the beacon kit) (in nrfjprog: nrfjprog –program nrf51822_beacon_app.hex)

    Beacon flash contents can also be erased directly with:

    Nrfjprog –erasepage 0x0003F800
    

    This way, the default parameters will be used in beacon.h file. If you do not erase flash, the parameters first set in flash will always be used.

    The major and minor values set in beacon.h are not advertised. Rather, the device address is set as the major and minor value. You need to comment out the following code in the beacon_params_default_set function in main.c in order to advertise APP_DEFAULT_MAJOR_VALUE and APP_DEFAULT_MINOR_VALUE set in the beacon.h file:

    beacon_data[BEACON_MANUF_DAT_MINOR_L_IDX] = (uint8_t)(NRF_FICR->DEVICEADDR[0] & 0xFFUL);
    beacon_data[BEACON_MANUF_DAT_MINOR_H_IDX] = (uint8_t)((NRF_FICR->DEVICEADDR[0] >>  8) & 0xFFUL);
    beacon_data[BEACON_MANUF_DAT_MAJOR_L_IDX] = (uint8_t)((NRF_FICR->DEVICEADDR[0] >> 16) & 0xFFUL);
    beacon_data[BEACON_MANUF_DAT_MAJOR_H_IDX] = (uint8_t)((NRF_FICR->DEVICEADDR[0] >> 24) & 0xFFUL);
    

    I suspect the major and minor values are set to the device address so that they will be different on each device.


    Update beacon parameters from the IOS Beacon app

    • Manufacturer ID (company identifier) must be 76 (0x004C) in order for the app to see it in the beacon tab. You must therefore set the Manufacturer ID in the beacon firmware as described above.
    • Make the beacon connectable by pressing the SW2 button on the Beacon kit.

    The beacon packet structure is shown on the following image: Beacon packet contents.pdf

    Before detecting a beacon you must add it by pressing the + in the upper right corner. This will give you selection of adding Nordic beacon or a proprietary beacon.

    Nordic Beacon: Here you must put the beacon in connectable mode (by pressing SW2 button on the beacon kit), connect to it from the app in order to read the beacon parameters from the beacon device. Now you have all the correct beacon parameters and the beacon can now be detected. You can now select the update tab in the app, connect to the beacon, and modify he major and minor values of the beacon.

    Proprietary beacon: Here you must manually insert the beacon parameters, i.e. the UUID, the Major and minor values. Then you can detect the beacon. This is convenient when you want to detect non-connectable beacon.

Related