ANCS and Feather NRF52 - Data Transfer Issue

Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
jcscott
 
Posts: 20
Joined: Thu Jul 06, 2017 8:19 am

ANCS and Feather NRF52 - Data Transfer Issue

Post by jcscott »

Hello:

I've been working with the ANCS and it's example documentation which can be found here: https://learn.adafruit.com/bluefruit-nr ... de/bleancs.

I have found that although both the "ancs" and "ancs_oled" examples compile and run on the feather NRF52, I am not receiving any data following any notifications. Below is the serial monitor output after I send a text message containing the word "Hi" to the iphone which is connected to the NRF52 over bluetooth. I'll attach a picture of the OLED following the exact same procedure. Strangely, I am still able to successfully accept and decline calls using the 'A' and 'C' buttons on the OLED shield.

Would anyone have any idea why I've not receiving any data? My first thought was that perhaps there was an error in the service and characteristic stack that is generated in BLEAncs.cpp but I can't be sure.

Thanks for your help!

Bluefruit52 BLE ANCS Example
----------------------------

Go to iOS's Bluetooth settings and connect to Bluefruit52
It may appear up as 'Accessory' depending on your OS version.

BSP Library : 0.7.0
Firmware : S132 2.0.1, 0.5.0
Serial No : BANNED

Name : Bluefruit52
Max Connection : Peripheral = 1, Central = 0,
Address : xx:xx:xx:xx:xx:xx (Static)
TX Power : 4 dBm
Conn Intervals : min = 20.00 ms, max = 30.00 ms
Paired Devices :
0515 : Galaxy
0e7a : xx's iPhone
bd98 : Galaxy
df6e : xx's iPhone


[BLE] BLE_GAP_EVT_CONNECTED : Conn Handle = 0
[GAP] Conn Interval= 30.000000
Connected
Discovering DIS ... [Discover] [SVC] Handle start = 1
[BLE] BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP : Conn Handle = 0
[Discover] [SVC] Service Count: 1
[Discover] [SVC] Found 0x180A, Handle start = 25, end = 29
Discovered
[Discover] [CHR] Handle start = 25, end = 29
[BLE] BLE_GATTC_EVT_CHAR_DISC_RSP : Conn Handle = 0
[Discover] [CHR] Characteristic Count: 2
[Discover] [CHR] Found 0x2A29, handle = 27
[Discover] [DESC] Handle start = 28, end = 29
[BLE] BLE_GATTC_EVT_DESC_DISC_RSP : Conn Handle = 0
[Discover] [DESC] Descriptor Count: 2
[Discover] [DESC] Descriptor 0: uuid = 0x2803, handle = 28
[Discover] [DESC] Descriptor 1: uuid = 0x2A24, handle = 29
[BLE] BLE_GATTC_EVT_READ_RSP : Conn Handle = 0
Manufacturer: Apple Inc.
[Discover] [CHR] Handle start = 25, end = 29
[BLE] BLE_GATTC_EVT_CHAR_DISC_RSP : Conn Handle = 0
[Discover] [CHR] Characteristic Count: 2
[Discover] [CHR] Handle start = 65533, end = 29
[BLE] BLE_GATTS_EVT_WRITE : Conn Handle = 0
[BLE] BLE_GATTC_EVT_CHAR_DISC_RSP : Conn Handle = 0
[Discover] [CHR] Characteristic Count: 0
[Discover] [CHR] Gatt Status = 0x0101

Discovering ANCS ... [Discover] [SVC] Handle start = 1
[BLE] BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP : Conn Handle = 0
[Discover] [SVC] Service Count: 1
[Discover] [SVC] Found 0xF431, Handle start = 30, end = 39
[Discover] [CHR] Handle start = 31, end = 39
[BLE] BLE_GATTC_EVT_CHAR_DISC_RSP : Conn Handle = 0
[Discover] [CHR] Characteristic Count: 1
[Discover] [CHR] Found 0xD8F3, handle = 32
[Discover] [DESC] Handle start = 33, end = 39
[BLE] BLE_GATTC_EVT_DESC_DISC_RSP : Conn Handle = 0
[Discover] [DESC] Descriptor Count: 2
[Discover] [DESC] Descriptor 0: uuid = 0x2900, handle = 33
[Discover] [DESC] Descriptor 1: uuid = 0x2803, handle = 34
[Discover] [CHR] Handle start = 33, end = 39
[BLE] BLE_GATTC_EVT_CHAR_DISC_RSP : Conn Handle = 0
[Discover] [CHR] Characteristic Count: 1
[Discover] [CHR] Found 0x120D, handle = 35
[Discover] [DESC] Handle start = 36, end = 39
[BLE] BLE_GATTC_EVT_DESC_DISC_RSP : Conn Handle = 0
[Discover] [DESC] Descriptor Count: 2
[Discover] [DESC] Descriptor 0: uuid = 0x2902, handle = 36
[Discover] [DESC] Descriptor 1: uuid = 0x2803, handle = 37
[Discovery] Found CCDD: handle = 36
[Discover] [CHR] Handle start = 36, end = 39
[BLE] BLE_GATTC_EVT_CHAR_DISC_RSP : Conn Handle = 0
[Discover] [CHR] Characteristic Count: 1
[Discover] [CHR] Found 0xC6E9, handle = 38
Discovered
Attempting to PAIR with the iOS device, please press PAIR on your phone ... [BLE] BLE_GAP_EVT_SEC_PARAMS_REQUEST : Conn Handle = 0
[BLE] BLE_GAP_EVT_CONN_SEC_UPDATE : Conn Handle = 0
Done
Enabling notifications

