ble app uart

Hi:

I use nrf52832 to connect to the sensor module through uart. When the sensor device is turned off, I can repeat the pairing and unpairing of the Ble module through the nRF Connect app. But after the Ble module pairing is completed and the sensor is turned on, when I cancel the Ble pairing and want to re-pair, I cannot scan the Ble device and cannot pair. How can I solve it

Parents Reply Children
  • nicky_liu said:
    Yes, I am using the ble_app_uart example. For the example, I only modify MIN_CONN_INTERVAL and MAX_CONN_INTERVAL.

    Thank you for clarifying.
    The unmodified example will resume advertising upon disconnect. You should see the LED of the DK switch from a solid state (indicating connected state) to blinking (indicating advertising state). Do you not see this happening on your end, when you disconnect from the central side?

    nicky_liu said:
    This problem only occurs when the sensor device is turned on, how can I modify it for the ble example?

    I am not sure I understand exactly what you mean, could you elaborate?
    Does this only happen when the sensor device is sending data through UART? Are you able to see its advertisements if you disconnect from it and the sensor device is not sending data through UART?

    Best regards,
    Karl

  • Yes, when the sensor device sends data to the ble module through uart, I cannot see ble advertisements after I cancel the Ble pairing. When the sensor device is turned off and uart is not receiving or sending data, I can cancel the Bluetooth pairing, see ble advertisements and re-pair.

  • That does sound strange.
    What does your log say when the sensor device keeps sending data through UART after you cancel the BLE pairing?
    It would be helpful to see the entire log for when you see this behavior.

    Could you also specify how you modified the MIN_CONN_INTERVAL and MAX_CONN_INTERVAL of the ble app uart example?

    Best regards,
    Karl

  • Hi Karl:

    This picture is the message that appeared in the nRF Connect Log when I unpaired

    The pictures are the screen that appears on nRF Connect when I want to re-pair again, and the message that appears in the log

    In the example of ble app uart, the code I modified is as follows:

    #define BLE_GATT_ATT_MTU_DEFAULT          247     //23

    #define MIN_CONN_INTERVAL MSEC_TO_UNITS(20, UNIT_1_25_MS)      //20
    #define MAX_CONN_INTERVAL MSEC_TO_UNITS(30, UNIT_1_25_MS)     //70

  • Oh, my apologies - I meant to say that I would like to see the peripheral's side log.
    The UART example by default logs using the RTT backend, which you can see either in the debug terminal in Segger Embedded Studios, or in the standalone RTT Viewer application by SEGGER.
    Please instead show me this log for the scenario in which this behavior occurs.

    nicky_liu said:
    In the example of ble app uart, the code I modified is as follows:

    Thank you for specifying.

    Best regards,
    Karl

Related