maxnowack / homebridge-eq3ble

Homebridge plugin to control EQ3 bluetooth thermostats
GNU General Public License v3.0
21 stars 8 forks source link

homebridge-eq3ble is not connecting #1

Closed Kwutzke closed 7 years ago

Kwutzke commented 7 years ago

Hi Max, nice work so far.. The problem is, that the plugin isn't able to connect to my device. See the screenshots.. screenshot at nov 15 09-43-21 screenshot at nov 15 09-46-08

maxnowack commented 7 years ago

There is a connection timeout of 3 minutes. It looks like the plugin is hitting this limit. Can you try to connect the thermostat via bluetoothctl or something similar? Does this work?

Kwutzke commented 7 years ago

That works.

[bluetooth]# connect 00:1A:22:07:XX:XX
Attempting to connect to 00:1A:22:07:XX:XX
Connection successful
[bluetooth]#

It is also possible to change the temperature with:

gatttool -b 00:1A:22:07:XX:XX --char-write-req --char-write-req --handle=0x0411 --value="4128E"
Characteristic value was written successfully
maxnowack commented 7 years ago

Can you try to use v1.0.1? It seems, that this is an issue with the current version.

Kwutzke commented 7 years ago

It's still not possible to control the device, but there is something going on between the raspberry and the thermostat.

[11/15/2016, 1:49:45 PM] Homebridge is running on port 51826.
[11/15/2016, 1:49:47 PM] [Thermostat] connecting to thermostat (00:1A:22:07:92:B7)
noble: unknown peripheral 001a220792b7 connected!
noble: unknown peripheral 001a220792b7 disconnected!
noble: unknown peripheral 001a220792b7 connected!
noble: unknown peripheral 001a220792b7 disconnected!
noble: unknown peripheral 001a220792b7 connected!
noble: unknown peripheral 001a220792b7 disconnected!
[CHG] Device 00:1A:22:07:92:B7 Connected: yes
[CHG] Device 00:1A:22:07:92:B7 Connected: no
[DEL] Device 00:1A:22:07:92:B7 CC-RT-BLE
[CHG] Device 2C:B4:3A:06:CD:99 RSSI: -94
[CHG] Device 60:03:08:B0:47:4E RSSI: -74
[NEW] Device 00:1A:22:07:92:B7 CC-RT-BLE
[CHG] Device C8:69:CD:72:B3:7A RSSI: -47
[CHG] Device 2C:B4:3A:06:CD:99 RSSI: -81
[CHG] Device 00:1A:22:07:92:B7 Connected: yes
[CHG] Device 00:1A:22:07:92:B7 Connected: no
[DEL] Device 00:1A:22:07:92:B7 CC-RT-BLE
[NEW] Device 00:1A:22:07:92:B7 CC-RT-BLE
[CHG] Device C8:69:CD:72:B3:7A RSSI: -63
[CHG] Device 00:1A:22:07:92:B7 Connected: yes
[CHG] Device 00:1A:22:07:92:B7 Connected: no
[DEL] Device 00:1A:22:07:92:B7 CC-RT-BLE
[CHG] Device 60:03:08:B0:47:4E RSSI: -82
[NEW] Device 00:1A:22:07:92:B7 CC-RT-BLE
maxnowack commented 7 years ago

hmm. Can you try to manually pair the raspberry and the thermostat via bluetoothctl? Are the devices already paired?

maxnowack commented 7 years ago

@Kwutzke I've just published v1.1.0 and improved the whole discover and connect logic. Hopefully this issue is also fixed.

aleksandrsivanovs commented 7 years ago

Hi!

I have the same problem with eq-3 ble and raspberry pi 2:

[11/19/2016, 12:33:59 PM] [Bedroom Thermostat] cannot discover thermostat (00:1A:22:06:69:85)
(node:4522) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): discovering thermostat timed out (00:1A:22:06:69:85)
noble warning: unknown handle 64 disconnected!

