Sample Header Ad - 728x90

Issue in l2cap test - Bluez

0 votes
0 answers
21 views
I'm currently testing the bluez tools like l2ping & l2test, So my intention was to interface between two devices through l2cap layer. I have cloned the bluez repository on two raspberry pi devices, and made necessary configuration to execute those tools, but I didn't get the expected output instead the program stuck at socket level during connect stage on sender due to which the receiver waits on accept stage, this result in either Host is down or Connection Refused Error, also I tried this sample tools on two different systems(PC) got the similar results, can someone guide me on what I'm missing here.
$  sudo ./tools/l2test -p  C5:86:1A:53:D7:3B
Can't connect socket: Host is down
Server
Advertisment start success

*** Booting Zephyr OS build v4.1.0-1545-gfa45bebccfb1 ***
[00:00:00.255,462]  bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)
[00:00:00.255,493]  bt_hci_core: HW Variant: nRF52x (0x0002)
[00:00:00.255,523]  bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 4.1 Build 99
[00:00:00.256,561]  bt_hci_core: Identity: C5:86:1A:53:D7:3B (random)
[00:00:00.256,591]  bt_hci_core: HCI: version 5.4 (0x0d) revision 0x0000, manufacturer 0x05f1
[00:00:00.256,622]  bt_hci_core: LMP: version 5.4 (0x0d) subver 0xffff
Here, I made a NRF device as peripheral which is discoverable & connectable, it advertises its info, using which it can be connected, this device can be connected using bluetoothctl but couldn't be connected using l2test Two Raspberry Pis running BlueZ. My goal is to establish an L2CAP channel using tools like l2test and l2ping. The peripheral device (nRF52) successfully advertises and can be connected via bluetoothctl, but any attempt to connect using l2test fails with errors like Host is down or Connection refused. I've also replicated the test between two Raspberry Pi devices with the same result: the server waits on a PSM, but the client fails to connect. I'm trying to understand if this is a configuration issue, a limitation of the tools, or if additional setup (e.g., registering a PSM for LE CoC) is needed. I'd appreciate guidance on what's missing or how to properly use L2CAP over BLE with BlueZ and Zephyr. 2nd Approach using two PI devices
pi@raspberrypi:~/bluez $ sudo ./tools/l2test -V le_public -r
l2test: Waiting for connection on psm 128 ...
pi@raspberrypiclient:~/bluez $ sudo ./tools/l2test -V le_public -s DC:A6:32:76:10:DA                                                                      
l2test: Can't connect: Connection refused (111)
Asked by Sandy (1 rep)
Jun 16, 2025, 01:35 PM