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

Send a packet with RedBearLab Blend Micro and nRF8001 using BLE advertising

Dear comrades, I am trying to advertise a simple packet with the nRF8001 embedded in the RedBearLab Blend Micro board using it as a beacon.

I am using the ble_broadcast example and generating the services.h file with nRFgo Studio. The packet that I am trying to send is:

0x0201040AFF59000005FFF703FB56

As you can see, there is only the Flags and the Manufacturer Specific Data fields with its values. The problem is, when I compile ble_broadcast example with my generated services.h and upload it to the board, the board is not advertising anything.

I use the nRF connect Android App to check if it is actually sending data, but it is not. But when I upload the BLEControllerSketch example in the RBL_nrf8001 library, then it actually advertises data. If then I try to configure that packet with my services.h file, then stops advertising again.

My guess is that I am configuring the services.h file wrongly. Can someone please explain me how to do it correctly. I would be very gratefull.

Thanks!

AGB

  • Can you use the ble_broadcast example in the ble_sdk_arduino for the nRF8001. This ACI broadcast command is used to send the broadcast the message.

  • According to the nRF connect app, the ble_broadcast example sends this:

    • 0x01 (Flags) 0x06
    • 0x09 (Complete Local Name) 0x426C656E644D6963726F
    • 0X07 (Complete List of 128-bit Service Class UUIDs)1E948DF1483194BA754C3E5000003D71
    • 0x09 (Complete Local Name) 0x426C656E644D6963726F

    It doesn't matter if I change the services.h file, it always sends that. I would like to send this:

    • 0x01 (Flags) 0x06
    • 0xFF (Manufacturer Specific Data) 0x59000005FFF703FB56

    Because is what the nRF52832 chip that I have in the application that I want to mimic is sending. but I have read somewhere that it is not possible to change the setup data while advertising, so I just want someway to send the data (59000005FFF703FB56).

  • Ok. Edit the XML file using nRFgo studio in GAP Setting ->  ACI broadcast 

    Switch off the local name (do not advertise) , local services in the check boxes and anything else that is checked on.

    Check on "Custom 1"

    On the left side of the page under "Custom advertisement types" put 0xFF for Manufacturer specific data and the 0x59000005FFF703FB56 that you want. 

    I have a sample attached for you to take a look.

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE AttributeServer>
    <Profile Version="1.3">
        <SetupId>0</SetupId>
        <Device>nRF8001_Dx</Device>
        <Gapsettings>
            <Name>bcast</Name>
            <DeviceNameWriteLength>11</DeviceNameWriteLength>
            <LocalPipeOnDeviceName>true</LocalPipeOnDeviceName>
            <DeviceNameShortLength>1</DeviceNameShortLength>
            <Apperance>0000</Apperance>
            <SecurityLevel>0</SecurityLevel>
            <AuthenticationReq>0</AuthenticationReq>
            <IoCapabilities>0</IoCapabilities>
            <BondTimeout>600</BondTimeout>
            <SecurityRequestDelay>5</SecurityRequestDelay>
            <MinimumKeySize>7</MinimumKeySize>
            <MaximumKeySize>16</MaximumKeySize>
            <AdvertisingDataBondedBitmap>0</AdvertisingDataBondedBitmap>
            <AdvertisingDataGeneralBitmap>0</AdvertisingDataGeneralBitmap>
            <AdvertisingDataBrodcastBitmap>0</AdvertisingDataBrodcastBitmap>
            <AdvertisingDataBondedScanResponseBitmap>0</AdvertisingDataBondedScanResponseBitmap>
            <AdvertisingDataGeneralScanResponseBitmap>0</AdvertisingDataGeneralScanResponseBitmap>
            <AdvertisingDataBrodcastScanResponseBitmap>0</AdvertisingDataBrodcastScanResponseBitmap>
            <AdvertisingDataBondedBitmapCustom>0</AdvertisingDataBondedBitmapCustom>
            <AdvertisingDataGeneralBitmapCustom>0</AdvertisingDataGeneralBitmapCustom>
            <AdvertisingDataBrodcastBitmapCustom>1</AdvertisingDataBrodcastBitmapCustom>
            <AdvertisingDataBondedScanResponseBitmapCustom>0</AdvertisingDataBondedScanResponseBitmapCustom>
            <AdvertisingDataGeneralScanResponseBitmapCustom>0</AdvertisingDataGeneralScanResponseBitmapCustom>
            <AdvertisingDataBrodcastScanResponseBitmapCustom>0</AdvertisingDataBrodcastScanResponseBitmapCustom>
            <TxPowerLevelOffset>0</TxPowerLevelOffset>
            <MinimumConnectionInterval>65535</MinimumConnectionInterval>
            <MaximumConnectionInterval>65535</MaximumConnectionInterval>
            <SlaveLatency>0</SlaveLatency>
            <TimeoutMultipler>65535</TimeoutMultipler>
            <AddServiceUpdateCharacteristic>false</AddServiceUpdateCharacteristic>
            <AddServiceUpdateCharacteristicPipe>false</AddServiceUpdateCharacteristicPipe>
            <TimingChangeDelay>5</TimingChangeDelay>
            <CustomAdTypes>
                <AdType index="1">
                    <Type>ff</Type>
                    <Value>59000005FFF703FB56</Value>
                </AdType>
                <AdType index="2">
                    <Type>18</Type>
                    <Value></Value>
                </AdType>
            </CustomAdTypes>
        </Gapsettings>
        <Hardwaresettings>
            <Clocksource>1</Clocksource>
            <ClockAccuracy>1</ClockAccuracy>
            <InitialTxPower>3</InitialTxPower>
            <HfClkSource>0</HfClkSource>
            <DcDcConverter>0</DcDcConverter>
            <ActiveSignalModeIndex>0</ActiveSignalModeIndex>
            <ActiveSignalToTickDistance>0</ActiveSignalToTickDistance>
            <DynamicWindowLimitingEnabled>true</DynamicWindowLimitingEnabled>
        </Hardwaresettings>
        <CurrentInput>
            <BatteryCharge>220</BatteryCharge>
            <Master32KhzClockAccuracy>10</Master32KhzClockAccuracy>
            <ConnectionInterval>1000</ConnectionInterval>
            <PercentOfTimeSleeping>10</PercentOfTimeSleeping>
            <PercentOfTimeAdvertising>10</PercentOfTimeAdvertising>
            <AdvertisingInterval>1280</AdvertisingInterval>
        </CurrentInput>
    </Profile>
    

Related