(node:4522) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): TypeError: Cannot create property 'isError' on string 'discovering thermostat timed out (00:1A:22:06:69:85)'
(node:4522) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 3): TypeError: Cannot create property 'isError' on string 'discovering thermostat timed out (00:1A:22:06:69:85)'
(node:4522) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 4): TypeError: Cannot create property 'isError' on string 'discovering thermostat timed out (00:1A:22:06:69:85)'
(node:4522) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 5): TypeError: Cannot create property 'isError' on string 'discovering thermostat timed out (00:1A:22:06:69:85)'
(node:4522) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 6): TypeError: Cannot create property 'isError' on string 'discovering thermostat timed out (00:1A:22:06:69:85)'
(node:4522) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 7): TypeError: Cannot create property 'isError' on string 'discovering thermostat timed out (00:1A:22:06:69:85)'
(node:4522) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 8): TypeError: Cannot create property 'isError' on string 'discovering thermostat timed out (00:1A:22:06:69:85)'
noble: unknown peripheral null connected!

question: do I need to set paring key somewhere in the config?

and, yes, the same strange thing with bluetoothctl and thermostat, I'm guessing I have the same problem as @Kwutzke:

[NEW] Device 00:1A:22:06:69:85 CC-RT-BLE
[CHG] Device 00:1A:22:06:69:85 Connected: yes
[CHG] Device 00:1A:22:06:69:85 Connected: no
[CHG] Device 00:1A:22:06:69:85 Connected: yes
[CHG] Device 00:1A:22:06:69:85 Connected: no
[CHG] Device 00:1A:22:06:69:85 Connected: yes
[CHG] Device 00:1A:22:06:69:85 Connected: no
[CHG] Device 00:1A:22:06:69:85 Connected: yes
aleksandrsivanovs commented 7 years ago

found one issue in configuration - the MAC address should be lowercased - do you want me to prepare PR to fix this? do you know if this is true for all MAC addresses on all platforms (for noble)?

this helped me to proceed further to connection phase, however it's disconnected straight away:

[11/19/2016, 4:18:07 PM] [Bedroom Thermostat] discovered thermostat (00:1a:22:06:69:85)
[11/19/2016, 4:18:07 PM] [Bedroom Thermostat] connecting to thermostat (00:1a:22:06:69:85)
[11/19/2016, 4:18:07 PM] [Bedroom Thermostat] cannot connect to thermostat (00:1a:22:06:69:85)
Kwutzke commented 7 years ago

Same here..


[11/29/2016, 1:13:04 PM] [Thermostat] connecting to thermostat (00:1a:22:07:92:b7)
noble: unknown peripheral 001a220792b7 connected!
[11/29/2016, 1:14:04 PM] [Thermostat] connection to thermostat timed out (00:1a:22:07:92:b7)
[11/29/2016, 1:14:04 PM] [Thermostat] discovering thermostat (00:1a:22:07:92:b7)
noble: unknown peripheral 001a220792b7 disconnected!
[11/29/2016, 1:14:36 PM] [Thermostat] discovered thermostat (00:1a:22:07:92:b7)
[11/29/2016, 1:14:36 PM] [Thermostat] connecting to thermostat (00:1a:22:07:92:b7)
noble: unknown peripheral 001a220792b7 connected!
maxnowack commented 7 years ago

no it's not fixed. Now I have a similar issue. While it works on my mac, it doesn't on the raspberry pi:

[12/5/2016, 10:29:04 PM] [Thermostat] discovered thermostat (00:1a:22:07:48:7f)
[12/5/2016, 10:29:08 PM] [Thermostat] connecting to thermostat (00:1a:22:07:48:7f)
[12/5/2016, 10:29:08 PM] [Thermostat] cannot connect to thermostat (00:1a:22:07:48:7f)
[12/5/2016, 10:29:08 PM] [Thermostat] discovering thermostat (00:1a:22:07:48:7f)
[12/5/2016, 10:29:13 PM] [Thermostat] discovered thermostat (00:1a:22:07:48:7f)
[12/5/2016, 10:29:13 PM] [Thermostat] connecting to thermostat (00:1a:22:07:48:7f)
[12/5/2016, 10:29:13 PM] [Thermostat] cannot connect to thermostat (00:1a:22:07:48:7f)

It seems, that the discovery is successful. But an error occurs while connecting. I'll add some more verbose logging.

aleksandrsivanovs commented 7 years ago

btw, for me the thing was fixed with actual thermostat firmware update (via the calor BT app, as it's advised in manual). currently I'm on 1.10 firmware and do not observe any problems

maxnowack commented 7 years ago

Hmm, I'm already at the latest version

maxnowack commented 7 years ago

It's working fine after a reboot. I've added verbose logging. I'll close this issue for now.