akx / hass-ruuvitag

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

Can't start in Hass.io #4

Closed VeliV closed 4 years ago

VeliV commented 5 years ago

After cloning the package to Hass.IO it installs fine, but then fails to start, giving the following error:

internal/modules/cjs/loader.js:583 throw err; ^ Error: Cannot find module 'bluetooth-hci-socket' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15) at Function.Module._load (internal/modules/cjs/loader.js:507:25) at Module.require (internal/modules/cjs/loader.js:637:17) at require (internal/modules/cjs/helpers.js:22:18) at Object. (/app/node_modules/noble/lib/hci-socket/hci.js:6:26) at Module._compile (internal/modules/cjs/loader.js:689:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10) at Module.load (internal/modules/cjs/loader.js:599:32) at tryModuleLoad (internal/modules/cjs/loader.js:538:12) at Function.Module._load (internal/modules/cjs/loader.js:530:3)

akx commented 5 years ago

If you can access the build log, there might be additional clues there. What version of Hass.io, etc. are you using?

maffee commented 5 years ago

And what hardware? Do you have RPi? Any usb devices attached?

VeliV commented 5 years ago

Hey,

I'll send more info once I have access to the device again (Sunday most likely), but here's some already;

Hass.io should be at the latest version. Device is Raspberry Pi 3 Model B. 2 USB sticks attached, but I can remove those if they can interfere with this.

Where would the build log be located? The Hass.io system has kinda limited access to stuff or so I've found. TBH, I'm pondering whether to switch to Hasspian, as things would be bit more straight forward there.

Thank you for your time! Kiitos :)

On Fri, 15 Mar 2019 at 11:12, maffee notifications@github.com wrote:

And what hardware? Do you have RPi? Any usb devices attached?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/akx/hass-ruuvitag/issues/4#issuecomment-473211623, or mute the thread https://github.com/notifications/unsubscribe-auth/AEJVU8l9_Ww5OKYbfrh-hLAQNXWSMf5Lks5vW2PggaJpZM4b1x3b .

maffee commented 5 years ago

RPi has been known to have issues with Bluetooth in some cases if you have some shield's attached to it. Mainly there have been problems with Raspbee shield.

And in some cases there are problems with USB sticks. You could try without those, just to rule out some causes.

Just my 2 cents, which probably have nothing to do with the actual problem =D

VeliV commented 5 years ago

No shields attached.

" Cannot find module 'bluetooth-hci-socket' "

Shouldn't the addon install all modules required when it's being installed? Should that module be added in the package.json? Or do I have to install it somehow differently? Dunno if I can in the Hass.io environment.

On Fri, 15 Mar 2019 at 12:09, maffee notifications@github.com wrote:

RPi has been known to have issues with Bluetooth in some cases if you have some shield's attached to it. Mainly there have been problems with Raspbee shield.

And in some cases there are problems with USB sticks. You could try without those, just to rule out some causes.

Just my 2 cents, which probably have nothing to do with the actual problem =D

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/akx/hass-ruuvitag/issues/4#issuecomment-473229340, or mute the thread https://github.com/notifications/unsubscribe-auth/AEJVU3pWrEbpTLomlQKL1Wkf-W1aNuJlks5vW3FagaJpZM4b1x3b .

maffee commented 5 years ago

To clarify: I run this on RPi with Conbee USB stick and Hass.io.

VeliV commented 5 years ago

Removed the USB sticks. Problem still persists.

I can' find a build log, aside from this one, which is not that helpful:

19-03-17 17:07:20 INFO (SyncWorker_1) [hassio.docker.interface] Remove Docker local/armv7-addon-ruuvitag with latest and None 19-03-17 17:07:20 INFO (SyncWorker_6) [hassio.docker.addon] Start build local/armv7-addon-ruuvitag:0.1.2 19-03-17 17:13:42 INFO (SyncWorker_6) [hassio.docker.addon] Build local/armv7-addon-ruuvitag:0.1.2 done

Hass.io version 148, HassOS 2.10

J-Kallunki commented 5 years ago

Yeah I'm having the same problem with Hass.io 152. I'm running the Raspbian Stretch from SSD via USB-adapter (SD-card boot) so cannot remove USB connections.

wizzor commented 5 years ago

Same issue with hass.io 152. No shields, only external device is a CC2531 Zigbee stick.

coccobill1 commented 5 years ago

Same issue here with hass.io 163 on an RPI3 B+.

Zetor77 commented 5 years ago

Same issue with hass.io 165. RPI3 B+ with Z-wave.me UZB stick inserted, if that makes any difference.

internal/modules/cjs/loader.js:583 throw err; ^ Error: Cannot find module 'bluetooth-hci-socket' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15) at Function.Module._load (internal/modules/cjs/loader.js:507:25) at Module.require (internal/modules/cjs/loader.js:637:17) at require (internal/modules/cjs/helpers.js:22:18) at Object. (/app/node_modules/noble/lib/hci-socket/hci.js:6:26) at Module._compile (internal/modules/cjs/loader.js:689:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10) at Module.load (internal/modules/cjs/loader.js:599:32) at tryModuleLoad (internal/modules/cjs/loader.js:538:12) at Function.Module._load (internal/modules/cjs/loader.js:530:3)

itis80 commented 5 years ago

Same error and issue with hass.io 165 and PI3B+. I tried also the RuuviDriver project and it fails to the same error with module bluetooth-hci-socket.

