# Debug

Source: [https://docs.qualcomm.com/doc/80-70014-13/topic/bt_debugging.html](https://docs.qualcomm.com/doc/80-70014-13/topic/bt_debugging.html)

To debug Bluetooth issues, use host logs or over-the-air (OTA) logs. Host logs include
            Logcat and BTSnoop (Fluoride stack)/HCI logs. These logs can be used for initial
            debugging.

The following table lists the logs required to debug different Bluetooth issues:

| Issue type | Logcat | BTSnoop/HCI | Kernel logs | OTA |
| --- | --- | --- | --- | --- |
| General | Required | Required | Not required | Recommended |
| Bluetooth controller | Not required | Recommended | Not required | Required |
| Bluetooth on/off | Required | Not required | Not required | Not required |
| Crash | Required | Not required | Required | Not required |

## Host logs

Before you begin, ensure that you enable SSH in Permissive mode to securely access
                your host device. For instructions, see [How to SSH?](https://docs.qualcomm.com/bundle/publicresource/topics/80-70014-254/how_to.html#how-to-ssh-).

To get the Bluetooth logs from the RB3 Gen2 device, do the following:

1. Turn off Bluetooth on the device.
2. Run SSH in the command prompt using the following command:

        ssh root@<device_IP_address>Copy to clipboard

    For example, if the IP address of the device is
                            `10.92.160.222`, run the following command:

        ssh root@10.92.160.222Copy to clipboard
3. Connect to the SSH by entering the following password:

        oelinux123Copy to clipboard
4. Get the Logcat logs as follows:
    1. Pull the Bluetooth stack configuration file,
                                    bt\_stack.conf, from the device by running
                                the following
                                command:

            scp -r root@<IP_address>:/etc/bluetooth/bt_stack.conf <destination_file_path>Copy to clipboard

        To pull a file to the current file path of the PC, enter the
                                    `<destination_file_path>` as
                                    `.` in the command.

        For example, the IP address of the device is
                                    `10.92.160.222`. To pull the
                                    `bt_stack.conf` file from the device, run the
                                following command:

            scp -r root@10.92.160.222:/etc/bluetooth/bt_stack.conf .Copy to clipboard

Note: When prompted
                                for a password, enter `oelinux123` to authenticate a
                                file transfer via Secure Copy Protocol (SCP).
    2. Change the log level to verbose by configuring the following parameters
                            in the Bluetooth stack configuration file,
                                `bt_stack.conf`:

            TRC_HCI=6
            TRC_L2CAP=6
            TRC_RFCOMM=6
            TRC_OBEX=6
            TRC_AVCT=6
            TRC_AVDT=6
            TRC_AVRC=6
            TRC_AVDT_SCB=6
            TRC_AVDT_CCB=6
            TRC_A2D=6
            TRC_SDP=6
            TRC_SMP=6
            TRC_BTAPP=6
            TRC_BTIF=6
            TRC_BNEP=6
            TRC_PAN=6
            TRC_HID_HOST=6
            TRC_HID_DEV=6Copy to clipboard
    3. Push the Bluetooth stack configuration file to the device by running
                                the following
                                command:

            scp -r bt_stack.conf root@<IP_address>:/etc/bluetooth/bt_stack.confCopy to clipboard

        For example, the IP address of the device is
                                    `10.92.160.222`. To push the
                                    `bt_stack.conf` file to the device, run the
                                following command:

            scp -r bt_stack.conf root@10.92.160.222:/etc/bluetooth/bt_stack.confCopy to clipboard
    4. Collect the Logcat logs by running the following
                            command:

            journalctl -f > all_logs.txtCopy to clipboard
    5. Pull the Logcat file by running the following
                                command:

            scp -r root@<IP_address>:<source_file_path_of_all_logs.txt> <destination_file_path>Copy to clipboard

        To pull a file to the current file path of the PC, enter the
                                    `<destination_file_path>` as
                                    `.` in the command.

For example, the IP address of the device is
                                    `10.92.160.222`. To pull the Logcat file
                                    all\_logs.txt to the current file path, run
                                the following command:

            scp -r root@10.92.180.250:/home/root/all_logs.txt .Copy to clipboard
5. Pull the BTSnoop logs by running the following command:

        scp -r root@<IP_address>:/etc/bluetooth/btsnoop_hci.log <destination_file_path>Copy to clipboard

    The
                        HCIDUMP/BTSnoop logs are useful to determine whether the issue relates to
                        the application, Bluetooth host, Bluetooth SoC, or a remote device.

    To pull a file to the current file path of the PC, enter the
                            `<destination_file_path>` as `.` in the
                        command.

For example, the IP address of the device is
                            `10.92.160.222`. To pull the
                            `btsnoop_hci.log` file, run the following command:

        scp -r root@10.92.160.222:/etc/bluetooth/btsnoop_hci.log .Copy to clipboard

If there is a composite USB, Q6 handles the waking host, connects the USB, and then
                sends the crash dump to the host.

In the standalone mode, Bluetooth wakes up the host and sends the crash dump.

## OTA logs

OTA logs are also known as sniffer logs. Bluetooth OTA logs are captured using the
                FTS/Ellisys sniffer tool to debug certain SoC or remote device issues, and
                environment issues.

Last Published: Jul 12, 2024

[Previous Topic
GATT configuration parameters](https://docs.qualcomm.com/bundle/publicresource/80-70014-13/topics/gatt_config_params.md) [Next Topic
References](https://docs.qualcomm.com/bundle/publicresource/80-70014-13/topics/references_acronyms.md)