akx / hass-ruuvitag

Hass.io addon for Ruuvitag Weather Stations
MIT License
24 stars 7 forks source link

ERR_OUT_OF_RANGE on version 0.3.0 #18

Open mmaraa opened 4 years ago

mmaraa commented 4 years ago

I'm running the newest Hass.io on RPi3. I updated to the version of 0.3.0 couple of days ago and it works.. a while.. and after that it throws an exception ERR_OUT_OF_RANGE. Logs during the exception in the addon are here. I can start it again and it works again.. for a while.. until the same error. This problem wasn't in the previous version.

Add-on error:

internal/buffer.js:72
  throw new ERR_OUT_OF_RANGE(type || 'offset',
  ^
RangeError [ERR_OUT_OF_RANGE]: The value of "offset" is out of range. It must be >= 0 and <= 5. Received 6
    at boundsError (internal/buffer.js:72:9)
    at Buffer.readUInt16LE (internal/buffer.js:229:5)
    at Gap.onHciLeAdvertisingReport (/app/node_modules/@abandonware/noble/lib/hci-socket/gap.js:149:31)
    at Hci.emit (events.js:210:5)
    at Hci.processLeAdvertisingReport (/app/node_modules/@abandonware/noble/lib/hci-socket/hci.js:651:10)
    at Hci.processLeMetaEvent (/app/node_modules/@abandonware/noble/lib/hci-socket/hci.js:608:10)
    at Hci.onSocketData (/app/node_modules/@abandonware/noble/lib/hci-socket/hci.js:479:12)
    at BluetoothHciSocket.emit (events.js:210:5) {
  code: 'ERR_OUT_OF_RANGE'
}
akx commented 4 years ago

Seems https://github.com/abandonware/noble/issues/19 might be related.

mmaraa commented 4 years ago

hm.. Yep it looks like a same.

kkihu commented 4 years ago

I can confirm this is still an issue. I can run the add-on for about 5 minutes before it crashes due to this bug.

VeliV commented 4 years ago

Same here.

There's a new commit in noble: https://github.com/abandonware/noble/commit/e5cdae334b5bc2cf25a403c5ad338bb6d723996a

Wonder if that would help us as well?

akx commented 4 years ago

That commit is in no released version of Noble, unfortunately.

I set up an experimental branch noble-experiment that should use a version of Noble with that commit patched in.

If someone with an active hass-ruuvitag installation wants to try things out with that branch, that'd be grand.

git clone -b noble-experiment https://github.com/akx/hass-ruuvitag

in your addons folder and build away...

tikkav commented 4 years ago

Ten minutes and still running OK. Seems promising...

tikkav commented 4 years ago

Ten minutes and still running OK. Seems promising...

I was celebrating a bit too early. Lasta values were updated about 11 minutes after rebuild/restart. I'm not getting any log lines on this issue for some reason.

jerpsutin commented 4 years ago

Does anyone know that if using usb bluetooth dongle instead of RPi3s own bluetooth makes a difference? Would it make more stable?

Also it seems like that this addon stays on longer after restarting Hass.io

mmaraa commented 4 years ago

I had other problems also so I changed the whole RPi3 hardware to new one. Same time I updated the home assistant itself to the latest one and my problems disappeard. I use the latest master-branch version of the component. I have six ruuvitag's connected to the home assistant. Not sure was the fix the change of hardware or updating the home assistant to the newer one.

jerpsutin commented 4 years ago

I just update to 0.107.7 and we will see tomorrow if it works... Longest run time so far has been about 12 hours...

Im running with Rpi3 b v1.2

ojalaj commented 4 years ago

@jerpsutin See my experience below. Buying a BT dongle solved my problems with RPi3b v1.2: https://f.ruuvi.com/t/ruuvitags-in-ha-more-and-more-unstable-with-time/3953

jerpsutin commented 4 years ago

@mmaraa Updating the software didn't help me at all. So I did as @ojalaj told he had done. I bought a Bluetooth dongle and now my Ruuvi tag has been working without any issues at all!

ojalaj commented 4 years ago

@jerpsutin Great to hear!