atrovato / gladys-awox

Managing of Awox devices with Gladys
Other
1 stars 0 forks source link

Timeout during connection #35

Closed jukeb0x closed 5 years ago

jukeb0x commented 5 years ago

Hi ! I installed Gladys from the released image, upgraded to Gladys 3.12.1 and installed your module. I have been trying to get my mesh lightbulb for a while and first, I wanted to thank for your module !

I have trouble going through the configuration part, though. Most times, the analysis fails with this type of error :

0|gladys   | AwoX module: Error: Command Disallowed (0xc)
0|gladys   |     at NobleBindings.onLeConnComplete (/home/pi/gladys/api/hooks/awox/node_modules/noble/lib/hci-socket/bindings.js:220:13)
0|gladys   |     at emitOne (events.js:116:13)
0|gladys   |     at Hci.emit (events.js:211:7)
0|gladys   |     at Hci.processCmdStatusEvent (/home/pi/gladys/api/hooks/awox/node_modules/noble/lib/hci-socket/hci.js:674:12)
0|gladys   |     at Hci.onSocketData (/home/pi/gladys/api/hooks/awox/node_modules/noble/lib/hci-socket/hci.js:469:12)
0|gladys   |     at emitOne (events.js:116:13)
0|gladys   |     at BluetoothHciSocket.emit (events.js:211:7)

After several reboots, it finally brought up my light bulb. I filled the peripheral parameters and clicked on Next. Then, I got a timeout error such as this one :

0|gladys   | AwoX module: Setting-up devices...
0|gladys   | AwoX module: Scanning bluetooth devices
0|gladys   | AwoX module: Detected peripheral a4:c1:38:99:2d:98
0|gladys   | AwoX module: Detected peripheral 34:15:13:77:1c:03
0|gladys   | AwoX module: Detected peripheral 02:7d:90:d9:f5:cf
0|gladys   | AwoX module: Detected peripheral c8:b2:1e:59:5e:c5
0|gladys   | AwoX module: Detected peripheral 64:40:b0:91:b1:11
0|gladys   | gladys.utils.sqlUnique was not able to find element
0|gladys   | Query = "SELECT * FROM device WHERE identifier = ? AND service = ?;"
0|gladys   | Params = "["a4:c1:38:99:2d:98","awox"]"
0|gladys   | AwoX module: Peripheral 64:40:b0:91:b1:11 not connectable or not public
0|gladys   | AwoX module: c8:b2:1e:59:5e:c5 is not an AwoX device
0|gladys   | AwoX module: Peripheral 02:7d:90:d9:f5:cf not connectable or not public
0|gladys   | AwoX module: Connection timeout for 34:15:13:77:1c:03
0|gladys   | AwoX module: Configuration done
0|gladys   | Awox module: not able to pair Mesh device a4:c1:38:99:2d:98 due to: Connection timeout for a4:c1:38:99:2d:98
0|gladys   | AwoX module: Connection timeout for a4:c1:38:99:2d:98

I changed the connectTimeout value from the file gladys/api/hooks/awox/lib/shared.js to 15000 but got no better result.

Have you encountered this kind of issue before? Did i change the wrong parameter? I created an issue but if it is not the right way to get support, let me know.

Thank you for your help.

pebou commented 5 years ago

Hello ! Just a quick reply, you are not alone ! 😃 Your bug might be related to mine (#34). I have the same behaviour, since the last commits, when i click on next, nothing happens.

That's the right way to get support from the dev. I'm just a tester (I'm not good enough in JS yet to help 😄 )

atrovato commented 5 years ago

Ok, it's may be due to lasts commits. I didn't check again the pairing phase. I'll check ASAP, I'll determine if it linked to #34 Thanks for your feedbacks ;)

atrovato commented 5 years ago

It was due to an optimization to avoid complete loading at each message sent. A condition didn't have any else, so the process was locked... then timeout... thne crash... Now fixed ;)