Hi Chris,

On Fri, Dec 23, 2016 at 04:22:52PM -0500, Cris Frusina wrote:
> Hi All,
> 
> I'm just starting off with mynewt converting an old nrf51 project
> written with the Nordic SDK. I've compiled and uploaded the
> "bleprph_oic" example to my nrf52 custom board.
> 
> I see the device advertising with no problems, I can connect to the BLE
> device but after a few seconds it disconnects. Is there a setting I'm
> missing to keep the connection alive?

You shouldn't need to change any bluetooth settings. Part of the Mynewt
release process involves making sure LightBlue running on an iPhone
stays connected and can perform the standard GATT operations.

I generally use the bleprph and bletiny applications, so I'm not too
familiar with bleprph_oic.  In particular, I don't know if this
application reserves any mbufs up front.  One possibility is that the
bleprph_oic application is running out of mbufs while the iPhone is
performing service discovery.  I have noticed that the Apple BLE host
seems to be quite aggressive during service discovery in that it sends
lots of requests in parallel.  If the Mynewt device runs out of mbufs
during this process, it can't respond to a request, which causes the
iPhone to disconnect.  We saw this behavior when we first tested with an
iPhone, which led to increase in the default mbuf count.

Anyway, I would try one of these ideas:
    1. Use the bleprph app, rather than bleprph_oic.
    2. Increase the mbuf count to something greater than the default
       (12).

For option 2, you should modify your target's system configuration.  You
can increase the mbuf count to 16 as follows:

    newt target syscfg set <target-name> syscfg=MSYS_1_BLOCK_COUNT=16

Thanks,
Chris

Reply via email to