| Event | Category (count) | Title | Message | App ID | App Name |
---------------------------------------------------------------------------------------------------------------
[BLE] BLE_EVT_TX_COMPLETE : Conn Handle = 0
[BLE] BLE_EVT_TX_COMPLETE : Conn Handle = 0
[BLE] BLE_GAP_EVT_AUTH_STATUS : Conn Handle = 0
[BLE] BLE_GATTC_EVT_CHAR_VAL_BY_UUID_READ_RSP : Conn Handle = 0
[BOND] Keys for "xxxxx's iPhone" is saved to file /adafruit/bond/051a
/adafruit/bond
|_ 0515 126 Bytes
|_ 051a 112 Bytes
|_ 0e7a 126 Bytes
|_ bd98 126 Bytes
|_ df6e 126 Bytes
[BLE] BLE_GATTC_EVT_HVX : Conn Handle = 0
| Added | Social (3) | [BLE] BLE_GATTC_EVT_WRITE_RSP : Conn Handle = 0
| [BLE] BLE_GATTC_EVT_WRITE_RSP : Conn Handle = 0
| [BLE] BLE_GATTC_EVT_WRITE_RSP : Conn Handle = 0
| [BLE] BLE_GATTC_EVT_WRITE_RSP : Conn Handle = 0
|
OLED picture
OLED picture
Webp.net-compress-image.jpg (908.01 KiB) Viewed 400 times

User avatar
hathach
 
Posts: 1271
Joined: Tue Apr 23, 2013 1:02 am

Re: ANCS and Feather NRF52 - Data Transfer Issue

Post by hathach »

try to run ancs with debug level 0, debug level 1 with tons of printf would hurt the timing of data transfer.

User avatar
jcscott
 
Posts: 20
Joined: Thu Jul 06, 2017 8:19 am

Re: ANCS and Feather NRF52 - Data Transfer Issue

Post by jcscott »

Thanks for the great suggestion hathach! Unfortunately, all though the serial monitor output is much nicer to look at with debug level 0, I still have no information being shared between devices. Once again, please see below for the debug level 0 output on serial monitor (ancs example) and oled (ancs_oled example).

I should note that I've tried this on two separate iphones now. An iphone 7 and an iphone 4s. The only other piece of info I can add at the moment is that none of the ANCS services or characteristics show up when I connect to the device with the Nordic nRF Connect app. Could this be because they are using BLEClientService and BLEClientCharacteristic instead of BLEService and BLECharacteristic? I'm not sure if client services and characteristics are meant to show up in the advertised BLE stack. I'll keep digging through the libraries to see if I can spot any issues but any further help would be appreciated!
Bluefruit52 BLE ANCS Example
----------------------------

Go to iOS's Bluetooth settings and connect to Bluefruit52
It may appear up as 'Accessory' depending on your OS version.
Connected
Discovering DIS ... Discovered
Manufacturer: Apple Inc.

Discovering ANCS ... Discovered
Attempting to PAIR with the iOS device, please press PAIR on your phone ... Done
Enabling notifications

| Event | Category (count) | Title | Message | App ID | App Name |
---------------------------------------------------------------------------------------------------------------
| Added | Missed Call (0) | | | | |
| Added | Social (1) | | | | |
| Added | Social (2) | | | | |
| Added | Social (3) | | | | |
Webp.net-compress-image (1).jpg
Webp.net-compress-image (1).jpg (867.04 KiB) Viewed 360 times

User avatar
hathach
 
Posts: 1271
Joined: Tue Apr 23, 2013 1:02 am

Re: ANCS and Feather NRF52 - Data Transfer Issue

Post by hathach »

Ok, thanks for the detail log. Seems like there is timing issue with retrieving notification contents. We will double check the ancs examples and let you know the update.

User avatar
jcscott
 
Posts: 20
Joined: Thu Jul 06, 2017 8:19 am

Re: ANCS and Feather NRF52 - Data Transfer Issue

Post by jcscott »

Thank-you very much!

User avatar
hathach
 
Posts: 1271
Joined: Tue Apr 23, 2013 1:02 am

Re: ANCS and Feather NRF52 - Data Transfer Issue

Post by hathach »

the issue is fixed in the develop branch.

To manually install develop branch via git check out
https://learn.adafruit.com/bluefruit-nr ... sp-via-git

User avatar
jcscott
 
Posts: 20
Joined: Thu Jul 06, 2017 8:19 am

Re: ANCS and Feather NRF52 - Data Transfer Issue

Post by jcscott »

Thank-you for making these changes! The ANCS data is displayed perfectly now!

If you get the chance, would you be able to point out which files you changed for this update? I spent some time trying to make changes myself with no success.

Cheers!

User avatar
hathach
 
Posts: 1271
Joined: Tue Apr 23, 2013 1:02 am

Re: ANCS and Feather NRF52 - Data Transfer Issue

Post by hathach »

jcscott wrote:Thank-you for making these changes! The ANCS data is displayed perfectly now!

If you get the chance, would you be able to point out which files you changed for this update? I spent some time trying to make changes myself with no success.

Cheers!
It is complicated involving Gatt central discovery process in corner case. We made a mistake expanding it in previous release. If you are interested in the changes, you can check the commit log in github develop branch.

Locked
Please be positive and constructive with your questions and comments.

Return to “Feather - Adafruit's lightweight platform”