Easy ways to debug BLE connectivity issues

Are there any convenient ways to debug BLE connectivity issues? I have the service up and running but the connection on nRFConnect App doesn't quite go through: it remains stuck on "Connecting" state.

It was working all fine until of a sudden and I can't seem to figure out what went wrong

Parents
  • Hello,

    The most convenient way of debugging connectivity issues is to use the nRF Sniffer tool - are you already familiar with this? It is a powerfull tool to wield when developing and debugging with BLE, since it lets you monitor the on-air traffic.
    It does however require an extra piece of hardware to act as the sniffer - you can see a list of supported devices in the sniffer's documentation.

    Best regards,
    Karl

  • Alright. It gets frustrating at times when you try to follow along and still don't make it through. I programmed the nRF Sniffer firmware but in wireshark, I don't see the nRF Sniffer COM PORT showing up. Plus I can't seem to get the interface toolbar as shown in the screenshot here. I also have the nRF Sniffer API folder which has a bunch of python files but the link you shared doesn't seem to talk about it. 

    Also, in my case, BLE doesn't even connect. Do you still think nRF Sniffer tool would be useful? Can I not use nRF Connect on my desktop? Scan devices option is greyed out let alone any scanned devices


    Any quick support is appreciated

  • morpho said:
    Alright. It gets frustrating at times when you try to follow along and still don't make it through. I programmed the nRF Sniffer firmware but in wireshark, I don't see the nRF Sniffer COM PORT showing up. Plus I can't seem to get the interface toolbar as shown in the screenshot here. I also have the nRF Sniffer API folder which has a bunch of python files but the link you shared doesn't seem to talk about it. 

    Could you confirm that you completed the step of the installation that concerns the python files and dependencies?

    morpho said:
    Also, in my case, BLE doesn't even connect. Do you still think nRF Sniffer tool would be useful? Can I not use nRF Connect on my desktop? Scan devices option is greyed out let alone any scanned devices

    Yes, if you are able to scan and connect to the device you could use nRF Connect to test that the device works as expected. However, when debugging connection issues the nRF Sniffer is better suited since you may then monitor exactly what is being transferred and negotiated between the two devices.

    I notice that you are having some issue with the BLE application of nRF Connect also. Which device are you using for the nRF Connect here? Are you getting the prompt to re-program it when you select it in the drop-down menu?

    Best regards,
    Karl

Reply
  • morpho said:
    Alright. It gets frustrating at times when you try to follow along and still don't make it through. I programmed the nRF Sniffer firmware but in wireshark, I don't see the nRF Sniffer COM PORT showing up. Plus I can't seem to get the interface toolbar as shown in the screenshot here. I also have the nRF Sniffer API folder which has a bunch of python files but the link you shared doesn't seem to talk about it. 

    Could you confirm that you completed the step of the installation that concerns the python files and dependencies?

    morpho said:
    Also, in my case, BLE doesn't even connect. Do you still think nRF Sniffer tool would be useful? Can I not use nRF Connect on my desktop? Scan devices option is greyed out let alone any scanned devices

    Yes, if you are able to scan and connect to the device you could use nRF Connect to test that the device works as expected. However, when debugging connection issues the nRF Sniffer is better suited since you may then monitor exactly what is being transferred and negotiated between the two devices.

    I notice that you are having some issue with the BLE application of nRF Connect also. Which device are you using for the nRF Connect here? Are you getting the prompt to re-program it when you select it in the drop-down menu?

    Best regards,
    Karl

