Re: Nimble Questions

2018-03-15 Thread Christopher Collins
Hi Ram,

On Thu, Mar 15, 2018 at 12:07:55PM +0530, Sriram V wrote:
> Hi,
> 
> I have the following doubts on NimBle:
> 
> The document says 32+ concurrent connections, multiple connections in
> simultaneous central and peripheral roles. Does that mean the "device
> running Nimble" can connect to 32 different other devices like phones?

Yes, with one caveat: each of the 32 centrals needs to be sufficiently
cooperative in choosing connection parameters (
http://www.novelbits.io/ble-connection-intervals/).  My knowledge of the
BLE link layer is pretty limited, so someone more informed may need to
chime in.  Your app might need to request different connection
parameters from the centrals (using
http://mynewt.apache.org/latest/network/ble/ble_hs/ble_gap/functions/ble_gap_update_params/).

Of course, you will also need to build the Mynewt image device with a
configuration suitable for 32 concurrent connections (e.g.,
NIMBLE_MAX_CONNECTIONS=32, etc.).

> Also, I wanted to check if the stack provides firmware upgrade
> capability and if so, can you provide an example on how it is being
> done.

The newtmgr tool (http://mynewt.apache.org/latest/newtmgr/overview/) is
used to upgrade Mynewt devices.  Newtmgr is a command line tool, but I
believe there are other client libraries available (node.js, android?).
I don't see any examples of image upgrades, but there is some
information here, under the "Image Upgrade" heading:
http://mynewt.apache.org/latest/os/modules/split/split/

> Can we upgrade multiple devices (having Nimble) at the same time using
> a single device/phone supporting BT?

It probably not the most helpful answer, but: yes, as long as the phone
can handle it.  You can certainly perform multiple simultaneous upgrades
from a computer using the newtmgr tool.  That said, I have a feeling you
will get better overall throughput if you limit yourself to one upgrade
at a time.

Chris


Re: Synthesized LF CLOCK with the nrf52840

2018-03-15 Thread Abderrezak Mekkaoui

Hi Andrzej,

Thank you for your answer. That's what I did first but it did not work. 
I have an app that runs as expected using the default LF CLOCK,  the 
XTAL_32768 used.
When I switch the LF CLOCK  to  XTAL_32768_SYNTH, the app advertises 
correctly. When I try to connect, the app disconnects after a few 
seconds of trying.

I have appended below a typical log.
I am using the nordic nrf52840 preview kit in preparation of testing a 
board that does not have an LF crystal. Right now I would like to 
evaluate quickly
both the LF RC based CLK and the synthesized CLK. In one of my use 
cases, power is not important and the device is always ON. My instincts 
tells me that the
synthesized clock is a better choice (as stable as the HF clk) and 
should have worked out of the box. Any thoughts on what  I could be 
doing wrong?
Playing around with BLE_LL_OUR_SCA, BLE_LL_MASTER_SCA and 
BLE_XTAL_SETTLE_TIME did not help. On the phone side I am using the 
nordic app (nRF Connect on android)

Best regards
Abderrezak






LOG AT START OF THE MYNEWT APP:

00 [ts=0ssb, mod=64 level=1]  BLE_PHY_MAX_PWR_DBM = 10
01 [ts=7812ssb, mod=64 level=1]  tx_pwr_lvl =8
02 [ts=15624ssb, mod=4 level=0] ble_hs_hci_cmd_send: ogf=0x03 
ocf=0x0003 len=0

04 [ts=31248ssb, mod=4 level=0] 0x03 0x0c 0x00
06 [ts=46872ssb, mod=4 level=0] Command complete: cmd_pkts=1 ogf=0x3 
ocf=0x3 status=0
08 [ts=62496ssb, mod=4 level=0] ble_hs_hci_cmd_send: ogf=0x03 
ocf=0x0001 len=8
10 [ts=78120ssb, mod=4 level=0] 0x01 0x0c 0x08 0x90 0x80 0x00 0x02 
0x00 0x00 0x00 0x20
12 [ts=93744ssb, mod=4 level=0] Command complete: cmd_pkts=1 ogf=0x3 
ocf=0x1 status=0
15 [ts=117180ssb, mod=4 level=0] ble_hs_hci_cmd_send: ogf=0x03 
ocf=0x0063 len=8
17 [ts=132804ssb, mod=4 level=0] 0x63 0x0c 0x08 0x00 0x00 0x80 0x00 
0x00 0x00 0x00 0x00
19 [ts=148428ssb, mod=4 level=0] Command complete: cmd_pkts=1 
ogf=0x3 ocf=0x63 status=0
21 [ts=164052ssb, mod=4 level=0] ble_hs_hci_cmd_send: ogf=0x08 
ocf=0x0001 len=8
23 [ts=179676ssb, mod=4 level=0] 0x01 0x20 0x08 0x7f 0x1a 0x0f 0x00 
0x00 0x00 0x00 0x00
26 [ts=203112ssb, mod=4 level=0] Command complete: cmd_pkts=1 
ogf=0x8 ocf=0x1 status=0
28 [ts=218736ssb, mod=4 level=0] ble_hs_hci_cmd_send: ogf=0x08 
ocf=0x0002 len=0

30 [ts=234360ssb, mod=4 level=0] 0x02 0x20 0x00
32 [ts=249984ssb, mod=4 level=0] Command complete: cmd_pkts=1 
ogf=0x8 ocf=0x2 status=0
34 [ts=265608ssb, mod=4 level=0] ble_hs_hci_cmd_send: ogf=0x08 
ocf=0x0003 len=0

36 [ts=281232ssb, mod=4 level=0] 0x03 0x20 0x00
38 [ts=296856ssb, mod=4 level=0] Command complete: cmd_pkts=1 
ogf=0x8 ocf=0x3 status=0
40 [ts=312480ssb, mod=4 level=0] ble_hs_hci_cmd_send: ogf=0x04 
ocf=0x0009 len=0

42 [ts=328104ssb, mod=4 level=0] 0x09 0x10 0x00
44 [ts=343728ssb, mod=4 level=0] Command complete: cmd_pkts=1 
ogf=0x4 ocf=0x9 status=0 bd_addr=ff:22:33:aa:bb:ff
46 [ts=359352ssb, mod=4 level=0] ble_hs_hci_cmd_send: ogf=0x08 
ocf=0x002d len=1

49 [ts=382788ssb, mod=4 level=0] 0x2d 0x20 0x01 0x00
50 [ts=390600ssb, mod=4 level=0] Command complete: cmd_pkts=1 
ogf=0x8 ocf=0x2d status=0
52 [ts=406224ssb, mod=4 level=0] ble_hs_hci_cmd_send: ogf=0x08 
ocf=0x0029 len=0

55 [ts=429660ssb, mod=4 level=0] 0x29 0x20 0x00
56 [ts=437472ssb, mod=4 level=0] Command complete: cmd_pkts=1 
ogf=0x8 ocf=0x29 status=0
58 [ts=453096ssb, mod=4 level=0] ble_hs_hci_cmd_send: ogf=0x08 
ocf=0x002d len=1

61 [ts=476532ssb, mod=4 level=0] 0x2d 0x20 0x01 0x01
62 [ts=484344ssb, mod=4 level=0] Command complete: cmd_pkts=1 
ogf=0x8 ocf=0x2d status=0
65 [ts=507780ssb, mod=4 level=0] ble_hs_hci_cmd_send: ogf=0x08 
ocf=0x0027 len=39
67 [ts=523404ssb, mod=4 level=0] 0x27 0x20 0x27 0x00 0x00 0x00 0x00 
0x00 0x00 0x00 0xef 0x8d 0xe2 0x16 0x4f 0xec 0x43 0x0d 0xbf 0x5b 0xdd 
0x34 0xc0 0x53 0x1e 0xb8 0xef 0x8d 0xe2 0x16 0x4f 0xec 0x43 0x0d 0xbf 
0x5b 0xdd 0x34 0xc0 0x53 0x1e 0xb8
73 [ts=570276ssb, mod=4 level=0] Command complete: cmd_pkts=1 
ogf=0x8 ocf=0x27 status=0
75 [ts=585900ssb, mod=4 level=0] ble_hs_hci_cmd_send: ogf=0x08 
ocf=0x004e len=8
78 [ts=609336ssb, mod=4 level=0] 0x4e 0x20 0x08 0x00 0x00 0x00 0x00 
0x00 0x00 0x00 0x01
80 [ts=624960ssb, mod=4 level=0] Command complete: cmd_pkts=1 
ogf=0x8 ocf=0x4e status=0

82 [ts=640584ssb, mod=4 level=0] looking up peer sec;
84 [ts=656208ssb, mod=64 level=1]  BLE_PHY_MAX_PWR_DBM =10
86 [ts=671832ssb, mod=64 level=1]  tx_pwr_lvl =8
87 [ts=679644ssb, mod=4 level=0] ble_hs_hci_cmd_send: ogf=0x08 
ocf=0x0008 len=32
89 [ts=695268ssb, mod=4 level=0] 0x08 0x20 0x20 0x19 0x02 0x01 0x06 
0x07 0x03 0x1a 0x18 0x0a 0x18 0x0f 0x18 0x06 0x09 0x43 0x4c 0x56 0x52 
0x54 0x02 0x0a 0x08 0x03 0x19 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
94 [ts=734328ssb, mod=4 level=0] Command complete: cmd_pkts=1 
ogf=0x8 ocf=0x8 status=0
97 

Re: [DISCUSSION] Moving NimBLE to separate project

2018-03-15 Thread Andrzej Kaczmarek
Hi Szymon,

On Thu, Mar 15, 2018 at 12:57 PM, Szymon Janc  wrote:
> Hi Andrzej,
>
> On Monday, 12 March 2018 15:30:52 CET Andrzej Kaczmarek wrote:
>> Hi,
>>
>> I created PR for apache-mynewt-core which removes NimBLE code and adds
>> dependency to apache-mynewy-nimble repository:
>> https://github.com/apache/mynewt-core/pull/907
>>
>> With latest changes in newt (thanks, Chris!) transition to new
>> structure is automatic - newt update will download new repository and
>> newt build will pick up all dependencies.
>>
>> apache-mynewt-nimble repository is basically rewritten history of
>> apache-mynewt-core with only commits touching NimBLE code included +
>> some directory structure reorg. Each new commit has id of original
>> commit added in commit message to make lookups easier.
>
> Since it looks like community agree with this proposal lets get this PR merged
> so that it can get some testing before next release.

All right, I'll update PR and apache-mynewt-nimble repository to
latest NimBLE code today evening (let's say not before 8pm CET / 12pm
PST) and so we can merge it.
If anyone disagrees, you still have few hours to let us know :-)

> --
> pozdrawiam
> Szymon Janc

Best regards,
Andrzej


Nimble Questions

2018-03-15 Thread Sriram V
Hi,

I have the following doubts on NimBle:

The document says 32+ concurrent connections, multiple connections in
simultaneous central and peripheral roles. Does that mean the "device
running Nimble" can connect to 32 different other devices like phones?

Also, I wanted to check if the stack provides firmware upgrade
capability and if so, can you provide an example on how it is being
done. Can we upgrade multiple devices (having Nimble) at the same time
using a single device/phone supporting BT?

Thanks,
ram