coldfire84 / node-red-alexa-home-skill-v3-web

Web Service/ API for Alexa and Google Home Node-RED Smart Home Control
https://red.cb-net.co.uk/
Apache License 2.0
51 stars 7 forks source link

Node-Red Flow Keep Reconnecting #88

Closed GibbotauroSpaziale closed 4 years ago

GibbotauroSpaziale commented 4 years ago

I Feel stupid, this is my 3rd report.

I'm deploing on my own, I've sucessfully set up the web service and linked the skill.

Than I've setupped the raspberry pi with Node Red, I downloaded the flow for alexa contrib and build an exemple flow. The problemi is when I put my credential in alexa-smart-home-v3 node and insert the right urls for the mqtt server and the user server it keep on restarting. Using an account created on your system it's work perfectly.

Now I'm having another problem, I was trying to make a local image of rednode-web using:

Searching on hardill git say that it's multy istance problem, it can handle only one at the time. Idk how to check that and eventually kill one.

What could cause the problem? There is any way to debug it?


cd ~ rm -rf nodejs-webapp mkdir nodejs-webapp cd nodejs-webapp/ git clone --single-branch -b development https://github.com/coldfire84/node-red-alexa-home-skill-v3-web.git . sudo docker build -t red:0.10 -f Dockerfile .

sudo docker create \ --name nr-web-local \ --network nr-alexav3 \ -p 3000:3000 \ -v /etc/letsencrypt:/etc/letsencrypt \ -v /var/docker/red/credentials:/root/.aws/credentials \ -e ALEXA_DEBUG=true \ -e WEB_HOSTNAME=$WEB_HOSTNAME \ -e MQTT_URL=$MQTT_URL \ -e MQTT_PORT=$MQTT_PORT \ -e MQTT_USER=$MQTT_USER \ -e MQTT_PASSWORD=$MQTT_PASSWORD \ -e MONGO_HOST=$MONGO_HOST \ -e MONGO_PORT=$MONGO_PORT \ -e MONGO_USER=$WEB_USER \ -e MONGO_PASSWORD=$WEB_PASSWORD \ -e MAIL_SERVER=$MAIL_SERVER \ -e MAIL_USER=$MAIL_USER \ -e MAIL_PASSWORD=$MAIL_PASSWORD \ -e GOOGLE_ANALYTICS_TID=$GOOGLE_ANALYTICS_TID \ -e COOKIE_SECRET=$COOKIE_SECRET \ -e ALEXA_CLIENTID=$ALEXA_CLIENTID \ -e ALEXA_CLIENTSECRET=$ALEXA_CLIENTSECRET \ -e HOMEGRAPH_APIKEY=$HOMEGRAPH_APIKEY \ -e "GHOMEJWT=$GHOMEJWT" \ --restart always \ --log-opt max-size=100m \ --log-opt max-file=5 \ red:0.10

and than I stopped nr-alexav3-web, started nr-web-local but it didn't work. Afther some test I decided to restore the old config, i stopped all'containers and submit:

sudo docker system prune -a

I've resubmitted all the commands but nr-alexav3-web still won't work

I've also tryed to disable the firewall

What could I made wrong?

Thanks again for your help and time. Sorry I'm annoying

coldfire84 commented 4 years ago

Searching on hardill git say that it's multy istance problem, it can handle only one at the time. Idk how to check that and eventually kill one.

The multi-instance "issue" should be long-resolved in this skill, as I've set it to add a UUID to the client name, meaning each connection is considered unique however, caution that there is no way to control which instance responds to a command - so avoid using the same account and same device across multiple Node-RED instances.

The problemi is when I put my credential in alexa-smart-home-v3 node and insert the right urls for the mqtt server and the user server it keep on restarting.

What keeps restarting? The Node-RED instance or the connection to the MQTT server?

What are your MQTT server logs showing? Is your user being authenticated?

GibbotauroSpaziale commented 4 years ago

The Node-RED instance was. But now, after i tryed to build from sources It stopped work. So I decided to follow again the guide but it still wont work. It show Error 522.

coldfire84 commented 4 years ago

Can you please show console logs.

GibbotauroSpaziale commented 4 years ago

I think that I've solved the problem of 522 error. Adding to recrate all docker you must drop and recreate the firewall.

So rolling back to the question that opened this post my problem is that

Cattura 2

It's working fine I think but it stuck in that state.

From the app if I try to turn on or off the light it says device unresponsive.

coldfire84 commented 4 years ago

Adding to recrate all docker you must drop and recreate the firewall.

This isn't necessary if you've followed all of the "deploy your own" guide relating to firewall config - if you haven't followed this I'm going to be limited in what I can offer support wise.

From the app if I try to turn on or off the light it says device unresponsive.

It looks like your Node-RED instance still cannot communicate with the MQTT/ Web API server. The Alexa App expects a response from the API server after every command/ even when you are just looking at a specific device (it polls every 2.5 seconds).

coldfire84 commented 4 years ago

For reference, it looks as though the default subnet may vary on creating the Docker network.

See #91 for a similar issue/ set of instructions to check.

GibbotauroSpaziale commented 4 years ago

Thank you! I've colse my issues for that reason, I'll try to follow the other