originallyus / node-red-contrib-alexa-local

An easy-to-use NodeRED node for adding Alexa capability to NodeRED. NO Alexa Skills required.
107 stars 25 forks source link

Discover new Devices #17

Closed StoRmtec500 closed 6 years ago

StoRmtec500 commented 6 years ago

Hello I have install node-red and add the Plugin. When i insert the Alexa in the Flow an say deploy then write the Flow connected. So than i go in the new Alexa App and say discover new Device, but he says No new Device found. Can you help me please.

thx

redshift2 commented 6 years ago

I am also having the same issue. In the debug window of node-red I get the following error for the for this node "SyntaxError: Unexpected token ="

torinnguyen commented 6 years ago

@StoRmtec500 you need to provide more details about your setup in order for me to give you a meaningful comment. It is highly due to your networking setup.

StoRmtec500 commented 6 years ago

@torinnguyen Also i have only install node-Red on a Rasperry and the Pattern alexa local. I add the alexa Local with the name and in the App when i sey Discovery new Device it´s dont show anythink. The Network is the same. thx

torinnguyen commented 6 years ago

you can take a look at NodeRED log for any errors. there's still not enough information for me to comment.

StoRmtec500 commented 6 years ago

Hello Sorry i am very new to Node-Red where can i find the logs for you? thx

torinnguyen commented 6 years ago

I'm sorry but that is beyond my help

gordonthree commented 6 years ago

Had a similar problem, turns out I had disabled the flow that the Alexa nodes were part of. So make sure your flow isn't disabled, or just create a new flow and add some devices to that.

redshift2 commented 6 years ago

Downgrading to version 2.2 fixed the issue for me

jonferreira commented 6 years ago

I'm also facing the same issue, with v3.2 doesnt find any devices at all

jonferreira commented 6 years ago

this is driving me nuts,I've downgraded to 2.2 but can't see any changes. In fact I can't see any indication that Alexa is hitting node-red at all. Any suggestions on what I can do to debug this?

gordonthree commented 6 years ago

turn on debug logging in node red, edit ~/.node-red/settings.js ... under logging, console, set the level to debug and then restart node red

https://nodered.org/docs/user-guide/logging

What Alexa device are you using? I've only tried 1st generation Echo Dot and haven't had any issue discovering devices other than when I accidentally disabled the flow containing the Alexa nodes.

jonferreira commented 6 years ago

I'm running v0.16.2 which doens't allow disabling flows I believe.

I've set log level to debug, restart nodered and then sudo journalctl -f and tail -f /var/log/nodered.log

couldn't find any indication at all that there was any incoming traffic, all I can see is my usual MQTT traffic.

I'me setting up a Gen2 Echo if that helps

jonferreira commented 6 years ago

for what is worth a UPnP Scanner can't find anything under this IP address which kinda implies something is preventing the UPnP Server that emulates the service to run...that said ps -aux shows that there's "something" on the nodes' port and I "can" telnet to that port so it's not a firewall issue either

PS: I can do "http://192.168.1.2:34352/upnp/amazon-ha-bridge/setup.xml" though which is odd

gordonthree commented 6 years ago

i will take a look at my log when I'm home and see if there's anything Alexa specific in there. I'm running node as an unprivileged users on a raspberry pi 2, there's no firewall and no selinux to get in the way.

would selinux maybe be blocking something?

jonferreira commented 6 years ago

