This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Multicentral Zephyr Development Examples or Documentation

I have a development environment using Zephyr; setup and working from the documentation I found for the nRF Connect SDK.  I am using SES and am able to debug the provided examples.  How do I alter the build options for the examples?  Right clicking the project only has a greyed out "Options".  I am attempting to alter the UART Central example to connect to multiple peripheral devices.  I can't find any good documentation doesn't seem to touch on this subject at all.  Starting a scan after the first device connects leads to that device immediately trying to connect again.  It appears like it reconnects automatically.  Ideally I would like to catch it during the scan phase and not enter the connection phase if I am already connected?  Also, having the scan running during UART data transmission gives me a ENOTCONN error.  Anyone try to do something similar?

Parents Reply Children
  • My device is connecting and disconnecting by itself every few seconds without power cycling.  I can't see how that could be by design.  This is my console over the course of a few seconds without touching anything after the initial power cycle of the peripheral.  Not to mention it doesn't detect any services after the initial connection.

    ***** Booting Zephyr OS v1.14.99-ncs1 *****
    Starting NUS Client example
    Bluetooth initialized
    UART initialized
    Scan module initialized
    NUS Client module initialized
    Scanning successfully started
    Filters matched. Address: e5:ac:47:28:e8:c7 (random) connectable: 1
    Connected: e5:ac:47:28:e8:c7 (random)
    Security level was raised to 2
    Service discovery completed
    Disconnected: e5:ac:47:28:e8:c7 (random) (reason 8)
    Filters matched. Address: e5:ac:47:28:e8:c7 (random) connectable: 1
    Connected: e5:ac:47:28:e8:c7 (random)
    Service not found
    Disconnected: e5:ac:47:28:e8:c7 (random) (reason 8)
    Filters matched. Address: e5:ac:47:28:e8:c7 (random) connectable: 1
    Connected: e5:ac:47:28:e8:c7 (random)
    Service not found
    Disconnected: e5:ac:47:28:e8:c7 (random) (reason 8)
    Filters matched. Address: e5:ac:47:28:e8:c7 (random) connectable: 1
    Connected: e5:ac:47:28:e8:c7 (random)
    Service not found
    Disconnected: e5:ac:47:28:e8:c7 (random) (reason 8)
    Filters matched. Address: e5:ac:47:28:e8:c7 (random) connectable: 1
    Connected: e5:ac:47:28:e8:c7 (random)
    Service not found
    Disconnected: e5:ac:47:28:e8:c7 (random) (reason 8)
    Filters matched. Address: e5:ac:47:28:e8:c7 (random) connectable: 1
    Connected: e5:ac:47:28:e8:c7 (random)
    Service not found
    Disconnected: e5:ac:47:28:e8:c7 (random) (reason 8)
    Filters matched. Address: e5:ac:47:28:e8:c7 (random) connectable: 1
    Connected: e5:ac:47:28:e8:c7 (random)
    Service not found
    Disconnected: e5:ac:47:28:e8:c7 (random) (reason 8)
    Filters matched. Address: e5:ac:47:28:e8:c7 (random) connectable: 1
    Connected: e5:ac:47:28:e8:c7 (random)

  • Yep, looks like a bug. The disconnect reason for me is either 8 or 61. Error 8 refers to Exec format error, while error 61 points to a connection refused error. See errnho.h for more details. When I tested the uart peripheral example with nRF Connect for Mobile, everything worked fine out of the box. I believe there is an issue with the uart central example. I will take a closer look & update this thread.

    Update: It seems this is a known issue, which will be fixed in a later release of NCS. Am checking if there is a workaround available now.

  • Any update on this? Im using Zephyr OS version, zephyr-v2.1.0-335-gce753ea49113, with a nrf52840. I am also attempting a multi-central application. I can connect to many centrals, but they all disconnect after about 10 seconds or so and reconnect, etc. Just like in natanbackwards description. I have tried lots of stuff to no avail. Im curious if this is still a bug, or what.

  • I am sorry for the delay. Lately, a huge portion of the support team has been on Christmas vacation. Most of the staff will be back 6 of January 2020 and you can be sure to get an answer shortly after that.

    Best regards,

    Simon

  • I gave up, and have shifted from a multi-central application to an ANT shared channel using the Nordic SDK. I hope I will have better results.

Related