Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ToneService inoperative on Clue? #6786

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
tlyu opened this issue Aug 19, 2022 · 7 comments · Fixed by #6800
Closed

ToneService inoperative on Clue? #6786

tlyu opened this issue Aug 19, 2022 · 7 comments · Fixed by #6800
Labels
ble nordic regression Things that used to work but don't any longer
Milestone

Comments

@tlyu
Copy link

tlyu commented Aug 19, 2022

This might be a larger issue, but the Clue is the only BLE-capable board that I have at the moment.

The ToneService part of the Bluefruit Playground example doesn't seem to work when connecting with the Bluefruit Playground iOS app. It also doesn't seem to work with the Web Bluetooth Dashboard. The corresponding service in the Arduino version of the Bluefruit Playground firmware does seem to work.

Adding debugging print statements to show the value of tone_svc.tone seems to show that it's always None.

A stripped-down script that only advertises ToneService also does not work.

Does this work on other boards? Any debugging hints?

The main difference I can see by reading the code is that ToneService uses a fixed-length characteristic, while AddressiblePixelService is not fixed-length.

@tlyu
Copy link
Author

tlyu commented Aug 20, 2022

Some experimentation with modifying tone_service.py reveals that setting max_length=7 is sufficient to allow it to receive packets from the Web Dashboard, but for some reason, max_length=8 is necessary for it to receive packets from the Bluefruit Playground iOS app. fixed_length=True doesn't seem to be the cause of the problem.

This seems quite confusing and mysterious. I wasn't able to find an obvious way that the corresponding Arduino libraries work around this issue, if they do.

@dhalbert
Copy link
Collaborator

This is confusing because we certainly tested it, and it used to work. It might be interesting to try it with the last CircuitPython 6.x.x, with libraries from the 6.x bundle: https://learn.adafruit.com/welcome-to-circuitpython/frequently-asked-questions#faq-3105289

@tlyu
Copy link
Author

tlyu commented Aug 20, 2022

This is confusing because we certainly tested it, and it used to work. It might be interesting to try it with the last CircuitPython 6.x.x, with libraries from the 6.x bundle: https://learn.adafruit.com/welcome-to-circuitpython/frequently-asked-questions#faq-3105289

Tested with adafruit-circuitpython-clue_nrf52840_express-en_US-6.3.0.uf2 and the 6.x library bundle (and corresponding example program). Works with both Web Dashboard and Bluefruit Playground iOS.

There don't seem to be any relevant differences from the latest code in this the CircuitPython_BLE_Adafruit repo and the 1.3.1 in the 6.x bundle, so maybe it's a change in the CircuitPython core or stuff relating to the nRF softdevice?

@dhalbert
Copy link
Collaborator

There have been various changes in the nRF BLe code, so this does sound like a core problem, not a library problem. I'll transfer this issue to CircuitPython itself.

@dhalbert dhalbert transferred this issue from adafruit/Adafruit_CircuitPython_BLE_Adafruit Aug 20, 2022
@dhalbert dhalbert added this to the 8.0.0 milestone Aug 20, 2022
@tlyu
Copy link
Author

tlyu commented Aug 20, 2022

I think this also counts as a regression from 6.x to 7.x, and should probably be labeled as such.

@dhalbert dhalbert added the regression Things that used to work but don't any longer label Aug 20, 2022
@tlyu
Copy link
Author

tlyu commented Aug 28, 2022

I found the build artifacts, and successfully tested the tone service against iOS Bluefruit Playground and the Web Bluefruit Dashboard. Thanks!

You might want to manually link this issue to #6800, because GitHub didn't do it automatically. (The PR is not targeted at the default branch of the repository, etc.)

@dhalbert dhalbert linked a pull request Aug 28, 2022 that will close this issue
@tlyu
Copy link
Author

tlyu commented Aug 28, 2022

Hm, that didn't close it? Let's see if this does.

@tlyu tlyu closed this as completed Aug 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ble nordic regression Things that used to work but don't any longer
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants