[Python] How to change the Bluetooth name of the Raspberry pico 2W?

Discussão em 'Python' iniciado por Stack, Março 9, 2025.

  1. Stack

    Stack Membro Participativo

    Currently, I want to change the Name of the Pico 2W device displayed on the nRF Connect app. I am using Micro Pico in VsCode. I tried many things but the Name is always "N/A".


    `import bluetooth
    from time import sleep


    bluetooth.BLE().active(True)
    ble = bluetooth.BLE()


    device_name = 'PicoW_Device'


    advertising_data = b'\x02\x01\x06\x03\x03\x0F\x18\x09' + bytes(device_name, 'utf-8')


    ble.gap_advertise(100, adv_data=advertising_data)

    print(f"The Name of the device is currently: {device_name}")

    while True:
    sleep(1)


    `

    I tried to change the name, but it always displayed N/A

    Continue reading...

Compartilhe esta Página