Skip to main content

BLE sensor: Xiaomi Plant monitor

enable USB support
opkg install kmod-usb-core kmod-usb-uhci kmod-usb-ehci kmod-usb2

Get bluetooth installed on WRT first:
(assuming you already have USB support installed)

opkg install bluez-daemon  (not sure if this is required)
opkg install bluez-utils

(many things didn't look quite right in the logs so I rebooted just to be safe)
got many "Not enough free handles to register service" errors in the log... but pushing on regardless...

hciconfig hci0 up
hcitool lescan
--> my monitor showed up as "Flower care"
(which can also be retrieved with: gatttool --device="MACADDR" --char-read 0x03)

! recently I got connection refused when trying to connect with gatttool.
(confusingly) this was resolved by: btmgmt le on

reading the FW version seems to work
0x0038 - Reading returns 7 bytes - 1 byte battery level and 6 ASCII chars of firmware version
2.7.0

0x0033 - You need to write 0xA01F to this handle to enable real-time data reading
0x0035 - The actual data from the sensors, can be read only after you enable real-time data, otherwise returns zero

gatttool --device="MACADDR" --char-write-req -a 0x33 -n A01F && gatttool --device="MACADDR" --char-read -a 0x035

!there is a timing/connection issue - if these two commands aren't issued "together" I get a dummy value of: "aa bb cc dd ee ff 99 88 77 66 00 00 00 00 00 00"




Comments