BLE error writing values



  • @Gijs any solution

    from network import Bluetooth
    bluetooth = Bluetooth()
    time.sleep(5)
    counter = 0
    joinService = bluetooth.service(uuid=0x2400, isprimary=True,nbr_chars=10)
    c = joinService.characteristic(uuid=0x2410, value=counter)
    while True:
        time.sleep(1)
        c.value(counter)
        counter = counter + 1
        print(counter)
    

    Traceback (most recent call last):
    File "main.py", line 17, in <module>
    OSError: Erorr while sending BLE indication/notification
    Pycom MicroPython 1.20.2.rc11 [v1.20.1.r2-296-g13594f3a3-dirty]


  • Global Moderator

    I was not aware this is the same issue, nor of any changes in the Bluetooth. Mustve been before I joined. I will take it up with the firmware team to see what we can do!

    Edit: It does seem like this is the most simple reproduction of the error. Not sure why changes were made..



  • @Gijs I think this one really needs to get fixed, it's a 3rd time in a few days someone posts the same issue.

    There was a firmware change a few months ago which means you can't update a characteristic unless there is a client connected. The firmware should really just make a note of the value (for clients connecting later and reading the characteristic) and make the test internally to decide whether it has to send a notification (if there is a client) or not (if there isn't) rather than throw an error.


  • Global Moderator

    Hi,

    There are also many other capable people on the forum, so please do not only reach out to me :)

    That said, I dont know which line is 'line 17' as I only count 11 lines and or what you are trying to achieve.

    btw. Please insert code on the forum in ``` tags, to format it correctly.

    Let me know!
    Gijs


Log in to reply
 

Pycom on Twitter