Children
  • Yes. Running the script in wireshark/extcap folder does seem to run fine as well. Refreshed the interfaces in Wireshark and still don't see nRF interface showing up.

     ./nrf_sniffer_ble.sh --extcap-interfaces
    extcap {version=3.1.0}{display=nRF Sniffer for Bluetooth LE}{help=https://www.nordicsemi.com/Software-and-Tools/Development-Tools/nRF-Sniffer-for-Bluetooth-LE}
    
    
    
    
    control {number=0}{type=selector}{display=Device}{tooltip=Device list}
    control {number=1}{type=string}{display=Passkey / OOB key}{tooltip=6 digit temporary key or 16 byte Out-of-band (OOB) key in hexadecimal starting with '0x', big endian format. If the entered key is shorter than 16 bytes, it will be zero-padded in front'}{validation=\b^(([0-9]{6})|(0x[0-9a-fA-F]{1,32}))$\b}
    control {number=2}{type=string}{display=Adv Hop}{default=37,38,39}{tooltip=Advertising channel hop sequence. Change the order in which the siffer switches advertising channels. Valid channels are 37, 38 and 39 separated by comma.}{validation=^\s*((37|38|39)\s*,\s*){0,2}(37|38|39){1}\s*$}{required=true}
    control {number=3}{type=button}{role=help}{display=Help}{tooltip=Access user guide (launches browser)}
    control {number=4}{type=button}{role=restore}{display=Defaults}{tooltip=Resets the user interface and clears the log file}
    control {number=5}{type=button}{role=logger}{display=Log}{tooltip=Log per interface}
    value {control=0}{value= }{display=All advertising devices}{default=true}
    

    I notice that you are having some issue with the BLE application of nRF Connect also. Which device are you using for the nRF Connect here? Are you getting the prompt to re-program it when you select it in the drop-down menu?

    I'm using a Mac, and trying to connect to the BLE profile (similar to how I connect using nRF Connect using a phone app). Trying to see i there's something wrong with the phone app

  • morpho said:
    Yes. Running the script in wireshark/extcap folder does seem to run fine as well. Refreshed the interfaces in Wireshark and still don't see nRF interface showing up.
    morpho said:
    I'm using a Mac, and trying to connect to the BLE profile (similar to how I connect using nRF Connect using a phone app). Trying to see i there's something wrong with the phone app

    Thank you for clarifying.
    It seems I was not explicit enough in my previous comment, my mistake, I meant to ask which device you are using for your connectivity device. I.e which device are you using to do the BLE scanning in the nRF Connect desktop application, or which device have you programmed with the sniffer's connectivity hex

    morpho said:
    the BLE profile (similar to how I connect using nRF Connect using a phone app). Trying to see i there's something wrong with the phone app

    Are you trying to connect your nRF Connect desktop application to your nRF Connect smartphone application?
    I have not personally tried this before, but you would then have to set the smartphone to act as a peripheral (GATT server) and have it advertise so that it is connectable for the nRF Connect for desktop application.
    Is this what you meant, or might I have misunderstood you?

    Best regards,
    Karl

  • which device are you using to do the BLE scanning in the nRF Connect desktop application, or which device have you programmed with the sniffer's connectivity hex

    I only see one device in nRF Connect desktop app which is my nRF52840. I was trying to simulate on my desktop what I see on the mobile app basically. The desktop app doesn't seem to work the same way though: it doesn't let me scan until I select a device but why?

    Are you trying to connect your nRF Connect desktop application to your nRF Connect smartphone application?

    Ah, no! I already mentioned in this response that I'm trying to simulate on the desktop with the phone app to see if there's an issue with the phone app itself.

    1. I tried following the steps in the tutorial but I can't seem to find the COM PORT in wireshark.

    2. Is this really needed to debug my issue since I can't even connect to my profile all of a sudden (which I was previously able to!).

    3. Is it possible to have a live debug session to help solve the issue a bit faster?

    Thanks

  • Alright. So I tested one more time and I'm fairly certain it's the app that's not functioniong as expected! In the program, ble_evt_handler is invoked and I see the Connect print as soon I attempt to connect from the phone app, but since it doesn't "connect" on the phone app, i don't see any profiles. Are you aware of the issue?

  • Hello again, Morpho

    morpho said:
    I only see one device in nRF Connect desktop app which is my nRF52840. I was trying to simulate on my desktop what I see on the mobile app basically. The desktop app doesn't seem to work the same way though: it doesn't let me scan until I select a device but why?

    Oh, this is because the nRF Connect BLE desktop application requires a nRF device to act as its BLE adapter. The nRF Connect application will prompt you to program the device when you select it from the dropdown menu - it will then program the connectivity firmware it needs to be able to communicate with the device.
    You may then have this device do either scanning or advertising, as you would like. In the central / scanner case you could just click "start scan", but in the advertising / peripheral case you will need to first configure it as a GATT server (different button at the top).

    morpho said:

    Ah, no! I already mentioned in this response that I'm trying to simulate on the desktop with the phone app to see if there's an issue with the phone app itself.

    1. I tried following the steps in the tutorial but I can't seem to find the COM PORT in wireshark.

    I am still having a hard time understanding exactly what you are trying to achieve here. I am under the impression that you are looking for a way to debug a peripheral application's connectivity / connection issues, is this correct?

    If so, I would recommend the following approach:
    - Make sure that the peripheral is programmed and running as expected. Is there any indication that the program is running, and the device has started advertising? What does the log's (if enabled) say?
    - When you have confirmed that the peripheral is functioning as expected, and that it is advertising, we can move on to debugging the connection itself.
    - Choose either the nRF Sniffer or the nRF Connect for Desktop's BLE application to proceed with. The nRF Sniffer gives the complete picture of what is happening on-air between two devices, and can quickly highlight issues within a connection, or issues with advertising.
    The nRF Connect for Desktop's BLE application quickly gives a good overview, and visualizes how the peripheral will look to a scanning central device.

    So, if your issue is with which profiles, services, and characteristics is exposed - choose nRF Connect for desktop. If your issue is with connection throughput, latency, request rejections, or other connection-specific technicalities, choose the nRF Sniffer.

    morpho said:
    Alright. So I tested one more time and I'm fairly certain it's the app that's not functioniong as expected! In the program, ble_evt_handler is invoked and I see the Connect print as soon I attempt to connect from the phone app, but since it doesn't "connect" on the phone app, i don't see any profiles. Are you aware of the issue?

    Could you confirm for me whether you are referring to the program running on the peripheral when you say application?
    I am not aware of any such issue, no. Are you working with a custom application, or are you testing this with a specific example? In case of the latter,, which example?
    It would be great if you could share the peripheral's logs with me as well. You could do so by using the Insert -> Code -> Text option here on DevZone.

    Could you also elaborate what you mean when you say that the peripheral prints connect when the nRF Connect for Smartphone application attempts to connect, but 'it doesn't "connect" on the phone app'?

    Best regards,
    Karl

Related