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

Unable to scan BT Plejd #97

Closed
JorSjo opened this issue Jul 25, 2020 · 8 comments
Closed

Unable to scan BT Plejd #97

JorSjo opened this issue Jul 25, 2020 · 8 comments

Comments

@JorSjo
Copy link

JorSjo commented Jul 25, 2020

I'm running ubuntu (18.04) and home-assistant in venv on ESXi using ASUS BT-400 USB BlueTooth using VirtualHere USB (USB over Ethernet), a bit complex setup but it works perfectly with Teldus and ZigBee and I can see the Bluetooth is scaning so I think the setup will work.

Anyway
Starting Hassio-plejd works...

[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing...
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[08:54:17] INFO: Starting the Plejd service...
[08:54:17] INFO: Verified permissions on startup script
[08:54:17] INFO: Executing startup script
[08:54:17] INFO: Wrote plejd.json
[08:54:17] INFO: Running add-on
starting Plejd add-on v. 0.4.7
plejd-api: login()
plejd-api: logging into Hemma
plejd-api: got session token response
plejd-api: getSites()
plejd-api: got site list response
plejd-api: getSite(...)
plejd-api: got site details response
wireEvents()
init()
plejd-mqtt: connected to mqtt.
plejd-mqtt: discovered light (DIM-01) named Hörnlampa bastu with PID 12.
plejd-mqtt: discovered light (CTR-01) named Bastu with PID 11.
plejd-mqtt: discovered switch (Scene) named Bastu with PID 1.

until scanning for Plejd on Bluetooth, see log below.

_plejd-ble: warning: wasn't able to connect to Plejd, will retry.
plejd-ble: were unable to connect, will retry connection in 10 seconds.
(node:304) UnhandledPromiseRejectionWarning: DBusError: No discovery started
at methodReturnHandlers.(anonymous function) (/plejd/node_modules/dbus-next/lib/bus.js:339:27)
at handleMessage (/plejd/node_modules/dbus-next/lib/bus.js:98:11)
at EventEmitter.MessageBus.conn.on (/plejd/node_modules/dbus-next/lib/bus.js:147:9)
at EventEmitter.emit (events.js:198:13)
at /plejd/node_modules/dbus-next/lib/connection.js:112:14
at Socket. (/plejd/node_modules/dbus-next/lib/message.js:63:9)
at Socket.emit (events.js:198:13)
at emitReadable
(_stream_readable.js:555:12)
at process.tickCallback (internal/process/next_tick.js:63:19)
(node:304) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:304) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
init()

I can see in the console that Plejd is scannig for devices, so i guess the Bluetooth is working.

[NEW] Controller 5C:F3:70:9A:8E:BC hass [default]
[CHG] Controller 5C:F3:70:9A:8E:BC UUIDs: 00001801-0000-1000-8000-00805f9b34fb
[CHG] Controller 5C:F3:70:9A:8E:BC UUIDs: 0000110e-0000-1000-8000-00805f9b34fb
[CHG] Controller 5C:F3:70:9A:8E:BC UUIDs: 00001200-0000-1000-8000-00805f9b34fb
[CHG] Controller 5C:F3:70:9A:8E:BC UUIDs: 00001800-0000-1000-8000-00805f9b34fb
[CHG] Controller 5C:F3:70:9A:8E:BC UUIDs: 0000110c-0000-1000-8000-00805f9b34fb
[CHG] Controller 5C:F3:70:9A:8E:BC Alias: hass
[CHG] Controller 5C:F3:70:9A:8E:BC UUIDs: 00001801-0000-1000-8000-00805f9b34fb
[CHG] Controller 5C:F3:70:9A:8E:BC UUIDs: 0000110e-0000-1000-8000-00805f9b34fb
[CHG] Controller 5C:F3:70:9A:8E:BC UUIDs: 00001200-0000-1000-8000-00805f9b34fb
[CHG] Controller 5C:F3:70:9A:8E:BC UUIDs: 00001800-0000-1000-8000-00805f9b34fb
[CHG] Controller 5C:F3:70:9A:8E:BC UUIDs: 0000110c-0000-1000-8000-00805f9b34fb
[CHG] Controller 5C:F3:70:9A:8E:BC Pairable: yes
[bluetooth]#

I'm stuck, any ideas where I can continue troubleshooting?

@SweVictor
Copy link
Collaborator

@JorSjo : Logging has been a lot improved, and also error handling. Do you still encounter the same problem with the latest version?

@JorSjo
Copy link
Author

JorSjo commented Jan 27, 2021

I restored a backup with an older version 0.4.7. That solved the problem. If you have released a newer version I can take a new backup and try that one.

@SweVictor
Copy link
Collaborator

UnhandledPromiseRejection and other exceptions are handled a lot better, and, if all else fails the logging is much improved.
Master has seen a lot of development lately.

If it's better I can't say. If 0.4.7 is working - you can of course continue using that.

0.5.0 is planned here (mostly improved readme/changelog compared to current master)
#154

@JorSjo
Copy link
Author

JorSjo commented Jan 29, 2021

0.4.8 still doesnt work for me, but I can restore snapshot to 0.4.7 so for me I can wait for 0.5.0

plejd-mqtt: connected to mqtt.
plejd-mqtt: discovered light (DIM-01) named Hörnlampa bastu with PID 12.
plejd-mqtt: discovered light (CTR-01) named Bastu with PID 11.
plejd-mqtt: discovered light (CTR-01) named Spa with PID 15.
plejd-mqtt: discovered light (CTR-01) named Biorum with PID 17.
plejd-mqtt: discovered switch (Scene) named Bastu with PID 1.
error: writing to plejd: DBusError: Operation failed with ATT error: 0x0e
plejd-ble: ping failed, reconnecting.
init()
plejd-ble: connecting to /org/bluez/hci0/dev_E6_A4_23_XXXXX
onDeviceConnected()
trying 10 characteristics
authenticate()
plejd-ble: error: failed to authenticate: DBusError: Operation failed with ATT error: 0x0e
startPing()
startWriteQueue()
error: writing to plejd: DBusError: Method "WriteValue" with signature "aya{sv}" on interface "org.bluez.GattCharacteristic1" doesn't exist
plejd-ble: ping failed, reconnecting.
init()
plejd-ble: connecting to /org/bluez/hci0/dev_F6_49_EB_XXXXX
onDeviceConnected()
trying 10 characteristics
authenticate()
startPing()
startWriteQueue()
error: writing to plejd: DBusError: In Progress
plejd-ble: ping failed, reconnecting.
init()
plejd-ble: disconnecting /org/bluez/hci0/dev_F6_49_EB_XXXXX
error: writing to plejd: DBusError: Operation failed with ATT error: 0x0e
plejd-ble: ping failed, reconnecting.
init()
plejd-ble: error: failed to start discovery. Make sure no other add-on is currently scanning.
plejd-ble: connecting to /org/bluez/hci0/dev_EC_07_06_XXXXX
onDeviceConnected()
trying 10 characteristics
authenticate()
startPing()
startWriteQueue() 

@SweVictor
Copy link
Collaborator

SweVictor commented Jan 29, 2021

Ok, thanks. For the 0.4.8 version the startWriteQueue indicates things are up and running. I suppose you wont get the new version until we update the version (the code in master is newer than what you seem to be running).

But agreed, wait for the 0.5.0 version. @icanos, maybe we can push that version quite soon with tagged releases as fallback is someone wants to roll back?

@icanos
Copy link
Owner

icanos commented Jan 29, 2021

Yes, I think we can roll out 0.5.0 now :)

@SweVictor
Copy link
Collaborator

0.5.0 out!

@SweVictor
Copy link
Collaborator

Closing due to lack of response. Probably solved already, otherwise after code restructure PR is in

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

3 participants