Closed wongnam closed 5 years ago
Already solved, read the next issue "Does it work with Echo Plus?"
I will document it
@datech I will test 1st gen Echo Dot this night then will feedback to you soon.
Amazon Echo HUB nodes are unable to detect by Echo Dot 1gen and Echo Dot 2nd gen. Note that: 1- I try to use port 8000 (>1024) => no working 2- I use NAT to redirect port 80 to 8000 => Only work for Echo Dot 3rd gen
Thanks for checking this out.
Port forwarding will not work for 1st and 2nd as Alexa will always try to connect to the hub port in this case port 8000. The 3rd generation is ignoring the port configuration and is trying to connect to port 80. That's why forwarding is working.
Any chance to test 1st and 2nd gen with hub on port 80?
I don't want to access user as root. Any better solution? Thanks
Docker container running with root, but it has to share the host network, otherwise hub will not be discovered. But this will take more time to setup. Thanks anyway.
I will try to buy a 2nd gen Echo to see what might be the issue.
you don't need to access as root, just execute the command I suggested with sudo.. that's all
@Barabba11 Perhaps you do understand my issue, the issue is happen on Echo Dot 1st Gen and Echo Dot 2nd Gen, do you have tried these models?
Docker container running with root, but it has to share the host network, otherwise hub will not be discovered. But this will take more time to setup. Thanks anyway.
I will try to buy a 2nd gen Echo to see what might be the issue.
@datech I will setup another new set of fresh Pi 3B and let it access root for Node-red and your Echo Node +port:80 and see what is happen with Echo Dot 1st and 2nd Gen.. will revert you back the result.
It would be better not run node red with root, I had lot of troubles. Creators also told to avoid it
Wiki page for Troubleshooting
In my experience I saw routers that block broadcast in the LAN (so WiFi too), if the hosts can't ARP each other nothing will work. I suggest you to use a 3rd device in the same network (for example your phone) and ping both node red and Echo device. Useful is to test if port 80 is opened is TCPTEST for Windows
@datech I tried the new node ver 0.1.5 that a Echo Dot 1st Gen can discover the Amazon-Echo-Hub node at port 8000 now, but the command "ON" is always equal to "false" even i say turn "on" or turn "off". #4
update: Echo Dot 3rd Gen is work with the node without issue at port 80 NAT to 8000.
see my screen shot:
Thanks, @wongnam.
Would it be possible to sniff the HTTP traffic to see the requests sent to the hub? I would suggest to use Wireshark on Windows or tcpdump on Linux.
Seeing a video recently I discovered that this message may be generated when there is not a specific "switch on" command is told Alexa, this was my question about how to identify the request "switch it on" from "regulate it at.. ", which haven't been asnwered. Tomorrow I'll tr to figure it ut myself.
By now I would ask datech if the object that we see in the screenshot is exacty what ouptus Alexa or it is somehow manipulated by your module (interpreter). Kindly let us know that, thank you
@Barabba11, that's why I prefer to use Alexa mobile app to test the setup. if it is working I can start using the voice commands.
I was thinking that I've managed to answer on your question about setting the brightness and power state. Alexa will send all commands one by one and you have to be able to distinguish between: Turn On and Set brightness to 10% for example. If the device is turned off and you ask Alexa to set the brightness, Echo will first send a turn on command to the hub. So, If you have saved the old brightness value you can compare it with the new one.
I've used the following code in a function node to check if power state is changed.
var state = context.get('state');
if ( state !== undefined && state.on != msg.on ) {
msg.isOnChanged = true;
} else {
msg.isOnChanged = false;
}
context.set('state', msg);
return msg;
This will add isOnChanged in the message if "on" attribute is changed. Hope this helps
Message "on", "bri", "hue", "sat" and "ct" attributes are coming from Alexa and completely represent what Alexa is asking the hub to set.
Are them separate commands and you assemply all of the in an unique object? I will try with the app too..
Thanks, @wongnam.
Would it be possible to sniff the HTTP traffic to see the requests sent to the hub? I would suggest to use Wireshark on Windows or tcpdump on Linux.
@datech I installed it on a windows pc, my Echo Hub is on a RPI but i don't know how to use for this case.
@wongnam I think, I've managed to fix it in version 0.1.6.
@datech version 0.1.6 is not being seen in Node-red palette.
@wongnam I've just released it. It takes some time for Node-Red palette to be updated.
@datech It can turn on and off now but a new issue is happen, it's no color capabilities for me to setting the color and temperature now.
@wongnam Is it with Dot 2? Do you have any debug messages in the Node-Red console?
@datech if I tried it with Dot 1 and Dot 2 and Alexa App are the same situation.
update debug:
1/28/2019, 8:58:54 AMnode: 204e0e5a.1c23d2 newplug : msg : Object { on: true, bri: 130, hue: 21845, sat: 254, ct: 199 … } 1/28/2019, 8:58:57 AMnode: 204e0e5a.1c23d2 newplug : msg : Object { on: true, bri: 196, hue: 21845, sat: 254, ct: 199 … } 1/28/2019, 8:59:00 AMnode: 204e0e5a.1c23d2 newplug : msg : Object { on: false, bri: 196, hue: 21845, sat: 254, ct: 199 … }
when i try it with Dot 3 that it can set color as normal even in Aleax app.
(Just for notice: Each time i test it with a new Echo Dot that i have to delete the device in Alexa app and discovery again. i think it's normal and make sense. but when i mix Dot 1,2,3 together i don't know know which it lies with.)
@wongnam What about the Node-Red console? Is there anything like this:
28 Jan 10:22:29 - [debug] Request body: {"bri":128}
28 Jan 10:22:35 - [debug] Request body: {"hue":0,"sat":254}
28 Jan 10:22:57 - [debug] Request body: {"on":false}
How to go to this console, let me know please. Thanks.
It depends on way you are using Node-Red. How did you start the Node-Red? When you start Node-Red command line these messages will be printed there.
Here is the example output after starting the node-red command:
Welcome to Node-RED
===================
25 Jan 20:25:10 - [info] Node-RED version: v0.19.5
25 Jan 20:25:10 - [info] Node.js version: v11.7.0
25 Jan 20:25:10 - [info] Linux 4.15.0-29-generic x64 LE
25 Jan 20:25:10 - [info] Loading palette nodes
25 Jan 20:25:10 - [debug] Module: node-red-contrib-amazon-echo 0.1.4
25 Jan 20:25:10 - [debug] /home/vagrant/.node-red/node_modules/node-red-contrib-amazon-echo
25 Jan 20:25:10 - [debug] Module: node-red-node-email 0.1.29
25 Jan 20:25:10 - [debug] /usr/lib/node_modules/node-red/node_modules/node-red-node-email
25 Jan 20:25:10 - [debug] Module: node-red-node-feedparser 0.1.14
25 Jan 20:25:10 - [debug] /usr/lib/node_modules/node-red/node_modules/node-red-node-feedparser
25 Jan 20:25:10 - [debug] Module: node-red-node-rbe 0.2.4
25 Jan 20:25:10 - [debug] /usr/lib/node_modules/node-red/node_modules/node-red-node-rbe
25 Jan 20:25:10 - [debug] Module: node-red-node-twitter 1.1.4
25 Jan 20:25:10 - [debug] /usr/lib/node_modules/node-red/node_modules/node-red-node-twitter
25 Jan 20:25:11 - [warn] rpi-gpio : Raspberry Pi specific node set inactive
25 Jan 20:25:11 - [warn] rpi-gpio : Cannot find Pi RPi.GPIO python library
25 Jan 20:25:11 - [info] Settings file : /home/vagrant/.node-red/settings.js
25 Jan 20:25:11 - [info] Context store : 'default' [module=memory]
25 Jan 20:25:11 - [info] User directory : /home/vagrant/.node-red
25 Jan 20:25:11 - [warn] Projects disabled : editorTheme.projects.enabled=false
25 Jan 20:25:11 - [info] Flows file : /home/vagrant/.node-red/flows_vagrant.json
25 Jan 20:25:11 - [debug] loaded flow revision: 0ef50f34a6320182092e53a47e7c8ac5
25 Jan 20:25:11 - [debug] red/runtime/nodes/credentials.load : user provided key
25 Jan 20:25:11 - [debug] red/runtime/nodes/credentials.load : default key present. Will migrate
25 Jan 20:25:11 - [debug] red/runtime/nodes/credentials.load : keyType=user
25 Jan 20:25:11 - [info] Starting flows
25 Jan 20:25:11 - [debug] red/nodes/flows.start : starting flow : global
25 Jan 20:25:11 - [debug] red/nodes/flows.start : not starting disabled flow : 68b5755a.958bec
25 Jan 20:25:11 - [debug] red/nodes/flows.start : starting flow : 1966cd69.3766d3
25 Jan 20:25:11 - [info] Started flows
25 Jan 20:25:11 - [info] Server now running at http://127.0.0.1:1880/
25 Jan 20:25:17 - [debug] Request body: {"on":true}
25 Jan 20:25:23 - [debug] Request body: {"bri":128}
25 Jan 20:25:27 - [debug] Request body: {"on":false}
I start Node-Red by typing it in Putty SSL terminal, "Node-Red-Start"
Run the command node-red-log
@datech below is my log.
28 Jan 20:55:57 - [info] Starting flows 28 Jan 20:55:57 - [debug] red/nodes/flows.start : starting flow : global 28 Jan 20:55:57 - [debug] red/nodes/flows.start : starting flow : 2786eff5.1677 28 Jan 20:55:58 - [info] Started flows 28 Jan 20:55:58 - [info] Server now running at http://127.0.0.1:1880/ 28 Jan 20:56:18 - [debug] Request body: {"on":true} 28 Jan 20:56:34 - [debug] Request body: {"on":false}
28 Jan 20:56:18 - [debug] Request body: {"on":true}
This is turn on command
28 Jan 20:56:34 - [debug] Request body: {"on":false}
And this is turn off command, but I don't see any request for setting the brightness.
28 Jan 21:03:22 - [info] Starting flows 28 Jan 21:03:22 - [debug] red/nodes/flows.start : starting flow : global 28 Jan 21:03:22 - [debug] red/nodes/flows.start : starting flow : 2786eff5.1677 28 Jan 21:03:23 - [info] Started flows 28 Jan 21:03:23 - [info] Server now running at http://127.0.0.1:1880/ 28 Jan 21:04:33 - [debug] Request body: {"on":true} 28 Jan 21:04:38 - [debug] Request body: {"on":false} 28 Jan 21:04:41 - [debug] Request body: {"on":true,"bri":58} 28 Jan 21:04:46 - [debug] Request body: {"on":false} 28 Jan 21:04:48 - [debug] Request body: {"on":true} 28 Jan 21:04:50 - [debug] Request body: {"on":true,"bri":178} 28 Jan 21:04:54 - [debug] Request body: {"on":false}
So, the issue is that color capabilities are missing and setting the brightness is working correctly?
So, the issue is that color capabilities are missing and setting the brightness is working correctly?
Yes, you are right.
@Barabba11, that's why I prefer to use Alexa mobile app to test the setup. if it is working I can start using the voice commands.
I was thinking that I've managed to answer on your question about setting the brightness and power state. Alexa will send all commands one by one and you have to be able to distinguish between: Turn On and Set brightness to 10% for example. If the device is turned off and you ask Alexa to set the brightness, Echo will first send a turn on command to the hub. So, If you have saved the old brightness value you can compare it with the new one.
I've used the following code in a function node to check if power state is changed.
var state = context.get('state'); if ( state !== undefined && state.on != msg.on ) { msg.isOnChanged = true; } else { msg.isOnChanged = false; } context.set('state', msg); return msg;
This will add isOnChanged in the message if "on" attribute is changed. Hope this helps
Message "on", "bri", "hue", "sat" and "ct" attributes are coming from Alexa and completely represent what Alexa is asking the hub to set.
Hi mate, thnx for reply, pls look this video at about 3:19, how he gests from Alexa this "on_off_command : false", I don't have this label, I have only on:true and it is true also when I change only brightness. I've updated to 0.16. Thank you https://www.youtube.com/watch?v=4QfoXdcfqKI
what I have object on: true bri: 203 hue: 0 sat: 254 ct: 199 colormode: "ct" payload: "on" deviceid: "a5449f04d59f48"
@wongnam I'm not sure, but it might be related to the Echo device firmware version.
Here is how to updated it if you haven't done it already: https://www.amazon.com/gp/help/customer/display.html?nodeId=202168870
Latest version for Echo Dot 2nd gen is 628568520 https://www.amazon.com/gp/help/customer/display.html?nodeId=201602210
Ok, Thank you very much.
My Summary:
Another solution:
2- Can "Amazon Echo Hub" node work with HTTPS enabled Node-Red? Yes 3- Can "Amazon Echo Hub" node work if I have Echo or Echo Dot with multi generation
@datech As my issue is fixed. I close the case now. Thanks. @Barabba11 Hi, Please raise your issue with a new topic. Thanks.
link to @Barabba11 new topic #10
@wongnam Thanks for helping me fix these issues.
Hi, I am finding the document or any Wiki to fix "Error: listen EACCES: permission denied 0.0.0.0:80" issue.
eg: 1- Node-red is installed standalone on a Pi 3B+. How to enable node-red process to be started with root user? Currently i encounter this. please advise. Thanks.
2- Can "Amazon Echo Hub" node work with HTTPS enabled Node-Red? Update: 3- Can this node work if i have Echo or Echo Dot with multi generation(Original v1, v2, v3)?
Thanks.