fantasytu / homebridge-mijia-thermometer

Homebridge plugin for the Xiaomi Mi Bluetooth Temperature and Humidity Sensor
Apache License 2.0
25 stars 2 forks source link

Can't connect in case of offset error #2

Closed iliya2003 closed 2 years ago

iliya2003 commented 2 years ago

Hello my friend! Still trying to connect to two sensors but getting such error:

[16/09/2021, 15:02:27] [Test Temperature & Humidity] a4:c1:38:66:7d:80 (LYWSD03MMC) Connecting [16/09/2021, 15:02:31] [Test Temperature & Humidity] a4:c1:38:66:7d:80 (LYWSD03MMC) Connected [16/09/2021, 15:02:32] [Test Temperature & Humidity] Device Info cached! [16/09/2021, 15:02:32] [Test Temperature & Humidity] Device Info cached! [16/09/2021, 15:02:32] [Test Temperature & Humidity] Device Info cached! [16/09/2021, 15:02:32] [Test Temperature & Humidity] Device Info cached! [16/09/2021, 15:02:32] [Test Temperature & Humidity] Device Info cached! [16/09/2021, 15:02:33] RangeError [ERR_OUT_OF_RANGE]: The value of "offset" is out of range. It must be >= 0 and <= 1. Received 3 at boundsError (internal/buffer.js:83:9) at Buffer.readUInt16LE (internal/buffer.js:240:5) at NobleScanner.onReadThermometer (/usr/local/lib/node_modules/homebridge-mijia-thermometer/src/noblescanner.ts:150:22) at Characteristic.emit (events.js:315:20) at Noble.onRead (/usr/local/lib/node_modules/homebridge-mijia-thermometer/node_modules/@abandonware/noble/lib/noble.js:437:20) at NobleBindings.emit (events.js:315:20) at NobleBindings.onRead (/usr/local/lib/node_modules/homebridge-mijia-thermometer/node_modules/@abandonware/noble/lib/hci-socket/bindings.js:411:8) at Gatt.emit (events.js:315:20) at Object.callback (/usr/local/lib/node_modules/homebridge-mijia-thermometer/node_modules/@abandonware/noble/lib/hci-socket/gatt.js:538:14) at Gatt.onAclStreamData (/usr/local/lib/node_modules/homebridge-mijia-thermometer/node_modules/@abandonware/noble/lib/hci-socket/gatt.js:133:26)

If i set 1 in offset parameter - it will just write to log: connecting -> connected and nothing more.

Node.js v14.15.0

NPM v6.14.8

P.S. can't send you an email, because deamon tells that email is not working. Maybe you have another one?

fantasytu commented 2 years ago

Just pushed a new version. Offset issue fixed.

iliya2003 commented 2 years ago

same issue after update: [27/09/2021, 10:56:32] [Test Temperature & Humidity] a4:c1:38:50:13:6e (LYWSD03MMC) Connected [27/09/2021, 10:56:33] [Test Temperature & Humidity] Device Info cached! [27/09/2021, 10:56:33] [Test Temperature & Humidity] Device Info cached! [27/09/2021, 10:56:33] [Test Temperature & Humidity] Device Info cached! [27/09/2021, 10:56:33] [Test Temperature & Humidity] Device Info cached! [27/09/2021, 10:56:33] [Test Temperature & Humidity] Device Info cached! [27/09/2021, 10:56:34] RangeError [ERR_OUT_OF_RANGE]: The value of "offset" is out of range. It must be >= 0 and <= 1. Received 3 at boundsError (internal/buffer.js:83:9) at Buffer.readUInt16LE (internal/buffer.js:240:5) at NobleScanner.onReadThermometer (/usr/local/lib/node_modules/homebridge-mijia-thermometer/src/noblescanner.ts:234:22) at Characteristic.emit (events.js:315:20) at Noble.onRead (/usr/local/lib/node_modules/homebridge-mijia-thermometer/node_modules/@abandonware/noble/lib/noble.js:437:20) at NobleBindings.emit (events.js:315:20) at NobleBindings.onRead (/usr/local/lib/node_modules/homebridge-mijia-thermometer/node_modules/@abandonware/noble/lib/hci-socket/bindings.js:411:8) at Gatt.emit (events.js:315:20) at Object.callback (/usr/local/lib/node_modules/homebridge-mijia-thermometer/node_modules/@abandonware/noble/lib/hci-socket/gatt.js:538:14) at Gatt.onAclStreamData (/usr/local/lib/node_modules/homebridge-mijia-thermometer/node_modules/@abandonware/noble/lib/hci-socket/gatt.js:133:26) [27/09/2021, 10:56:34] Got SIGTERM, shutting down Homebridge...

I'm using internal bluetooth adapter of Raspberry and in Home app temp and humidity are still 0.

iliya2003 commented 2 years ago

Actual version is: Homebridge Mijia Thermometer homebridge-mijia-thermometer v1.7.2 after a restart i got only: 27/09/2021, 10:57:04] [Test Temperature & Humidity] Stopped scanning. [27/09/2021, 10:57:04] [Test Temperature & Humidity] a4:c1:38:50:13:6e (LYWSD03MMC) Connecting [27/09/2021, 10:57:04] [Test Temperature & Humidity] a4:c1:38:50:13:6e (LYWSD03MMC) Connecting [27/09/2021, 10:57:20] [Test Temperature & Humidity] a4:c1:38:50:13:6e (LYWSD03MMC) Connected [27/09/2021, 10:57:20] [Test Temperature & Humidity] a4:c1:38:50:13:6e (LYWSD03MMC) Connected

But no temp and hum data in home app.