Skip to content

How to get HCI log on Android device

Alexey 'Cluster' Avdyukhin edited this page Feb 20, 2022 · 3 revisions

In case your kettle is not working with my integration or it's working with some issues you can help me to investigate the problem and improve integration. I tested it on my kettle only: SkyKettle RK-G211 with firmware 3.9. I'm not sure that it will work with other kettles correctly.

I can analyze the Bluetooth traffic of your smartphone to understand how your kettle works. It's possible to capture traffic on Android devices. Note that it can be difficult for an average user. There are instructions:

Step 1. Enable developer mode

Go to Settings, About phone, Software Information and tap the “Build Number” row 7 times. The phone will show a notification counting down once you’ve tapped it a few times, and will confirm that developer options have been enabled.

Step 2. Enable USB debugging and the Bluetooth logs

Go to the newly enabled “Developer options” section of the Settings menu, toggle “Enable Bluetooth HCI snoop log” to enable the logs, and “USB Debugging” to allow us to extract the logs over USB later. Then toggle bluetooth on and off. The log is now enabled (although it doesn’t save to the user accessible part of the filesystem — read on for how to extract it). At this point you should use whatever app you want to capture the bluetooth traffic from to generate some logs.

Step 3. Download adb, the Android Debug Bridge command line tool

Crucially, you don’t need the full Android development studio. The tools can be downloaded from https://developer.android.com/studio/releases/platform-tools.html, and will need to be placed somewhere in your PATH so they can be called easily.

Step 4: Ensure your device is authorized and connected

Plug your device into your computer with a USB cable. Run adb devices to see a list of devices adb recognizes. I had to unlock the phone and tap around in the USB Options section of the notification you get when the phone is plugged in to get a screen up asking me to authorize my computer before it would show as authorized:

image

Once authorized, adb will show the device as attached:

$ adb devices
List of devices attached
RF8M55WFB4W     device

Step 5. Start official SkyKettle application

Start the official app and connect to the Kettle. Do some actions that can't be done using Home Assistant: pair with the kettle if HA can't pair with it, enable/disable light if HA can't do it, etc.

Step 6: Generate a bug report

Use the adb bugreport filename command to generate a bug report, which will create filename.zip in the current directory. In this zip, in the FS/data/log/bt directory, there is the btsnoop_hci.log file. It can be missed on some devices, try to find it in the phone memory or SD card in this case.

Step 7: Send this file to me

Create Issue, describe your problem, write which Kettle you using and the firmware version. Attach the btsnoop_hci.log file and write which actions have you done during the capture process.

Also, generate and attach a Home Assistant log file if you can.