Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BLEUart Device disconnects after [BLE ] BLE_EVT_USER_MEM_REQUEST : Conn Handle = 0 #220

Closed
khawajamechatronics opened this issue Jan 25, 2019 · 14 comments

Comments

@khawajamechatronics
Copy link

khawajamechatronics commented Jan 25, 2019

Hi,

I am having issue with adafruit NRF52832 device. It works fine until
[BLE ] BLE_EVT_USER_MEM_REQUEST : Conn Handle = 0
[BLE ] BLE_GAP_EVT_DISCONNECTED : Conn Handle = 0
[GAP ] Disconnect Reason 0x13
and device loses connection.

Can any one guide whats this issue and how to resolve?

Thanks

@khawajamechatronics
Copy link
Author

More Logs.

Can anyone help?

[CFG ] SoftDevice's RAM requires: 0x20002FA0
MaxMtu: 247
Please use Adafruit's Bluefruit LE app to connect in UART mode
Once connected, enter character(s) that you wish to send

BSP Library : 0.9.3
Bootloader : s132 6.1.1 r1
Serial No :

--------- SoftDevice Config ---------
Max UUID128 : 10
ATTR Table Size : 2048
Service Changed : 1
Peripheral Connect Setting

  • Max MTU : 247
  • Event Length : 6
  • HVN Queue Size : 3
  • WrCmd Queue Size: 1

--------- BLE Settings ---------
Name :
Max Connections : Peripheral = 1, Central = 0
Address : (Static)
TX Power : 4 dBm
Conn Intervals : min = 20.00 ms, max = 30.00 ms
Conn Timeout : 2000.00 ms
Peripheral Paired Devices:

@khawajamechatronics
Copy link
Author

If its not solveable on this adafruit hardware then suggest me hardware which can work without any issue.

Issue happens when data bytes are sent more than 20.

Until 20 Bytes it works fine.

@hathach
Copy link
Member

hathach commented Jan 28, 2019

First, you need to tell us how to reproduce the issue: your sketch, which app and what to send etc ... Second, don't expect us to rush fixing the issue, we are working on multiple project and has our own agenda.

If you are not happy with adafruit hardware, free fee to use others, google is your best adviser.

@khawajamechatronics
Copy link
Author

Hi,

Thanks for prompt response. I am glad to provide all the information required to reproduce the issue so you can resolve it asap.

I am using bleuart example with Adafruit nrf52832
BSP Library : 0.9.3
Bootloader : s132 6.1.1 r1

A)I have tested the bluefruit app. Only 20 bytes data is successfully received but more than that is truncated.
B)Tested with NRF Connect App.
Similar issue, 20 bytes are sent successfully but more than 20 bytes it gives

[BLE ] BLE_EVT_USER_MEM_REQUEST : Conn Handle = 0
[BLE ] BLE_GAP_EVT_DISCONNECTED : Conn Handle = 0
[GAP ] Disconnect Reason 0x13

Method to reproduce.
Upload the blueuart example.
send more than 20 characters using nrfconnect app.

image

I am have trust on Adafruit Hardware and due to that I purchased it.

Obviously you are guru and if with your little attention issue is resolved it will definitely strengthen my trust on Adafruit hardware.

Its definitely not an App Issue, Issue seems to be with Datalength as it works until 20 bytes. I hope you have some quick solution or suggestion to resolve it.

@hathach
Copy link
Member

hathach commented Jan 29, 2019

Thanks for detail information, we will try to reproduce and analyze the issue when possible

@khawajamechatronics
Copy link
Author

Any chance looking up at this?

@wlamprecht
Copy link

wlamprecht commented Feb 6, 2019

Hi @khawajamechatronics,

  1. Did you try to request a bigger MTU size?
    By clicking on the three dots in the NRF Connect App, right of "SERVER" and then "Request MTU"
  2. Does your mobile Phone have BLE 4 or BLE 5?
  3. Does it not work, when you send the data from the mobile phone app to the device or the other direction?

@khawajamechatronics
Copy link
Author

Hi @wlamprecht for prompt response.

I tested method 1. After changing MTU size it works fine,

But I need to know how can I change MTU size within Arduino Code?

@wlamprecht
Copy link

@khawajamechatronics I'm not working with Arduino. But you have to initiate the mtu size change request from the Gatt client. Look for something like GattClient exchange_mtu.

@khawajamechatronics
Copy link
Author

Hi,

Thanks for your time. My actual app is different and it works with ESP32 without sending or requesting MTU (may be MTU is already configured max in ESP32 Software) So I can't make my app to send MTU request. I need to know a way to set max MTU inside Arduino Code.

Thanks

@hathach
Copy link
Member

hathach commented Feb 11, 2019

just back from Lunar New Year, working on this issue now, it is part of the Long Write support #91

@hathach
Copy link
Member

hathach commented Feb 13, 2019

@khawajamechatronics I have implemented the LONG WRITE sequence support, that could handle > MTU bytes write (20 bytes by default) in the master branch. Please try to see if that work for you.

You will need to follow this guide to install BSP via git (master branch) to test, once verified we will include this into the next release. Thank you for your patient.

https://learn.adafruit.com/bluefruit-nrf52-feather-learning-guide/arduino-bsp-setup#advanced-option-manually-install-the-bsp-via-git-5-23

@khawajamechatronics
Copy link
Author

Hi,

Thanks for resolving the long bytes issue. Yes it working for longer data than 20 bytes.

One issue is in some internal code 'Hello' appears with each data received.

image

image

@hathach
Copy link
Member

hathach commented Apr 4, 2019

Thanks for confirming, this issue is fixed, for the Hello it is likely leftover somewhere in your code. Please open another issue if it still exists.

@hathach hathach closed this as completed Apr 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants