This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
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

[BLE]Active Observer problem with SCAN_REQ/RSP

Hello

I've been trying to create a simple BLE observer that outputs the nearby devices data onto the serial port using a PCA10001 board.

For this, I'm adapting the code for "nRF51-multi-role-conn-observer-advertiser" that can be found on the NordicS git: github.com/.../nRF51-multi-role-conn-observer-advertiser

Although the advertiser code is well documented, the observer is still in progress (19-08-14) as it is explained in the end of the page.

Anyway, I successfully compiled and uploaded the observer code onto the device. For testing purposes, I'm using a second BLE device that is constantly advertising, but only broadcasts the device's name when inquired with a SCAN_REQ packet.

The ADV_IND packets are well captured by the board but, even though I have the active scan enabled, no SCAN_RSP packets are ever received.

Looking at the code, after receiving a ADV_IND packet and "active scan" is enabled it sends a SCAN_REQ and waits for the response. As I'm trying to figure out if the REQ was ever sent I'm afraid that this feature is not fully implemented, as for the sending the SCAN_REQ packet only this code is available.

static void m_state_send_scan_req_entry (void)
{
  memcpy(&m_tx_buf[9], &m_rx_buf[3], 6);
  radio_buffer_configure (&m_tx_buf[0]);
  radio_tx_prepare ();
  
  m_scanner.state = SCANNER_STATE_SEND_REQ;
}

And is sent immediately after the arriving ADV_INI packet (shouldn't it wait 150us, as the core specification mandates?)

The timeout callback "ll_scan_timeout_cb()" is called with the state SCANNER_STATE_RECEIVE_SCAN_RSP showing that a SCAN_RSP packet never arrived during the timeout period.

My guess is that there is a problem with the SCAN_REQ code, but I'm not sure.

I've only been working with this nordic device for a few weeks now so I don't fully understand everything and it is possible that I'm missing something.

Any help is appreciated, if you need any more information, please let me know.

Thank you very much Manuel

  • Can you send a sniffer trace to show us what is happening on the air. The nRF Sniffer is available for download from the Nordicsemi website. Post your capture file here and I will take a look at it. Please send a capture file using Wireshark v1.10.x .

    I saw the capture file and I concur with Morten that there is no SCAN REQ on the air, this can due to (1) SCAN_REQ timing is not correct. (2) You are not running the active scanner.

    Can you verify that you are running the active scanner and not the passive scanner ?

    Edited: Question added.

    Thanks

    Edited: Added new question

  • Thank you very much for the answer.

    This is the setup I used:

    image description

    And here are the capture files with both the 1.10.9 and 1.12.0 versions of wireshark.

    ble_trace_1_10_9.pcapng ble_trace_1_12_0.pcapng

    Thanks

  • If the observer is configured to run in active mode, it will respond to scannable advertisements (ADV_IND and ADV_SCAN_IND) with a SCAN_REQ when it sees them. From your trace, I see that your device sends ADV_IND packets, but I do not see any SCAN_REQs sent in response. Without these, your device would not send a SCAN_RSP back to the observer.

    Are you certain that the observer is successfully running in active mode? The observer outputs logging data on the serial port which can help you verify if it is running properly. If you've verified that the observer is in active mode, and it is running, it's possible there is a problem with the observer itself.

Related