hardillb / node-red-contrib-alexa-home-skill

A Node-RED node to control things via Amazon Alexa
https://alexa-node-red.bm.hardill.me.uk/
Apache License 2.0
89 stars 42 forks source link

Frequent disconnects to Amazon #65

Closed Bra1nK closed 5 years ago

Bra1nK commented 5 years ago

Every minute or so I get "Error: connect ECONNREFUSED 34.240.81.189:8883" in the node-red debug window and shortly after the Alexa Home node reconnects, I don't know if this is an Amazon Server or an App issue. I'm using Node-Red version 0.20.5 on a RaspberryPi 2 and just installed this app due to issues with the Alexa-Local no longer working. This results in switching failures if the alexa request coincides with a disconnect. I'm on a 160mb cable connection so my internet link isn't the problem.

hardillb commented 5 years ago

You have created more than one config node, this is wrong,

There should only be one config node shared between all the device nodes.

Bra1nK commented 5 years ago

No there was only the one which I confirmed by deleting it then recreating and pointing the 5 nodes that were using it back to the same config node

hardillb commented 5 years ago

Then you are trying to use the same account on more than one instance of Node-RED.

The logs clearly show you have an instance of the client connected and then a second one tries to connect and disconnects the first.

You can only have 1 instance per username.

$ tail -f 95adfb1f6adb5a94c2bcf1a2f4114e86f5fedbcca59a92f95ecab30f5807a0ad-json.log | grep Br
{"log":"1568578157: |-- mosquitto_auth_unpwd_check(Bra1n)\n","stream":"stderr","time":"2019-09-15T20:09:17.598175045Z"}
{"log":"1568578157: |-- getuser(Bra1n) AUTHENTICATED=1 by mongo\n","stream":"stderr","time":"2019-09-15T20:09:17.605814539Z"}
{"log":"1568578157: Client Bra1n already connected, closing old connection.\n","stream":"stderr","time":"2019-09-15T20:09:17.605990422Z"}
{"log":"1568578157: Client Bra1n disconnected.\n","stream":"stderr","time":"2019-09-15T20:09:17.606090566Z"}
{"log":"1568578157: New client connected from 82.3.242.253 as Bra1n (c1, k60, u'Bra1n').\n","stream":"stderr","time":"2019-09-15T20:09:17.606248342Z"}
{"log":"1568578183: |-- mosquitto_auth_unpwd_check(Bra1n)\n","stream":"stderr","time":"2019-09-15T20:09:43.17715481Z"}
{"log":"1568578183: |-- getuser(Bra1n) AUTHENTICATED=1 by mongo\n","stream":"stderr","time":"2019-09-15T20:09:43.18464906Z"}
{"log":"1568578183: Client Bra1n already connected, closing old connection.\n","stream":"stderr","time":"2019-09-15T20:09:43.184816337Z"}
{"log":"1568578183: Client Bra1n disconnected.\n","stream":"stderr","time":"2019-09-15T20:09:43.184918808Z"}
{"log":"1568578183: New client connected from 82.3.242.253 as Bra1n (c1, k60, u'Bra1n').\n","stream":"stderr","time":"2019-09-15T20:09:43.18507297Z"}
{"log":"1568578227: |-- mosquitto_auth_unpwd_check(Bra1n)\n","stream":"stderr","time":"2019-09-15T20:10:27.812322003Z"}
{"log":"1568578227: |-- getuser(Bra1n) AUTHENTICATED=1 by mongo\n","stream":"stderr","time":"2019-09-15T20:10:27.819488439Z"}
{"log":"1568578227: Client Bra1n already connected, closing old connection.\n","stream":"stderr","time":"2019-09-15T20:10:27.81963364Z"}
{"log":"1568578227: Client Bra1n disconnected.\n","stream":"stderr","time":"2019-09-15T20:10:27.819727505Z"}
{"log":"1568578227: New client connected from 82.3.242.253 as Bra1n (c1, k60, u'Bra1n').\n","stream":"stderr","time":"2019-09-15T20:10:27.819897678Z"}
{"log":"1568578253: |-- mosquitto_auth_unpwd_check(Bra1n)\n","stream":"stderr","time":"2019-09-15T20:10:53.5660879Z"}
{"log":"1568578253: |-- getuser(Bra1n) AUTHENTICATED=1 by mongo\n","stream":"stderr","time":"2019-09-15T20:10:53.573653612Z"}
{"log":"1568578253: Client Bra1n already connected, closing old connection.\n","stream":"stderr","time":"2019-09-15T20:10:53.573800415Z"}
{"log":"1568578253: Client Bra1n disconnected.\n","stream":"stderr","time":"2019-09-15T20:10:53.573901191Z"}
{"log":"1568578253: New client connected from 82.3.242.253 as Bra1n (c1, k60, u'Bra1n').\n","stream":"stderr","time":"2019-09-15T20:10:53.57405061Z"}
Bra1nK commented 5 years ago

It was running on another machine (a Pi3), I'd forgotten all about it, I've disconnected it for now and will set up a new account for that next time I use it. Thanks for the debugging help.

hardillb commented 5 years ago

You can only link the skill once with Amazon so you can't run 2 accounts at once.