Skip to content

Instantly share code, notes, and snippets.

@madagaga
Last active April 20, 2020 07:28
Show Gist options
  • Save madagaga/cab1e6c03d0efd76a468c103ac9ddc5f to your computer and use it in GitHub Desktop.
Save madagaga/cab1e6c03d0efd76a468c103ac9ddc5f to your computer and use it in GitHub Desktop.
hcidump packet analysis for mijia BT
$hcidump --raw
> 04 3E 25 02 01 00 00 7C C2 DB A8 65 4C 19 02 01 06 15 16 95
FE 50 20 AA 01 09 7C C2 DB A8 65 4C 0D 10 04 D5 00 28 02 AB
7C C2 DB A8 65 4C => mac address
Packet size vary from 37 to 41
when 41 temp and humidity are set on the 2 last bytes before CRC
28 02 => Humidity => big endian reverse 0228 => to int => 552 => 55.2%
D5 00 => Temperature => 00D5 => 213 => 21.3°c
when 37 last byte is battery percent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment