<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Multi-Connection BLE Central on nRF52840DK (nRF Connect SDK v3.2.1)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/126563/multi-connection-ble-central-on-nrf52840dk-nrf-connect-sdk-v3-2-1</link><description>Dear Nordic Semiconductor Support Team, My name is Iwo, and I’m developing a BLE central application using the nRF52840 DK with nRF Connect SDK v3.2.1. The application works reliably when connecting to a single custom BLE peripheral (a smart lamp with</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 21 Jan 2026 11:45:29 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/126563/multi-connection-ble-central-on-nrf52840dk-nrf-connect-sdk-v3-2-1" /><item><title>RE: Multi-Connection BLE Central on nRF52840DK (nRF Connect SDK v3.2.1)</title><link>https://devzone.nordicsemi.com/thread/559258?ContentTypeID=1</link><pubDate>Wed, 21 Jan 2026 11:45:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c1962b8b-6d69-405d-ab49-9aada9e74cdd</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Iwo,&amp;nbsp;&lt;br /&gt;Glad that you managed to get it work. Would be great if you can share what you found that solved your issue.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multi-Connection BLE Central on nRF52840DK (nRF Connect SDK v3.2.1)</title><link>https://devzone.nordicsemi.com/thread/559238?ContentTypeID=1</link><pubDate>Wed, 21 Jan 2026 10:13:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:46fbbc39-333e-4397-8620-77516c6732fc</guid><dc:creator>Iwo</dc:creator><description>&lt;p&gt;Alright, I managed to get it working, case closed : )&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multi-Connection BLE Central on nRF52840DK (nRF Connect SDK v3.2.1)</title><link>https://devzone.nordicsemi.com/thread/559188?ContentTypeID=1</link><pubDate>Tue, 20 Jan 2026 15:32:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e1981efd-a505-4bfd-bd17-d919446cf0db</guid><dc:creator>Iwo</dc:creator><description>&lt;div&gt;&lt;span class="css-1jxf684 r-bcqeeo r-1ttztb7 r-qvutc0 r-poiln3 r-1adg3ll r-1g7jtus r-1x3r274"&gt;&lt;span class="css-1jxf684 r-bcqeeo r-1ttztb7 r-qvutc0 r-poiln3"&gt;&lt;span class="css-1jxf684 r-bcqeeo r-1ttztb7 r-qvutc0 r-poiln3 r-1x3r274"&gt;Thank you for your previous response and suggestions. I&amp;#39;ve implemented all of them as best as I could with the available hardware, but I&amp;#39;m still facing issues with connecting to the second lamp reliably. The application works perfectly for a single lamp (connects, discovers FFE9, sends commands), but for two lamps, it either connects to only one or fails with MTU exchange err 14 and disconnect reason 62. The lamps work fine with an ESP-32D (both sequentially and concurrently), so environmental factors like RF noise are unlikely the cause. Also the DK connects and sends commands to both of the lamp correctly via Nordic Bluetooth Low Energy app.&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/Screenshot-_2D00_-1_5F00_20_5F00_2026-_2C00_-2_5F00_54_5F00_21-PM.png" alt=" " /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="css-1jxf684 r-bcqeeo r-1ttztb7 r-qvutc0 r-poiln3 r-adyw6z r-135wba7 r-b88u0q"&gt;&lt;span class="css-1jxf684 r-bcqeeo r-1ttztb7 r-qvutc0 r-poiln3"&gt;&lt;span class="css-1jxf684 r-bcqeeo r-1ttztb7 r-qvutc0 r-poiln3 r-1x3r274"&gt;Analysis of What I&amp;#39;ve Tried Since Your Response:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;ul dir="ltr"&gt;
&lt;li&gt;&lt;span class="css-1jxf684 r-bcqeeo r-1ttztb7 r-qvutc0 r-poiln3"&gt;&lt;span class="css-1jxf684 r-bcqeeo r-1ttztb7 r-qvutc0 r-poiln3 r-b88u0q r-1x3r274"&gt;&lt;span class="css-1jxf684 r-bcqeeo r-1ttztb7 r-qvutc0 r-poiln3 r-1x3r274"&gt;Increased CONFIG_BT_MAX_CONN to 3&lt;/span&gt;&lt;/span&gt;&lt;span class="css-1jxf684 r-bcqeeo r-1ttztb7 r-qvutc0 r-poiln3 r-1x3r274"&gt;: Set in prj.conf (attached) &amp;mdash; no change, still only one connection succeeds.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="css-1jxf684 r-bcqeeo r-1ttztb7 r-qvutc0 r-poiln3"&gt;&lt;span class="css-1jxf684 r-bcqeeo r-1ttztb7 r-qvutc0 r-poiln3 r-b88u0q r-1x3r274"&gt;&lt;span class="css-1jxf684 r-bcqeeo r-1ttztb7 r-qvutc0 r-poiln3 r-1x3r274"&gt;Set CONFIG_BT_CTLR_SDC_PERIPHERAL_COUNT=0&lt;/span&gt;&lt;/span&gt;&lt;span class="css-1jxf684 r-bcqeeo r-1ttztb7 r-qvutc0 r-poiln3 r-1x3r274"&gt;: Set in prj.conf &amp;mdash; no improvement in multi-central stability.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="css-1jxf684 r-bcqeeo r-1ttztb7 r-qvutc0 r-poiln3"&gt;&lt;span class="css-1jxf684 r-bcqeeo r-1ttztb7 r-qvutc0 r-poiln3 r-b88u0q r-1x3r274"&gt;&lt;span class="css-1jxf684 r-bcqeeo r-1ttztb7 r-qvutc0 r-poiln3 r-1x3r274"&gt;Test with DKs as peripherals&lt;/span&gt;&lt;/span&gt;&lt;span class="css-1jxf684 r-bcqeeo r-1ttztb7 r-qvutc0 r-poiln3 r-1x3r274"&gt;: I don&amp;#39;t have three DKs, but tested with the available hardware (nRF52840 DK as central, lamps as peripherals). The lamps are third-party, but their ads are visible in sniffer captures (both MACs advertise normally).&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="css-1jxf684 r-bcqeeo r-1ttztb7 r-qvutc0 r-poiln3"&gt;&lt;span class="css-1jxf684 r-bcqeeo r-1ttztb7 r-qvutc0 r-poiln3 r-b88u0q r-1x3r274"&gt;&lt;span class="css-1jxf684 r-bcqeeo r-1ttztb7 r-qvutc0 r-poiln3 r-1x3r274"&gt;nRF Sniffer&lt;/span&gt;&lt;/span&gt;&lt;span class="css-1jxf684 r-bcqeeo r-1ttztb7 r-qvutc0 r-poiln3 r-1x3r274"&gt;: Set up on a dongle/Feather, captured traffic &amp;mdash; shows both lamps advertising (ADV_IND with service UUID FFE5), but the DK only sends CONNECT_REQ to one. No CONNECT_REQ to the second, even though ads are received. MTU exchange fails on the first with &amp;quot;Unlikely Error&amp;quot; (0x0E).&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="css-1jxf684 r-bcqeeo r-1ttztb7 r-qvutc0 r-poiln3"&gt;&lt;span class="css-1jxf684 r-bcqeeo r-1ttztb7 r-qvutc0 r-poiln3 r-b88u0q r-1x3r274"&gt;&lt;span class="css-1jxf684 r-bcqeeo r-1ttztb7 r-qvutc0 r-poiln3 r-1x3r274"&gt;Multi-NUS repo/post&lt;/span&gt;&lt;/span&gt;&lt;span class="css-1jxf684 r-bcqeeo r-1ttztb7 r-qvutc0 r-poiln3 r-1x3r274"&gt;: Reviewed the multi-NUS GitHub repo and post &amp;mdash; implemented similar concurrent central logic with separate conn objects, increased buffers (L2CAP, ACL, CONN_TX_MAX), but still MTU failure and only one connection.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="css-1jxf684 r-bcqeeo r-1ttztb7 r-qvutc0 r-poiln3"&gt;&lt;span class="css-1jxf684 r-bcqeeo r-1ttztb7 r-qvutc0 r-poiln3 r-1x3r274"&gt;Additional steps I tried:&lt;/span&gt;&lt;/span&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span class="css-1jxf684 r-bcqeeo r-1ttztb7 r-qvutc0 r-poiln3"&gt;&lt;span class="css-1jxf684 r-bcqeeo r-1ttztb7 r-qvutc0 r-poiln3 r-1x3r274"&gt;Sequential cycling (connect1 &amp;rarr; write &amp;rarr; disconnect &amp;rarr; connect2 &amp;rarr; write &amp;rarr; disconnect &amp;rarr; repeat) &amp;mdash; connects to one random lamp per reset, sends commands, but doesn&amp;#39;t cycle to the second.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="css-1jxf684 r-bcqeeo r-1ttztb7 r-qvutc0 r-poiln3"&gt;&lt;span class="css-1jxf684 r-bcqeeo r-1ttztb7 r-qvutc0 r-poiln3 r-1x3r274"&gt;Skipped MTU exchange &amp;mdash; writes fail with -12 (ENOMEM) or no ATT channel.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="css-1jxf684 r-bcqeeo r-1ttztb7 r-qvutc0 r-poiln3"&gt;&lt;span class="css-1jxf684 r-bcqeeo r-1ttztb7 r-qvutc0 r-poiln3 r-1x3r274"&gt;Dummy write to FFE9 for BT icon &amp;mdash; works for one lamp.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="css-1jxf684 r-bcqeeo r-1ttztb7 r-qvutc0 r-poiln3"&gt;&lt;span class="css-1jxf684 r-bcqeeo r-1ttztb7 r-qvutc0 r-poiln3 r-1x3r274"&gt;Swapped MAC types (public/random) &amp;mdash; no change.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="css-1jxf684 r-bcqeeo r-1ttztb7 r-qvutc0 r-poiln3"&gt;&lt;span class="css-1jxf684 r-bcqeeo r-1ttztb7 r-qvutc0 r-poiln3 r-1x3r274"&gt;Increased scan interval/window &amp;mdash; catches ads, but connect only to one.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;&lt;span class="css-1jxf684 r-bcqeeo r-1ttztb7 r-qvutc0 r-poiln3 r-1adg3ll r-1g7jtus r-1x3r274"&gt;&lt;span class="css-1jxf684 r-bcqeeo r-1ttztb7 r-qvutc0 r-poiln3"&gt;&lt;span class="css-1jxf684 r-bcqeeo r-1ttztb7 r-qvutc0 r-poiln3 r-1x3r274"&gt;Could you review the code/prj.conf and suggest fixes? Or provide a minimal multi-central sample for nRF Connect SDK v3.2.1 with two peripherals?&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="css-1jxf684 r-bcqeeo r-1ttztb7 r-qvutc0 r-poiln3 r-1adg3ll r-1g7jtus r-1x3r274"&gt;&lt;span class="css-1jxf684 r-bcqeeo r-1ttztb7 r-qvutc0 r-poiln3"&gt;&lt;span class="css-1jxf684 r-bcqeeo r-1ttztb7 r-qvutc0 r-poiln3 r-1x3r274"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="css-1jxf684 r-bcqeeo r-1ttztb7 r-qvutc0 r-poiln3 r-1adg3ll r-1g7jtus r-1x3r274"&gt;&lt;span class="css-1jxf684 r-bcqeeo r-1ttztb7 r-qvutc0 r-poiln3"&gt;&lt;span class="css-1jxf684 r-bcqeeo r-1ttztb7 r-qvutc0 r-poiln3 r-1x3r274"&gt;Best regards,&lt;/span&gt;&lt;br /&gt;Iwo&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;p&gt;&lt;span class="css-1jxf684 r-bcqeeo r-1ttztb7 r-qvutc0 r-poiln3"&gt;&lt;span class="css-1jxf684 r-bcqeeo r-1ttztb7 r-qvutc0 r-poiln3 r-1x3r274"&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Main.c:&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;div class="css-175oi2r r-1adg3ll r-ag158w r-dnmrzs r-1yx7oqi r-13qz1uu"&gt;
&lt;div class="css-175oi2r r-dnmrzs r-1adg3ll r-13qz1uu" data-testid="markdown-code-block"&gt;
&lt;pre&gt;&lt;code class="language-c"&gt;#include &amp;lt;zephyr/kernel.h&amp;gt;
#include &amp;lt;zephyr/logging/log.h&amp;gt;
#include &amp;lt;zephyr/bluetooth/bluetooth.h&amp;gt;
#include &amp;lt;zephyr/bluetooth/conn.h&amp;gt;
#include &amp;lt;zephyr/bluetooth/uuid.h&amp;gt;
#include &amp;lt;zephyr/bluetooth/gatt.h&amp;gt;
#include &amp;lt;bluetooth/gatt_dm.h&amp;gt;
#include &amp;lt;bluetooth/scan.h&amp;gt;
#include &amp;lt;zephyr/bluetooth/att.h&amp;gt;
#include &amp;lt;zephyr/device.h&amp;gt;
#include &amp;lt;zephyr/drivers/gpio.h&amp;gt;
#include &amp;lt;zephyr/bluetooth/addr.h&amp;gt;

LOG_MODULE_REGISTER(central_lamp, CONFIG_LOG_DEFAULT_LEVEL);

#define MAX_LAMPS 2

static struct bt_conn *current_conn = NULL;
static uint16_t cmd_handle = 0;
static bool discovered = false;
static int current_lamp = 0;

static struct bt_uuid_16 service_uuid = BT_UUID_INIT_16(0xFFE5);
static struct bt_uuid_16 cmd_uuid = BT_UUID_INIT_16(0xFFE9);

static const uint8_t on_cmd[] = {0x3a, 0x26, 0xa3, 0x0d, 0x40, 0xb2, 0x01, 0x00, 0xff, 0x2d, 0x64, 0x19, 0xff, 0xff, 0xff, 0xff, 0x0a, 0x78, 0x07, 0x0d, 0x0a};
static const uint8_t off_cmd[] = {0x3a, 0x26, 0xa3, 0x0d, 0x40, 0xb2, 0x00, 0x00, 0xff, 0x2d, 0x64, 0x19, 0xff, 0xff, 0xff, 0xff, 0x0a, 0x77, 0x07, 0x0d, 0x0a};

static bt_addr_le_t target_addrs[MAX_LAMPS] = {
    {.type = BT_ADDR_LE_PUBLIC, .a.val = {0xEC, 0xEA, 0xA8, 0x07, 0x60, 0x57}},  // Lamp 1
    {.type = BT_ADDR_LE_PUBLIC, .a.val = {0xA0, 0xA1, 0x2B, 0xC4, 0xB2, 0x40}}   // Lamp 2
};

/* LED setup using devicetree alias led0 (LED1 on nRF52840 DK) */
#define LED0_NODE DT_ALIAS(led0)
static const struct gpio_dt_spec led = GPIO_DT_SPEC_GET(LED0_NODE, gpios);

/* Debug: Log all found devices */
static void device_found(const bt_addr_le_t *addr, int8_t rssi, uint8_t type,
                         struct net_buf_simple *ad)
{
    char addr_str[BT_ADDR_LE_STR_LEN];
    bt_addr_le_to_str(addr, addr_str, sizeof(addr_str));
    LOG_INF(&amp;quot;Found device: %s (RSSI %d, type %u)&amp;quot;, addr_str, rssi, type);
}

static void scan_filter_match(struct bt_scan_device_info *device_info,
                              struct bt_scan_filter_match *filter_match,
                              bool connectable)
{
    char addr[BT_ADDR_LE_STR_LEN];
    bt_addr_le_to_str(device_info-&amp;gt;recv_info-&amp;gt;addr, addr, sizeof(addr));
    LOG_INF(&amp;quot;Filters matched. Address: %s connectable: %d&amp;quot;, addr, connectable);
}

static void scan_connecting_error(struct bt_scan_device_info *device_info)
{
    LOG_WRN(&amp;quot;Connecting failed&amp;quot;);
}

static void scan_connecting(struct bt_scan_device_info *device_info, struct bt_conn *conn)
{
    current_conn = bt_conn_ref(conn);
}

BT_SCAN_CB_INIT(scan_cb, scan_filter_match, device_found, scan_connecting_error, scan_connecting);

static void start_scan_for_lamp(const bt_addr_le_t *target)
{
    int err;

    struct bt_le_scan_param scan_param = {
        .type = BT_LE_SCAN_TYPE_ACTIVE,
        .options = BT_LE_SCAN_OPT_FILTER_DUPLICATE,
        .interval = BT_GAP_SCAN_FAST_INTERVAL,
        .window = BT_GAP_SCAN_FAST_WINDOW,
    };

    struct bt_scan_init_param scan_init = {
        .connect_if_match = 1,
        .scan_param = &amp;amp;scan_param,
        .conn_param = BT_LE_CONN_PARAM_DEFAULT,
    };

    bt_scan_init(&amp;amp;scan_init);
    bt_scan_cb_register(&amp;amp;scan_cb);

    err = bt_scan_filter_add(BT_SCAN_FILTER_TYPE_ADDR, target);
    if (err) {
        LOG_ERR(&amp;quot;Scanning filters cannot be set (err %d)&amp;quot;, err);
        return;
    }

    err = bt_scan_filter_enable(BT_SCAN_ADDR_FILTER, false);
    if (err) {
        LOG_ERR(&amp;quot;Filters cannot be enabled (err %d)&amp;quot;, err);
        return;
    }

    err = bt_scan_start(BT_SCAN_TYPE_SCAN_ACTIVE);
    if (err) {
        LOG_ERR(&amp;quot;Scanning failed to start (err %d)&amp;quot;, err);
    } else {
        LOG_INF(&amp;quot;Scan started&amp;quot;);
    }
}

static void discovery_complete(struct bt_gatt_dm *dm, void *ctx)
{
    LOG_INF(&amp;quot;Service discovery completed&amp;quot;);

    const struct bt_gatt_dm_attr *attr = bt_gatt_dm_char_by_uuid(dm, &amp;amp;cmd_uuid.uuid);
    if (attr) {
        struct bt_gatt_chrc *chrc = bt_gatt_dm_attr_chrc_val(attr);
        if (chrc) {
            cmd_handle = chrc-&amp;gt;value_handle;
            LOG_INF(&amp;quot;Found FFE9 characteristic, handle: %u&amp;quot;, cmd_handle);
            discovered = true;
        } else {
            LOG_WRN(&amp;quot;FFE9 value not found&amp;quot;);
        }
    } else {
        LOG_WRN(&amp;quot;FFE9 characteristic not found&amp;quot;);
    }

    bt_gatt_dm_data_release(dm);
}

static void discovery_service_not_found(struct bt_conn *conn, void *ctx)
{
    LOG_ERR(&amp;quot;Service not found&amp;quot;);
}

static void discovery_error(struct bt_conn *conn, int err, void *ctx)
{
    LOG_ERR(&amp;quot;Error discovering (err %d)&amp;quot;, err);
}

static const struct bt_gatt_dm_cb discovery_cb = {
    .completed = discovery_complete,
    .service_not_found = discovery_service_not_found,
    .error_found = discovery_error,
};

static void exchange_func(struct bt_conn *conn, uint8_t att_err, struct bt_gatt_exchange_params *params)
{
    if (att_err) {
        LOG_ERR(&amp;quot;MTU exchange failed (err %u)&amp;quot;, att_err);
        return;
    }

    uint16_t mtu = bt_gatt_get_mtu(conn);
    LOG_INF(&amp;quot;MTU exchange done, new MTU: %u&amp;quot;, mtu);

    int err = bt_gatt_dm_start(conn, &amp;amp;service_uuid.uuid, &amp;amp;discovery_cb, NULL);
    if (err) {
        LOG_ERR(&amp;quot;bt_gatt_dm_start failed (err %d)&amp;quot;, err);
    }
}

static void connected(struct bt_conn *conn, uint8_t conn_err)
{
    if (conn_err) {
        LOG_ERR(&amp;quot;Connection failed (err %u)&amp;quot;, conn_err);
        if (current_conn) {
            bt_conn_unref(current_conn);
            current_conn = NULL;
        }
        return;
    }

    LOG_INF(&amp;quot;Connected&amp;quot;);

    static struct bt_gatt_exchange_params exchange_params;
    exchange_params.func = exchange_func;
    int err = bt_gatt_exchange_mtu(conn, &amp;amp;exchange_params);
    if (err) {
        LOG_ERR(&amp;quot;MTU exchange failed (err %d)&amp;quot;, err);
        exchange_func(conn, 0, NULL);  // Fallback
    }
}

static void disconnected(struct bt_conn *conn, uint8_t reason)
{
    LOG_INF(&amp;quot;Disconnected (reason %u)&amp;quot;, reason);
    discovered = false;
    if (current_conn) {
        bt_conn_unref(current_conn);
        current_conn = NULL;
    }
}

BT_CONN_CB_DEFINE(conn_callbacks) = {
    .connected = connected,
    .disconnected = disconnected,
};

int main(void)
{
    int err;

    /* Initialize LED */
    if (!gpio_is_ready_dt(&amp;amp;led)) {
        LOG_ERR(&amp;quot;LED device not ready&amp;quot;);
        return -1;
    }
    err = gpio_pin_configure_dt(&amp;amp;led, GPIO_OUTPUT_ACTIVE);
    if (err &amp;lt; 0) {
        LOG_ERR(&amp;quot;LED configure failed (err %d)&amp;quot;, err);
        return -1;
    }
    LOG_INF(&amp;quot;LED initialized (should start blinking soon)&amp;quot;);

    /* Initialize Bluetooth */
    LOG_INF(&amp;quot;Initializing Bluetooth...&amp;quot;);
    err = bt_enable(NULL);
    if (err) {
        LOG_ERR(&amp;quot;Bluetooth init failed (err %d)&amp;quot;, err);
        return -1;
    }
    LOG_INF(&amp;quot;Bluetooth initialized&amp;quot;);

    int current_lamp = 0;

    while (1) {
        LOG_INF(&amp;quot;Starting cycle for lamp %d&amp;quot;, current_lamp + 1);

        discovered = false;
        start_scan_for_lamp(&amp;amp;target_addrs[current_lamp]);

        // Wait for connection and discovery (with timeout)
        int timeout = 30;
        while (!discovered &amp;amp;&amp;amp; timeout &amp;gt; 0) {
            k_sleep(K_SECONDS(1));
            timeout--;
        }

        if (discovered) {
            err = bt_gatt_write_without_response(current_conn, cmd_handle, on_cmd, sizeof(on_cmd), false);
            if (err) {
                LOG_ERR(&amp;quot;Write ON failed (err %d)&amp;quot;, err);
            } else {
                LOG_INF(&amp;quot;Sent ON command successfully&amp;quot;);
            }
            k_sleep(K_SECONDS(1));

            err = bt_gatt_write_without_response(current_conn, cmd_handle, off_cmd, sizeof(off_cmd), false);
            if (err) {
                LOG_ERR(&amp;quot;Write OFF failed (err %d)&amp;quot;, err);
            } else {
                LOG_INF(&amp;quot;Sent OFF command successfully&amp;quot;);
            }
            k_sleep(K_SECONDS(1));

            // Disconnect
            err = bt_conn_disconnect(current_conn, BT_HCI_ERR_REMOTE_USER_TERM_CONN);
            if (err) {
                LOG_ERR(&amp;quot;Disconnect failed (err %d)&amp;quot;, err);
            } else {
                LOG_INF(&amp;quot;Disconnected&amp;quot;);
            }
            k_sleep(K_SECONDS(1));  // Wait for disconnect to complete
        } else {
            LOG_ERR(&amp;quot;Failed to connect/discover lamp %d - retrying&amp;quot;, current_lamp + 1);
        }

        current_lamp = (current_lamp + 1) % MAX_LAMPS;

        gpio_pin_toggle_dt(&amp;amp;led);
    }

    return 0;
}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code class="language-c"&gt;&lt;/code&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;strong&gt;Prj.conf:&lt;/strong&gt;&lt;br /&gt;
&lt;div class="css-175oi2r r-1adg3ll r-ag158w r-dnmrzs r-1yx7oqi r-13qz1uu"&gt;
&lt;div class="css-175oi2r r-dnmrzs r-1adg3ll r-13qz1uu" data-testid="markdown-code-block"&gt;
&lt;div class="css-175oi2r r-1awozwy r-1fkb3t2 r-1fs5b29 r-1idry7j r-6413gk r-43g30s r-l4nmg1 r-1u658rm r-2dysd3 r-vmopo1 r-13qz1uu r-gtdqiz r-1fhadnw r-184en5c"&gt;&lt;span class="css-1jxf684 r-bcqeeo r-1ttztb7 r-qvutc0 r-1aiqnjv r-n6v787"&gt;&lt;/span&gt;
&lt;div class="css-175oi2r r-xoduu5 r-1ybcz0z"&gt;
&lt;div class="css-175oi2r r-xoduu5"&gt;&lt;span class="css-1jxf684 r-dnmrzs r-1udh08x r-1udbk01 r-3s2u2q r-bcqeeo r-1ttztb7 r-qvutc0 r-poiln3 r-1b43r93 r-1cwl3u0"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;# Enable BLE stack as central with GATT client&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_BT&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_BT_CENTRAL&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_BT_SMP&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_BT_GATT_CLIENT&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span&gt;# Enable scanning&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_BT_SCAN&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_BT_SCAN_FILTER_ENABLE&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_BT_SCAN_ADDRESS_CNT&lt;/span&gt;&lt;span&gt;=2&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span&gt;# Enable GATT discovery manager&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_BT_GATT_DM&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span&gt;# Increase MTU and buffer sizes for 21-byte writes&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_BT_L2CAP_TX_MTU&lt;/span&gt;&lt;span&gt;=65&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_BT_BUF_ACL_TX_SIZE&lt;/span&gt;&lt;span&gt;=69&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_BT_BUF_ACL_RX_SIZE&lt;/span&gt;&lt;span&gt;=69&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span&gt;# Logging and heap&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_LOG&lt;/span&gt;&lt;span&gt;=y&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_HEAP_MEM_POOL_SIZE&lt;/span&gt;&lt;span&gt;=2048&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE&lt;/span&gt;&lt;span&gt;=2048&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span&gt;# Multi-connection (Nordic suggestions)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_BT_MAX_CONN&lt;/span&gt;&lt;span&gt;=2&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_BT_CTLR_SDC_PERIPHERAL_COUNT&lt;/span&gt;&lt;span&gt;=0&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_BT_CONN_TX_MAX&lt;/span&gt;&lt;span&gt;=5&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;CONFIG_BT_L2CAP_TX_BUF_COUNT&lt;/span&gt;&lt;span&gt;=5&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multi-Connection BLE Central on nRF52840DK (nRF Connect SDK v3.2.1)</title><link>https://devzone.nordicsemi.com/thread/559025?ContentTypeID=1</link><pubDate>Mon, 19 Jan 2026 13:19:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2aaec37d-3498-47ff-9abc-71ef37847f83</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Iwo,&amp;nbsp;&lt;br /&gt;&lt;br /&gt;It should be quite straight forward to support multiple central links. I&amp;#39;m not so sure why you have those problems. But please try:&amp;nbsp;&lt;br /&gt;- Increase&amp;nbsp;CONFIG_BT_MAX_CONN to 3 for example, there is a chance that a connection is not terminated before you create a new connection.&lt;/p&gt;
&lt;p&gt;- Make sure you set&amp;nbsp;CONFIG_BT_CTLR_SDC_PERIPHERAL_COUNT=0 if you don&amp;#39;t plan to have any connection to another central.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;- I assume you are testing with a 3rd party lamp ? Please try to test with a set up with a peripheral you have full control of. Would suggest to start the test with 3 DK, 2 DK act as peripheral and one as central&lt;/p&gt;
&lt;p&gt;- Please use &lt;a href="https://academy.nordicsemi.com/courses/bluetooth-low-energy-fundamentals/lessons/lesson-6-bluetooth-le-sniffer/"&gt;nRF Sniffer &lt;/a&gt;to get more insight on what could be wrong.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;- It&amp;#39;s a bit old but maybe still useful, please take a look at this post&amp;nbsp;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/guides/nrf-connect-sdk-guides/b/software/posts/enter-the-multi-nus-a-simple-wireless-uart-network"&gt;Enter the Multi-NUS: A Simple Wireless UART Network&lt;/a&gt;&amp;nbsp;At the end of the post there is a github repo that you can test.&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>