mmaraa commented 5 years ago

Same error with RPI3B+ and hass.io 167. :(

KPelto commented 4 years ago

Same error with RPI3B+ and hass.io 170. :(

itis80 commented 4 years ago

I tried the RuuviDriver-project on another RPI3B+ with raspbian os and with node.js version 8.15.1 it works. I now use it to publish the REST api for the tags and configured the HA sensors to read the tag information from there. I found several discussions where the module 'bluetooth-hci-socket' has caused problems with recent node.js versions so it might be the problem with this addon.

akx commented 4 years ago

Sorry for my deafening radio silence here 😿

I don't currently have a Hass.io development environment (running Hass on Arch on x64 in an Intel NUC atm since I grew annoyed with how long everything was taking on a Raspi), so I haven't had the inclination or kit to debug this.

Anyway @itis80 is on the right track here – see https://github.com/noble/node-bluetooth-hci-socket/issues/84 and https://github.com/noble/noble/issues/886 etc. I actually bumped into this same issue with the aforementioned x64 setup and just installed a local copy of Node 8 instead, heh.

Anyway, I opened https://github.com/akx/ruuvidriver/issues/1 as a reminder for myself to see if I could get things to work with the https://github.com/abandonware/noble fork of Noble – if that works out, the same fix should work for hass-ruuvitag.

akx commented 4 years ago

Come to think of it, the other, easier, temporary fix would be to install Node 8 in the Docker container (instead of approx this https://pkgs.alpinelinux.org/package/edge/main/aarch64/nodejs I guess).

akx commented 4 years ago

Things are moving forward! Ruuvidriver 0.2.0 is compatible with Node 12 (which is what the current hass.io base container images ship with), so the next step is to make hass-ruuvitag use it as a library.

akx commented 4 years ago

Okay, so if a Hass.io owner wants to kick the tires a bit,

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

into the addons directory and see if things build with that new next branch :)

hemantkamalakar commented 4 years ago

Doesn't build. 19-08-30 05:50:58 ERROR (SyncWorker_1) [hassio.docker.addon] Can't build local/amd64-addon-ruuvitag:0.1.2: The command '/bin/ash -o pipefail -c yarn' returned a non-zero code: 1 19-08-30 05:51:15 INFO (SyncWorker_19) [hassio.docker.addon] Start build local/amd64-addon-ruuvitag:0.1.2

akx commented 4 years ago

@hemantkamalakar Thanks for trying. I pushed a commit with a better Dockerfile – can you try again?

tikkav commented 4 years ago

@akx Thanks for fix! Now it builds just fine on Home Assistant 0.98.0 / HassOS 2.12 / RPi3. Also finds tags correctly. 19-08-30 09:44:12 INFO (SyncWorker_4) [hassio.docker.addon] Build local/armv7-addon-ruuvitag:0.1.2 done

hemantkamalakar commented 4 years ago

Yes. Thanks a lot for a quick fix. Image builds successfully now. But I am getting following errors in logs.

Found tag f34bfbd9f945 [ { url: 'http://hassio/homeassistant/api/states/sensor.livingroom_temperature', payload: { state: 26.46, attributes: [Object] } }, { url: 'http://hassio/homeassistant/api/states/sensor.livingroom_pressure', payload: { state: 938.98, attributes: [Object] } }, { url: 'http://hassio/homeassistant/api/states/sensor.livingroom_humidity', payload: { state: 81.5, attributes: [Object] } } ] tag f34bfbd9f945: failed 2 http://hassio/homeassistant/api/states/sensor.livingroom_temperature: 502: Bad Gateway tag f34bfbd9f945: failed 2 http://hassio/homeassistant/api/states/sensor.livingroom_pressure: 502: Bad Gateway tag f34bfbd9f945: failed 2 http://hassio/homeassistant/api/states/sensor.livingroom_humidity: 502: Bad Gateway

I also tried setting the hassHost config option but it was not saved after a restart.

Glenf commented 4 years ago

@hemantkamalakar I had quite similar issues. Removed hyphens and underscores from name and issues have seem to disappeared.

edit. You didn't seem to have those, so my issue was different.

KPelto commented 4 years ago

I got it working easily with board: rpi3-64 and version: "2.12". Big thanks!

tikkav commented 4 years ago

Found new issue... If I have hass-ruuvitag running it blocks Mi Flora plant sensor updates.

Zetor77 commented 4 years ago

Great to see this add-on updated! However, things aren't still quite running smooth. I'm runnin Home Assistant 0.98.1 / HassOS 2.12 / RPi3b+ and building seems takes forever. After 1,5 hours of building I decided to reboot. However the add-on seems to have installed, since I'm able to start it and it finds my beacon. After configuring, restart add-on, but no sensors are created in entity registry. After a while I refresh add-on log and it finds my beacon unconfigured again. Cannot find any errors on logs.

edit: My version is 32 bit.

Zetor77 commented 4 years ago

My bad. I entered mac with colons. Works just fine without colons. Thanks!

akx commented 4 years ago

Since things seem to work for multiple people (yay!), I promoted the next branch to master and tagged v0.2.0.

Closing this issue for now – please open a new one for new problems :)

akx commented 4 years ago

Yes. Thanks a lot for a quick fix. Image builds successfully now. But I am getting 502: Bad Gateway errors in logs.

That's probably something wrong with Hass, not the addon :/