Skip to content

Receiving >20 bytes at once from Bluefruit Connect app not working #94

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

Closed
dhalbert opened this issue Jun 30, 2020 · 7 comments · Fixed by #203
Closed

Receiving >20 bytes at once from Bluefruit Connect app not working #94

dhalbert opened this issue Jun 30, 2020 · 7 comments · Fixed by #203
Labels
bug Something isn't working

Comments

@dhalbert
Copy link
Collaborator

@ Thornhill in discord says a UART message of >20 bytes from the Bluefruit Connect app to, say, ble_uart_echo_test, is dropped. Sending to/from two CircuitPython boards does work. Also, does work sending to Arduino.

Confirmed by @caternuson.

@caternuson
Copy link

Yep. Just adding results of my simple and brief test. Phone is Android. BLE Connect v3.3.2. Running this example:
https://github.com/adafruit/Adafruit_CircuitPython_BLE/blob/master/examples/ble_uart_echo_test.py

Screenshot_2020-06-30-10-25-14

Adafruit CircuitPython 5.3.0 on 2020-04-29; Adafruit ItsyBitsy nRF52840 Express with nRF52840
>>> import ble_uart
b't'
b'e'
b's'
b't'
b'\n'
b't'
b'e'
b's'
b't'
b'2'
b'\n'

@evaherrada evaherrada added the bug Something isn't working label Jul 1, 2020
@tekktrik
Copy link
Member

tekktrik commented Jun 8, 2022

Aha! I'm working on adafruit/Adafruit_CircuitPython_BluefruitConnect#16 and this seems to be blocking that, given the size of images. My testing confirms what @caternuson has described. I can continue without this I suppose, but just won't be able to receiving images from the app.

@tekktrik
Copy link
Member

@dhalbert and @caternuson I can also send longer UART between boards. Should this be transferred to the app's repo?

@dhalbert
Copy link
Collaborator Author

Maybe this is due to the app. I was afraid it is more general. There was this bug: adafruit/circuitpython#3975, but it's now fixed.

@caternuson
Copy link

Seems potentially something with the app. What's some other non-CP non-app thing we could try sending a >20 bytes message with? Just to prove a CP board will happily receive a >20 bytes message from some non-CP source.

@tekktrik
Copy link
Member

We could try to do it via Arduino I suppose. I also just got a Bluetooth sniffer, I can try to do it the other way and see if I can actually detect the problem from the app?

@dhalbert
Copy link
Collaborator Author

This is due to the default max_length for variable-length Characteristics being 20. It would be fixed by #37.

I looked at a couple of implementations of NUS (Nordic UART Service). The max length of the characteristics is not fixed by the NUS definition. Instead, it's chosen at build time, based on the maximum length on the MTU size - 3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
4 participants