noelportugal / google-home-notifier

Send notifications to Google Home
MIT License
578 stars 171 forks source link

No includes #2

Closed edif30 closed 7 years ago

edif30 commented 7 years ago

@noelportugal

Not sure why I am getting this. I can run the example and it waits for commands. Once I use curl, this is the output. Another thing I noticed is it is only sometimes picking my ghome. Other times it picks another cast device on my network. Any ideas?

/tmp/google-home-notifier/google-home-notifier.js:17 if (service.name.includes(device.replace(' ', '-'))){ ^ TypeError: Object Google-Home-5e7040daf543262437d19be8062f43d5 has no method 'includes' at Browser. (/tmp/google-home-notifier/google-home-notifier.js:17:24) at Browser.emit (events.js:98:17) at on_resolver_done (/tmp/google-home-notifier/node_modules/mdns/lib/browser.js:31:14) at next (/tmp/google-home-notifier/node_modules/mdns/lib/browser.js:104:7) at Array.makeAddressesUnique [as 2] (/tmp/google-home-notifier/node_modules/mdns/lib/resolver_sequence_tasks.js:177:5) at next (/tmp/google-home-notifier/node_modules/mdns/lib/browser.js:107:21) at /tmp/google-home-notifier/node_modules/mdns/lib/resolver_sequence_tasks.js:160:11 at getaddrinfo_complete (/tmp/google-home-notifier/node_modules/mdns/lib/resolver_sequence_tasks.js:108:7) at Object.wrap.oncomplete (/tmp/google-home-notifier/node_modules/mdns/lib/resolver_sequence_tasks.js:130:7)

noelportugal commented 7 years ago

What OS are you using?

edif30 commented 7 years ago

Fedora 23. I think I am missing something because I am able to get it to work on my mac.

noelportugal commented 7 years ago

You might have to get these packages libnss-mdns libavahi-compat-libdnssd-dev

edif30 commented 7 years ago

Figured it out. Using the package manager (dnf) it installed a SERIOUSLY old version of npm and nodejs. I compiled it using nvm and all is well. Great stuff!

Qq.. What kind of CPU util are you seeing while the listener is running and a POST has been sent? When I execute the node example.js, it doesn't even register anything in top. But as soon as I send a POST, it spikes and stays at 100% CPU. Just curious what you see. I am currently running this on the F23 box but plan on running it from a Pi.

lborensky commented 7 years ago

I have a same problem on Raspberry Pi 3. After the 1st message sent (POST), the CPU remains at 100%. Does anyone have any idea of the problem?