ImportError: No module named 'bluetooth'
Port, board and/or hardware
XIAO Seeed Sense BLE nrF52840
MicroPython version
MicroPython v1.23.0 on 2024-06-02; XIAO nRF52840 Sense with NRF52840
Reproduction
import bluetooth
Expected behaviour
Run the code
Observed behaviour
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: no module named 'bluetooth'
Additional Information
I'm using a XIAO Seeed Sense BLE nrF52840 in Micropython where I want to initialize BLE communication but when I try to run the code I get an error that says "ImportError: no module named 'bluetooth'"
Code of Conduct
Yes, I agree
XIAO nrf52840 Sense
How to use ble?
Traceback (most recent call last):
File "<stdin>", line 4, in <module>
ImportError: no module named 'ubluetooth'
MicroPython v1.20.0-24-g867e4dd3d on 2023-04-27; XIAO nRF52840 Sense with NRF52840
Welcome to MicroPython!
For online help please visit http://micropython.org/help/.
Quick overview of commands for the board:
board.LED(n) -- create an LED object for LED n (n=1,2,3,4)
If compiled with SD=<softdevice> the additional commands are
available:
ble.enable() -- enable bluetooth stack
ble.disable() -- disable bluetooth stack
ble.enabled() -- check whether bluetooth stack is enabled
ble.address() -- return device address as text string
Control commands:
CTRL-A -- on a blank line, enter raw REPL mode
CTRL-B -- on a blank line, enter normal REPL mode
CTRL-D -- on a blank line, do a soft reset of the board
CTRL-E -- on a blank line, enter paste mode
For further help on a specific object, type help(obj)
ble.enable()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'ble' isn't defined