Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xiaomi LYWSD03MMC #7

Open
mattnj1975 opened this issue Nov 19, 2024 · 3 comments
Open

Xiaomi LYWSD03MMC #7

mattnj1975 opened this issue Nov 19, 2024 · 3 comments

Comments

@mattnj1975
Copy link

Hi,
I am trying to connect 4 of these Xiaomi LYWSD03MMC, they show up in the plugin, but I can only add 1 (just get errors if I try and add any more, and it only shows me the signal strength in SignalK...
Do i need to flash them with the custom firmware and/or get the encryption key?
I have tried to connect using the tool:-

https://atc1441.github.io/TelinkFlasher.html

But it doesnt seem to get the MiBindKey anymore....

Will this work with LYWSD03MMC out of the box?

Thanks

@mattnj1975
Copy link
Author

Nov 19 12:45:01 2024-11-19T12:45:01.319Z bt-sensors-plugin-sk Waiting on A4:C1:38:87:7A:D2
Nov 19 12:45:02 2024-11-19T12:45:02.323Z bt-sensors-plugin-sk Found A4:C1:38:87:7A:D2
Nov 19 12:45:02 2024-11-19T12:45:02.352Z bt-sensors-plugin-sk Sensor at A4:C1:38:87:7A:D2 unavailable. Reason: TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received undefined
Nov 19 12:45:02 2024-11-19T12:45:02.353Z bt-sensors-plugin-sk TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received undefined at new NodeError (node:internal/errors:405:5) at Function.from (node:buffer:333:9) at XiaomiMiBeacon.decryptV4and5 (/home/pi/.signalk/node_modules/bt-sensors-plugin-sk/sensor_classes/XiaomiMiBeacon.js:154:70) at XiaomiMiBeacon.propertiesChanged (/home/pi/.signalk/node_modules/bt-sensors-plugin-sk/sensor_classes/XiaomiMiBeacon.js:170:24) at XiaomiMiBeacon.listen (/home/pi/.signalk/node_modules/bt-sensors-plugin-sk/BTSensor.js:573:14) at /home/pi/.signalk/node_modules/bt-sensors-plugin-sk/index.js:363:57 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

@mattnj1975
Copy link
Author

i have actually resolved this by flashing all the devices with custom firmware.

@naugehyde
Copy link
Owner

Great! Flashing with ATC (when you can) is the preferred solution.

The error occurred because the encryption key config variable wasn't set. Which reminds me that I need to add support for required config fields with better runtime checking in general. So, thank you!

In answer to your question, theoretically yes, the plugin supports the Xiaomi out of the box BUT (big but) only with GATT connections which have proven unreliable on some hardware (see warning).

Theoretically, you should have been able to connect all four via GATT connections and get data. Which could have caused other problems with other sensors -- I don't know. I've only tested with one Xiaomi device. And when connecting via GATT it'd occasionally blow up the entire Bluetooth stack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants