Code Monkey home page Code Monkey logo

xiaomi_ble_monitor's Introduction

xiaomi_ble_monitor

GitHub License Run environment Test result

支持实时获取小米蓝牙温度湿度计2数据,并且通过Mqtt上传到云服务器。 需要在支持蓝牙的硬件上运行,树莓派4B测试通过。

安装准备

pip3 install bluepy

pip3 install paho-mqtt

执行命令

python3 mqtt_report_data.py -d -h mqtt.test -i test_locator_gateway -k 60 -p 1883 -u test -P test -v -t "/read-property"

执行结果

Sending CONNECT (u1, p1, wr0, wq0, wf0, c1, k60) client_id=b'test_locator_gateway'

Sending SUBSCRIBE (d0, m1) [(b'/read-property', 0)]

Received CONNACK (0, 0)

rc: 0

Received SUBACK

Result(temperature=27.89, humidity=67, voltage=2.797, battery=63.2)

{"deviceId": "LYWSD03MMC","properties": {"temperature":"27.89","humidity":"67","battery":"63.2"}}

Sending PUBLISH (d0, q0, r0, m2), 'b'/report-property'', ... (97 bytes)

Result(temperature=27.89, humidity=67, voltage=2.797, battery=63.2)

{"deviceId": "LYWSD03MMC","properties": {"temperature":"27.89","humidity":"67","battery":"63.2"}}

Sending PUBLISH (d0, q0, r0, m3), 'b'/report-property'', ... (97 bytes)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.