nRF Desktop - Dongle HID Forward unable to connect "Service not found"

Hello,

I've been trying to get the nRF Desktop Dongle/HID Forwarder to work, ie. I program a nrf52840DK as a HID forwarder, it connects to my bluetooth keyboard, and then the nrf52840 relays the keystrokes from my bluetooth keyboard.

This should somewhat work out of the box, with MINIMAL configuration changes, but I just can't get it to work, it tries to connect, but then just disconnects right after with a `Service not found` log (keep in mind, service discovery seems to work in the Android nRF Connect app, but it uses a database hash?? something?).

[82133036] <inf> app_event_manager: e:ble_peer_search_event inactive
[82133038] <inf> app_event_manager: e:led_event led_id:1 effect:0x5641c
[82133040] <inf> app_event_manager: e:power_manager_restrict_event module "ble_state_pm" restricts to MAX
[82133043] <inf> app_event_manager: e:led_event led_id:1 effect:0x5640c
[82133047] <inf> app_event_manager: e:led_ready_event led_id:1 effect:0x5640c
[82133571] <err> ble_scan: MYDEBUG Peer Name (err Mouse nRF52 Desktop)
[82133572] <err> ble_scan: MYDEBUG Peer Name (err Glove80)
[82133573] <inf> ble_scan: Device name filters added
[82133590] <inf> ble_scan: Scan started
[82133592] <inf> app_event_manager: e:ble_peer_search_event active
[82133594] <inf> app_event_manager: e:led_event led_id:1 effect:0x5641c
[82138495] <inf> ble_scan: Filters matched. C3:04:C8:95:B6:06 (random) connectable
[82138550] <inf> ble_scan: Connecting done
[82145348] <inf> ble_state: Connected to C3:04:C8:95:B6:06 (random)
[82145369] <inf> app_event_manager: e:ble_peer_event id=0x200049d0 CONNECTED reason=0
[82145373] <inf> app_event_manager: e:ble_peer_conn_params_event peer=0x200049d0 min=8 max=8 lat=0 timeout=400 (updated)
[82145373] <inf> ble_conn_params: Conn params for peer: 0x200049d0 updated.
[82145378] <inf> app_event_manager: e:led_event led_id:1 effect:0x5641c
[82145381] <inf> app_event_manager: e:power_manager_restrict_event module "ble_state_pm" restricts to SUSPENDED
[82146179] <err> ble_discovery: Service not found
[82146842] <inf> ble_state: Disconnected from C3:04:C8:95:B6:06 (random) (reason 22)
[82146845] <inf> app_event_manager: e:ble_peer_event id=0x200049d0 DISCONNECTED reason=22
[82146846] <inf> ble_scan: Scan stopped

I've setup the nrf ble sniffer, which seems to indicate that the ble_discovery fails, for some reason with a `Attribute not found`.

I've made two recordings, one where it works, and one where it does not work.

Hopefully someone can help me out.

Changes I've made in the nrf repo, on revision 6266884de899a254b7f09868d6ad4947d0dfc879.

diff --git a/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/ble_discovery_def.h b/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/ble_discovery_def.h
index 62d3c5e3dd..734e1b5030 100644
--- a/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/ble_discovery_def.h
+++ b/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/ble_discovery_def.h
@@ -20,7 +20,7 @@ struct bt_peripheral {
 	enum peer_type peer_type;
 };
 
-static const uint16_t vendor_vid = 0x1915;
+static const uint16_t vendor_vid = 0x16c0;
 
 /* Peripherals parameters. */
 static const struct bt_peripheral bt_peripherals[] = {
@@ -37,7 +37,7 @@ static const struct bt_peripheral bt_peripherals[] = {
 		.peer_type = PEER_TYPE_MOUSE,
 	},
 	{
-		.pid = 0x52dd,
+		.pid = 0x27db,
 		.peer_type = PEER_TYPE_KEYBOARD,
 	},
 };
diff --git a/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/ble_scan_def.h b/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/ble_scan_def.h
index fd129a6918..f79aeda22c 100644
--- a/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/ble_scan_def.h
+++ b/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/ble_scan_def.h
@@ -18,4 +18,5 @@ const struct {} ble_scan_include_once;
 static const char *peer_name[] = {
 	[PEER_TYPE_MOUSE] = "Mouse nRF52 Desktop",
 	[PEER_TYPE_KEYBOARD] = "Keyboard nRF52 Desktop",
+	[PEER_TYPE_KEYBOARD] = "Glove80",
 };
diff --git a/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/prj_dongle.conf b/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/prj_dongle.conf
index 9692673554..7724b1420a 100644
--- a/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/prj_dongle.conf
+++ b/applications/nrf_desktop/configuration/nrf52840dk_nrf52840/prj_dongle.conf
@@ -64,9 +64,9 @@ CONFIG_RESET_ON_FATAL_ERROR=n
 
 CONFIG_GPIO=y
 
-CONFIG_SERIAL=n
-CONFIG_CONSOLE=n
-CONFIG_UART_CONSOLE=n
+CONFIG_SERIAL=y
+CONFIG_CONSOLE=y
+CONFIG_UART_CONSOLE=y
 
 CONFIG_REBOOT=y
 
@@ -97,3 +97,4 @@ CONFIG_ASSERT=y
 CONFIG_ASSERT_LEVEL=2
 
 CONFIG_DESKTOP_LOG=y
+CONFIG_LOG_DEFAULT_LEVEL=3
diff --git a/applications/nrf_desktop/src/modules/ble_scan.c b/applications/nrf_desktop/src/modules/ble_scan.c
index 0e7d471016..b15b9bf7bb 100644
--- a/applications/nrf_desktop/src/modules/ble_scan.c
+++ b/applications/nrf_desktop/src/modules/ble_scan.c
@@ -316,6 +316,7 @@ static int configure_name_filters(uint8_t *filter_mode)
 		}
 
 		err = bt_scan_filter_add(BT_SCAN_FILTER_TYPE_NAME, peer_name[i]);
+		LOG_ERR("MYDEBUG Peer Name (err %s)", peer_name[i]);
 		if (err) {
 			LOG_ERR("Name filter cannot be added (err %d)", err);
 			break;

.3225.capture_failure.pcapng

phone-working.pcapng

Related