readeral / node-red-contrib-apple-tv

MIT License
0 stars 7 forks source link

Installation with hass.io #2

Open bastian987 opened 5 years ago

bastian987 commented 5 years ago

Thanks for this work!

Unfortunately, I cannot get the module installed in a out-of-the-box hass.io installation on a RPi. I get this error on installation of your module (I think during building libsodium, to be precise): make: Entering directory '/opt/node_modules/mdns/build' CXX(target) Release/obj.target/dns_sd_bindings/src/dns_sd.o In file included from ../src/dns_sd.cpp:1:0: ../src/mdns.hpp:32:20: fatal error: dns_sd.h: No such file or directory

Can you maybe advice?

readeral commented 5 years ago

Yeah it looks like you'll have to install the mdns dependency yourself while in your node-red folder. It's unfortunately quite a brittle package, because it's built on dependencies that are outdated (and as my package is just a wrapper around a node implementation someone else has done, I don't have means to fix it). Look at the "installing on raspberry pi" instructions and it will tell you which dependencies you might need to install yourself.

I personally don't use Home Assistant, so there might be other problems that I'm not aware of. Feel free to open issues for them, even if I may not immediately have answers

bastian987 commented 5 years ago

Thanks for the quick response! I think the issue is the libavahi-compat-libdnssd-dev dependency. It seems to be required, but I get an error if I add it to "system_packages" of the node-red config (package is apparently not available). Please let me know in case you have an idea what I could try.

readeral commented 5 years ago

Ah yeah those Bonjour libraries are a bit funky. Check out the mdns installation instructions to see what you need for your platform: https://www.npmjs.com/package/mdns

On Wed, 17 Oct 2018 at 7:44 am, Tim3100 notifications@github.com wrote:

Thanks for the quick response! I think the issue is the libavahi-compat-libdnssd-dev dependency. It seems to be required, but I get an error if I add it to "system_packages" of the node-red config (package is apparently not available). Please let me know in case you have an idea what I could try.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/readeral/node-red-contrib-apple-tv/issues/2#issuecomment-430393480, or mute the thread https://github.com/notifications/unsubscribe-auth/APKtiM6zCi-w89ZC_gF7ySr9-65xaJaSks5ulkUrgaJpZM4Xeipj .

--

Alan Reader| e. areader0@gmail.com areader0@gmail.com | m. 0400 215 751 | fb. - readeral http://www.facebook.com/readeral | i. - instagram.com/readeral http://instagram.com/readeral

bastian987 commented 5 years ago

Some progress I guess... instead of libavahi-compat-libdnssd-dev, I added the packages avahi avahi-compat-libdns_sd avahi-dev to the node red system packages. Now, I could install the module without error. However, on node red startup I got the warning [info] - node-red-contrib-apple-tv:atv-config : Error: Cannot find module '../build/Release/sodium' While I added "libsodium" in system_packages and sodium in npm_packages, I think it additionally builds sodium: Static libsodium was not found at /opt/node_modules/sodium/deps/build/lib/libsodium so compiling libsodium from source.

Still the module cannot find it. As a result, configuring the ATVconfig node does unfortunately not work :(

ptrsz commented 5 years ago

Is there any progess in this matter? I'm having the same issue as you do.

bastian987 commented 5 years ago

I unfortunately could not solve it.

readeral commented 5 years ago

Sorry all been in the thick of finishing exams. I’ll try get my head back into this.

If you could let me know your platform and OS version that’d be a start to getting you some specific instructions

On Wed, 5 Dec 2018 at 1:45 am, Tim3100 notifications@github.com wrote:

I unfortunately could not solve it.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/readeral/node-red-contrib-apple-tv/issues/2#issuecomment-444124614, or mute the thread https://github.com/notifications/unsubscribe-auth/APKtiBHgij_7CId0TyhtO9FSDGpimqvXks5u1oqdgaJpZM4Xeipj .

--

Alan Reader| e. areader0@gmail.com areader0@gmail.com | m. 0400 215 751 | fb. - readeral http://www.facebook.com/readeral | i. - instagram.com/readeral http://instagram.com/readeral

ptrsz commented 5 years ago

No worries man, good luck with your exams. My setup: HASS.IO OS for hosting the home assistant application (latest of both) on a rasberry pi and using the "official" node-red addon (v0.19.5).

readeral commented 5 years ago

Sorry I haven't come back to this. Are either of you still hoping to use this package?

ptrsz commented 5 years ago

Yes, if I can. It has low priority though, if you have other stuff to do then this one is not essential at all. :)

bastian987 commented 5 years ago

Thanks, but I moved on from hassio to a Docker install and I‘m trying to install your package now there.

readeral commented 5 years ago

So something to investigate - the raspberry pi OS Raspbian is a debian based OS, and so has certain requirements for MDNS. Hassio OS isn't a debian based system, so will have other requirements.

From the mdns package docs:

On Linux and other systems using the avahi daemon the avahi dns_sd compat library and its header files are required. On debianesque systems the package name is libavahi-compat-libdnssd-dev. On other platforms Apple's mDNSResponder is recommended. Care should be taken not to install more than one mDNS stack on a system.

So there's likely an avahi daemon, library and header files that better suits HASSIO OS that libavahi-compat-libdnssd-dev - and it seems @Tim3100 discovered those requirements. So for Hassio, try packages avahi avahi-compat-libdns_sd avahi-dev

When it comes to sodium, that one is also complicated. I recommend looking at the sodium package docs https://www.npmjs.com/package/sodium and jumping to the installation section, read it bottom up as there might be requirements they suggest later that you need for successful installation. Also have a read of the 'manual installation' section, as if Sodium still isn't being installed, that might be a good avenue.

I'm not familiar at all with the Hassio distro, nor with the node-red add on for Home Assistant, so it could be that they actually run node-red differently to the way that node-red is organised stand alone. So my suggestion to install packages in the root of node-red presupposed node-red 0.19.x I guess. What Node-red does (as far as I can tell) is flattens all it's node_modules into one folder at the root of the whole project. If the Hassio node-red add on acts differently, and retains the node_modules at the package level, then you'll likely have to reinstall the packages to ensure that all is in the right place.

readeral commented 5 years ago

@ptrsz can you give me any output from the errors you get? @Tim3100 I'm not sure what your approach with docker is, but let me know how it all goes.

I mean, ultimately I only have experience in running this on a straightforward node-red install on a typical Raspbian OS, so if you guys make progress and want to include installation info in the docs for HASSIO OS and using Docker images, I'd be grateful for a pull request.