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

which program to choose to advertise data over BLE ?

Hello Everyone,

I have done I2C communication with Grid Eye sensor (AMG 8832) using twi_master_with_twis_slave (nRF5_SDK_12.3.0_d7731ad) example program. Now i want to transmit the Temperature data over BLE . I am not sure which ble_peripheral example to use to transmit the data ?

Thanks in advance.

  • Hello,

    This means that there is probably an err_code != 0 in one of the APP_ERROR_CHECK(err_code) calls. Can you try to disable the optimization, and then define "DEBUG" in your preprocessor defines? I don't know what IDE you use (if any), but in most IDEs, it is usually found in the project settings->C/C++.

    Try to do that, and then see if it stops on line 76, and if you can see where the APP_ERROR_CHECK was called from. You need to do both of the steps above to find this information.

    BR,

    Edvin

  • Thanks for replying Edvin,

    The problem is solved. I am able to get the advertisement packets.But it is limited to 31 bytes i want to send 64 bytes of data. can you help me how to solve the issues or suggest me a post to look up for info.

    Thanks for helping once again.

  • Hello,

    As of now, it is not possible to have advertising packets longer than 31 bytes. wrote a blogpost which you can find here, which explains the features of BLE 5 advertising. As it also says, many of these features are not yet available through the Nordic Softdevices. 

     

    You can look into scan response, which is described at the end of this Advertising Tutorial.

     

    Best regards,

    Edvin

  • Hello Edvin,

    Thank you for replying i was able to send more the 31 bytes of data in the advertisement packet by adding the scan response data in the advertising_init() function . I have one last question i have to make the data to be advertise in real time when there is change in the temperature . Is there is a way to do it in real time ?  If yes can you suggest any.

    Thank you,

    vasanth

  • You can change the advertising data, but you will have to stop advertising using sd_ble_gap_adv_stop(). This will always return NRF_SUCCESS, unless it isn't advertising, in which case you can ignore the return value from this call.

    Then run ble_advertising_init() again with the updated advertising data. You can e.g. set up a timer and read thermometer data, and update the advertising data if the temperature has changed significantly from the current "advertising value".

    Remember to stop the advertising before you run ble_advertising_init() and ble_advertising_start() again.

     

    Best regards,

    Edvin

Related