1

Why doesn't ubluetooth appear in the MicroPython docs? Where does the library come from?
I am able to import both of these libraries in a micropython shell on an ESP32 devkit:

ubluetooth -- from mPython, docs here
bluetooth -- from MicroPython, docs here

2
  • 2
    Those links are both to the same page. Commented Apr 11, 2022 at 0:33
  • Thanks for letting me know! I changed the link. Commented Apr 12, 2022 at 1:35

1 Answer 1

2

What version of MicroPython is running on the DevKit? It will depend on where the build came from and what libraries are frozen into the build. In v1.18 of MicroPython, support is in the bluetooth library.

From https://docs.micropython.org/en/latest/library/index.html

MicroPython provides built-in modules that mirror the functionality of the Python standard library (e.g. os, time), as well as MicroPython-specific modules (e.g. bluetooth, machine).

Most standard library modules implement a subset of the functionality of the equivalent Python module, and in a few cases provide some MicroPython-specific extensions (e.g. array, os)

... and also, importantly:

In most cases, the above modules are actually named umodule rather than module, but MicroPython will alias any module prefixed with a u to the non-u version. However a file (or frozen module) named module.py will take precedence over this alias.

This should explain the behaviour that you are seeing.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.