I have to be honest, I have no idea what selinux is :(

I'm also running it on a RPI2 though, pretty basic setup

gordonthree commented 6 years ago

selinux is a security framework used by many linux distributions. I don't think it's included with the version of Debian that runs on the RPi.

here's something interesting. I think Alexa requires nodes to have two-word names? I just tried adding a new alexa node, named "subwoofer", deployed the sketch and then asked Alexa to discover new devices. Alexa reported no new devices found.

So I renamed the node to "sub woofer", deployed, scanned again. Alexa reported discovery of one new device "sub woofer".

NOTHING printed in the node-red logs during either discovery scan, even with debug turned on. I'm guessing this node doesn't support debug logging, I'll have to peek at the code.

jonferreira commented 6 years ago

no I don't think it does, couldn't see anything myself either.

regarding namming I actually have a two word name as well, Living Room in my case. over night I've also tried it in another instance I have running on a RPI3 and again,no joy....I honestly can't see what's going on

tbal commented 6 years ago

Same here, logs says:

15 Nov 00:23:27 - [info] Starting flows
15 Nov 00:23:27 - [error] [alexa-local:33d4284b.68b958] SyntaxError: Unexpected token =
15 Nov 00:23:27 - [info] Started flows

Edit: Some more infos:

15 Nov 00:04:26 - [info] Node-RED version: v0.17.4
15 Nov 00:04:26 - [info] Node.js  version: v4.8.2
15 Nov 00:04:26 - [info] Linux 4.9.41-v7+ arm LE

Using Version 0.3.2 on Raspian.

Lakritzator commented 6 years ago

I tried it via the node-red docker image, installed 0.3.2 via the manage-palette install. Doesn't work for me either.

edit: I found that from docker this doesn't work anyway

burleanu commented 6 years ago

same problem here "18 Nov 13:43:05 - [error] [alexa-local:df84c335.1ff9f] SyntaxError: Unexpected token =" From were is comming. How come to others the flow is working?

gordonthree commented 6 years ago

just curious, what versions are everyone using for underlying components?

Raspbian Linux 8.0 (jessie) nodejs v7.10.1 node-red 0.17.5 node-red-contrib-alexa-local 0.3.2

david1973 commented 6 years ago

I have been having similar problems with alexa not discovering devices regardless of the node name having one or two words. I am running Node-red on a first edition Raspberry pi zero using a USB ethernet adapter bought from Aliexpress. All other network traffic using this adapter works fine (mqtt, surfing the web, updating software and running the pi headless). Quite by accident I broke one of the wires off inside the adapter, did not have soldering iron to hand so plugged in a different adapter. With this adapter Alexa discovered the devices and could switch them on and off. Thinking this was strange changed the working adapter for a USB wifi one and once again Alexa discovered the devices.
I then set up Node-red on a Windows 10 tablet, all worked fine so disabled the internal wifi and tried the adapters that I had used on the pi. The two that worked on the pi also worked on the tablet, but the now non working but repaired adapter caused Alexa to fail to discover devices on the tablet. As yet now sure what to make of this, but if anyone else having the same Alexa discovery problems could try using different ethernet or wifi adapters the result would be interesting. Hope my observation may be of use to others.

gordonthree commented 6 years ago

I would add, the versions of nodejs and node-red that "ship" with RPI are very old. Manually replacing nodejs and npm is on my checklist of things to do when setting up a new board.

david1973 commented 6 years ago

The Raspberry was set with the latest versions of all the software used. The os, nodejs, node-red, mosquitto and all the addon nodes.

gordonthree commented 6 years ago

I'm out of ideas. I didn't do anything special to my setup other than install a newer version of nodejs.

burleanu commented 6 years ago

Indeed it looks like it was the nodered nodejs version I had, now the alexa-local node starts and say "online". 18 Nov 19:56:55 - [info] Node-RED version: v0.17.5 18 Nov 19:56:55 - [info] Node.js version: v8.9.1 18 Nov 19:56:55 - [info] Linux 4.9.59-v7+ arm LE

I have now other problem. On Alexa voice service it cannot be discovered by AVS or by the Android app. I try even on echosim and still no discovery. I must have a real amazon echo? Or?

gordonthree commented 6 years ago

@burleanu glad to hear you're making progress

I think you need the real deal, I don't think the software Echo support discovery... My HTC U11 phone has an Echo app and it does not find devices but my Echo Dot does.

torinnguyen commented 6 years ago

The error is due to syntax error when running on older version of NodeJS. This has now been fixed in latest version of alexa node. You can either upgrade NodeJS version or update alexa node to latest version.

StoRmtec500 commented 6 years ago

Hello I have update node.js and the alexa node but nothing happend. i become no devices in the alexa app

torinnguyen commented 6 years ago

The discovery of devices can be blocked by many networking factors. Example:

joedg commented 6 years ago

I was also having the "SyntaxError: Unexpected token =". Updating to nodejs version 9.2.0 fixed this for me. I updated nodejs with these commands:

sudo npm cache clean -f
sudo npm install -g n
sudo n stable
torinnguyen commented 6 years ago

7

NoReasonToComplain commented 6 years ago

Hi, I had the same issue. My solution was to buy a dot. Together with the dot my echo found the devices. Good solution for amazon.