You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mynewt.apache.org by Cris Frusina <cr...@frusina.com> on 2016/12/23 21:22:52 UTC

Fwd: Fwd: BLE quickly disconnects after connect on iPhone (LightBlue)

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?


Thanks,
Cris


Re: BLE quickly disconnects after connect on iPhone (LightBlue)

Posted by marko kiiskila <ma...@runtime.io>.
Hmmm, I was hoping that that the 16 mbufs would not be needed by this anymore.
I was able to reduce it back to 12 on my setup.

Can you take a look at output from console command ‘mempools’ and see
what the low water mark goes to with os_mbufs?

> On Dec 25, 2016, at 6:05 AM, Cris Frusina <cr...@frusina.com> wrote:
> 
> Hi Chris,
> 
> I've set that parameter in the syscfg.yml, it seemed to have worked. Thanks for the help!
> 
> Happy Holidays!
> 
> Cheers,
> 
> Cris
> 
> 
> On 12/24/2016 1:36 AM, Christopher Collins wrote:
>> On Sat, Dec 24, 2016 at 05:37:56AM +0100, Kevin Townsend wrote:
>>> Hi Chris,
>>>> 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
>>>> 
>>> Was the 'target syscfg set' support recently added? I don't see this in
>>> the help menu for newt based on the latest version in 'develop'?
>> No, it wasn't... I made a mistake :).  Sorry Cris, the correct command
>> is:
>> 
>>     newt target set <target-name> syscfg=MSYS_1_BLOCK_COUNT=16
>> 
>> Chris
>> 
>> 
> 


Re: Fwd: Fwd: BLE quickly disconnects after connect on iPhone (LightBlue)

Posted by Cris Frusina <cr...@frusina.com>.
Hi Chris,

I've set that parameter in the syscfg.yml, it seemed to have worked. 
Thanks for the help!

Happy Holidays!

Cheers,

Cris


On 12/24/2016 1:36 AM, Christopher Collins wrote:
> On Sat, Dec 24, 2016 at 05:37:56AM +0100, Kevin Townsend wrote:
>> Hi Chris,
>>> 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
>>>
>> Was the 'target syscfg set' support recently added? I don't see this in
>> the help menu for newt based on the latest version in 'develop'?
> No, it wasn't... I made a mistake :).  Sorry Cris, the correct command
> is:
>
>      newt target set <target-name> syscfg=MSYS_1_BLOCK_COUNT=16
>
> Chris
>
>


Re: Fwd: Fwd: BLE quickly disconnects after connect on iPhone (LightBlue)

Posted by Christopher Collins <cc...@apache.org>.
On Sat, Dec 24, 2016 at 05:37:56AM +0100, Kevin Townsend wrote:
> Hi Chris,
> > 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
> >
> Was the 'target syscfg set' support recently added? I don't see this in 
> the help menu for newt based on the latest version in 'develop'?

No, it wasn't... I made a mistake :).  Sorry Cris, the correct command
is:

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

Chris

Re: Fwd: Fwd: BLE quickly disconnects after connect on iPhone (LightBlue)

Posted by Kevin Townsend <ke...@adafruit.com>.
Hi Chris,
> 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
>
Was the 'target syscfg set' support recently added? I don't see this in 
the help menu for newt based on the latest version in 'develop'?

If this is possible from the command line I wanted to add a note on it 
to our internal documentation, but I must be on the wrong branch.

Kevin

Re: Fwd: Fwd: BLE quickly disconnects after connect on iPhone (LightBlue)

Posted by Christopher Collins <cc...@apache.org>.
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