Skip to main content

Xiaomi Mi / Nb BLE - Python Lib + CLI

Installation

pip install miauth

Or clone this repository and run pip install -e inside the cloned directory.

Running tests

python -m pytest or tox in project main directory.

Usage examples

After installation, you will have access to the miauth command line interface (cli):

  1. Register / pair with device via Mi EC protocol (generates 'mi_token' file): miauth <device_mac> --register
  2. Login and retrieve serial number and firmware version via Mi EC protocol: miauth -s -v <device_mac>
  3. Retrieve serial number and firmware version via M365 protocol: miauth --m365 -s -v <device_mac>
  4. Authenticate and retrieve serial number and firmware version via Nb protocol: miauth --nb -s -v <device_mac>

For a full list of the possible commands run miauth -h.

Note: Registering / pairing with devices unpairs the device from all other apps! If you want to use your device with other apps after pairing, either reinstall or remove / re-add the device inside the app.

License

See LICENSE.md

Disclaimer

I'm in no way affiliated with Xiaomi or any of their subsidiaries and products. This code has been provided for research purposes only.

Release files for miauth 0.9.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for miauth 0.9.7
File Size Uploaded
miauth-0.9.7.tar.gz 27.0 kB Details

Release files / miauth-0.9.7.tar.gz

Download URL miauth-0.9.7.tar.gz
Size 27.0 kB
Tags Source
SHA-256 checksum
How to use checksums
dbfe271489e9758f1f6ff6feb178604fa64fb4480157e2873322e7c48a7acbf5
BLAKE2b-256 checksum
How to use checksums
df5cfc84f087ef841b01c184ab269c77a45f7799e99203405d9f3658f76b5ee9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.8

Release history Release notifications | RSS feed

This release

0.9.7 This release

1 release file

0.9.6

1 release file

0.9.4

1 release file

0.9.3

1 release file

0.9.2

2 release files

0.9.1

2 release files

0.9.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page