← index #15205Issue #11443
Duplicate · high · value 3.379
QUERY · ISSUE

ImportError: No module named 'bluetooth'

openby RobeAlVaopened 2024-06-04updated 2024-09-08
docs

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

CANDIDATE · ISSUE

XIAO nrf52840 Sense

closedby gassechenopened 2023-05-08updated 2023-05-08
bug

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

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied