This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Sending data received with BLE scanner to esp32 with uart

Hi everyone. I want to take advertising data with ble scanner and transmit to esp32 via uart. But I don't know how to do this. Is there an example for this? I need your help on this.

  •  I am looking for is an example that combines beacon scanner and uart communication. I didn't think I'd find something like this in the esp32 forum.

  • Hello sasci,

    Have I understood you correctly that you intend to use a nRF52840 SoC as a scanner device that forwards the advertising reports it finds through to a esp32 module through an UART connection? If so, do you intend this to scan for all devices, or only looking for a specific device?

    If looking for a specific device's advertising you may start out with the BLE APP UART central example, and then use the BLE_GAP_EVT_ADV_REPORT from the filter match to be output on the UART.
    You can re-use the section from the BLE_NUS_C_EVT_NUS_TX_EVT event to print the data to UART.
    You will also need to set connect_if_match to false, if you intend not to connect to a device that matches your scanner filters.

    Best regards,
    Karl

  • Hello Karl,

    Thank you for your advice. I want to write a code that sends battery advertisement of many bluetooth devices to esp and want it to establish esp communication with uart. Which SDK should I choose for the examples you mention?

  • sasci said:
    Thank you for your advice.

    No problem at all, I am happy to help!

    sasci said:
    I want to write a code that sends battery advertisement of many bluetooth devices to esp and want it to establish esp communication with uart. Which SDK should I choose for the examples you mention?

    We generally recommend that new developments make use of the new nRF Connect SDK, but the application you describe sound very similar to the existing BLE NUS central application in the nRF5 SDK. This application scans for specific devices (filters on advertised UUID's) and has UART already in use.
    You will need to remove the UUID filter, and have the advertising reports output on the UART as described in my previous comment.

    Best regards,
    Karl

Related