We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Problem found by @Erland in discord, while testing against a commercial device under development.
@Erland
A simple BLE UART (NUS) service central could not receive notifications from another device.
I was able to reproduce this using an nRF52840 acting as a NUS central and an ESP32-S3 acting as a NUS peripheral. nRF52840 to nRF52840 worked OK.
Test programs:
from adafruit_ble import BLERadio from adafruit_ble.advertising.standard import ProvideServicesAdvertisement from adafruit_ble.services.nordic import UARTService import time time.sleep(2) print("---Central---") ble = BLERadio() uart_connection = None while True: if not uart_connection: print("Scanning to connect...") for adv in ble.start_scan(ProvideServicesAdvertisement): print(".", end="") if UARTService in adv.services: uart_connection = ble.connect(adv) print("Connected") break ble.stop_scan() if uart_connection and uart_connection.connected: uart_service = uart_connection[UARTService] while uart_connection.connected: if uart_service.in_waiting: print(uart_service.read(uart_service.in_waiting))
from adafruit_ble import BLERadio from adafruit_ble.advertising.standard import ProvideServicesAdvertisement from adafruit_ble.services.nordic import UARTService import time time.sleep(2) print("---Peripheral---") ble = BLERadio() uart = UARTService() advertisement = ProvideServicesAdvertisement(uart) #time.sleep(1) while True: print("Advertising...") ble.start_advertising(advertisement) while not ble.connected: pass print("connected") while ble.connected: if uart.in_waiting: print("got", uart.read(uart.in_waiting)) uart.write(str(time.monotonic()).encode()) time.sleep(2) print("disconnected")
The text was updated successfully, but these errors were encountered:
dhalbert
Successfully merging a pull request may close this issue.
Problem found by
@Erland
in discord, while testing against a commercial device under development.A simple BLE UART (NUS) service central could not receive notifications from another device.
I was able to reproduce this using an nRF52840 acting as a NUS central and an ESP32-S3 acting as a NUS peripheral. nRF52840 to nRF52840 worked OK.
Test programs:
central
peripheral
The text was updated successfully, but these errors were encountered: