Skip to content

start_advertising throws _bleio.BluetoothError: Unknown soft device error: 0008 for certain conditions in 6.0.0 #3731

@kevinjwalters

Description

@kevinjwalters

I just fired up Adafruit Learn: CLUE Rock, Paper, Scissors Game using Bluetooth in 6.0.0 with a fresh (20201120) set of 6.x libraries and it throws an exception as soon as it starts the relatively complicated bluetooth chatter on a CLUE.

I tried a bit of REPLing to reproduce a small example of it. This seems ok:

Adafruit CircuitPython 6.0.0 on 2020-11-16; Adafruit CLUE nRF52840 Express with nRF52840
>>> from adafruit_ble import BLERadio
>>> from adafruit_ble.advertising.adafruit import AdafruitColor
>>> ca = AdafruitColor()
>>> ca.color = 0x445566
>>> radio = BLERadio()
>>> radio.start_advertising(ca)
>>> radio.stop_advertising()
>>> radio.start_advertising(ca)
>>> radio.stop_advertising()
>>> radio.start_advertising(ca)
>>> radio.stop_advertising() ; radio.start_advertising(ca)

But this is not ok:

Adafruit CircuitPython 6.0.0 on 2020-11-16; Adafruit CLUE nRF52840 Express with nRF52840
>>> from adafruit_ble import BLERadio
>>> from adafruit_ble.advertising.adafruit import AdafruitColor
>>> ca = AdafruitColor()
>>> ca.color = 0x445566
>>> radio = BLERadio()
>>> radio.start_advertising(ca)
>>> for adv in radio.start_scan(timeout=30.0):
...     print(adv)
...     radio.stop_advertising()
...     radio.start_advertising(ca)
...
...
...
<Advertisement flags=<AdvertisingFlags general_discovery > >
Traceback (most recent call last):
  File "<stdin>", line 4, in <module>
  File "adafruit_ble/__init__.py", line 212, in start_advertising
_bleio.BluetoothError: Unknown soft device error: 0008
>>>

I'm relying on general BLE traffic in my vicinity to cause the loop to iterate and as can be seen from output first attempt at stop/start blows up. I've tried this 3 times from application and 4 times on REPL and the exception is predictable so far.

I've never seen that on 5.3.1 and I did a lot of testing there. To test 6.0.0 on the application I was also running it against 5.3.1 on another board as it's a multi-player game.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions