icanos / hassio-plejd

Hass.io add-on for Plejd home automation devices
Apache License 2.0
126 stars 37 forks source link

noble warning: unknown peripheral #1

Closed icanos closed 4 years ago

icanos commented 4 years ago

The log gets spammed with: noble warning: unknown peripheral

What I've been able to read up on, this occurs when a peripheral disconnects and we try to do some voodoo magic against it anyway.

Try to find out where, what I can think of is the ping functionality.

icanos commented 4 years ago

Seems to be resolved in latest commit. Haven't seen this in five days (got it multiple times a day earlier).

axlthorell commented 4 years ago

Just got this same error this morning. The log was full of noble warnings. Haven't seen any more after a restart of the add-on. I have automations set up within the plejd-app, could this be an issue?

icanos commented 4 years ago

Could you make sure that all files are updated to the latest from the repo? Automations shouldn't be an issue and the HA add-on should reconnect if the connection is lost.

axlthorell commented 4 years ago

I will update all files and rebuild. Tomorrow we'll know if the error is back or not...

axlthorell commented 4 years ago

No errors this morning, looks like it's working now.

icanos commented 4 years ago

Glad to hear, I’ll leave the issue open for a few days to really test it. Haven’t I heard anything by Monday I’ll close it. Thanks!

axlthorell commented 4 years ago

Just got the error again

noble warning: unknown peripheral d7a44a9ec40f
noble warning: unknown peripheral d7a44a9ec40f
noble warning: unknown peripheral d7a44a9ec40f
noble warning: unknown peripheral d7a44a9ec40f

And now the lights won't turn on/off. After restarting the add-on it works again.

icanos commented 4 years ago

That’s strange, I haven’t seen that since I closed the issue but have been testing another possible solution since yesterday. I’ll push that to the repo soon for more testing, I’ll also add RSSI of the connected device in the log to help debug the issue.

axlthorell commented 4 years ago

Had the same error this morning. Not sure what might be causing it. Any update on debug logging?

icanos commented 4 years ago

I'm currently reworking some connection handling since it seems too unstable. I should have a new version later today with more debug logging too :)

icanos commented 4 years ago

I've pushed some new code to the master branch, containing quite a lot of changes both in the ble handling as well as some more verbose logging in the api section as well.

Hopefully this resolves any issues we've seen with the unknown peripheral message. At least I've found where that message is thrown: https://github.com/abandonware/noble/blob/master/lib/hci-socket/bindings.js#L366

Which suggests that the BLE module somehow looses track of the peripheral its connected to. Need to investigate a bit more though, but hopefully it works better with the fixes I've implemented anyway.

treet commented 4 years ago

Thank you for this great addon! I had the same issue this morning, will update right away and see if the stability has improved.

icanos commented 4 years ago

I’ve been running 0.1.0 since yesterday with no interruptions or anything. Plejd has been working for > 24h now, which it didn’t prior to 0.1.0. I think the rewrite of the ble layer really paid off.

Ludde157 commented 4 years ago

Hopefully helpful information. I installed this app today, like 1 h ago. The issue remains.

A huge thanks to you for your great work!

icanos commented 4 years ago

Did the warning appear multiple times or just once? Is it the exact same as provided in the thread or does it contain more information? Are you running 0.1.1 of the add-on?

Ludde157 commented 4 years ago

Hello, It appeared directly after setup, like 10 minutes. I’ve tried to reload then it worked like 10 minutes more. Yes, I run the 0.1.1 version

icanos commented 4 years ago

Is the device running the add-on far away from a Plejd device? I've been running 0.1.1 for 3 days now without interruption of any kind.

Ludde157 commented 4 years ago

Currently I’ve got 4 Plejd devices. I live in a 70 m2 appartment, so de Bluetooth signal should work.

I can send you a photo tomorrow how it looks like in the log

Ludde157 commented 4 years ago

Hello again, Here is a picture from my log.

Skärmavbild 2019-12-22 kl  18 16 32
icanos commented 4 years ago

Does the add-on still work despite the messages in the log?

Ludde157 commented 4 years ago

Unfortunately not, it could not find the entity. I’m running my HA on a RPI 3B+ could that be the issue?

Ludde157 commented 4 years ago

Entity is not available

icanos commented 4 years ago

RPi 3B+ should not be an issue.

I don't have that much to go on in this case. I have a new version coming up in a couple of days. Please try that, and if it still doesn't work, please open a new issue.

Thank you