biddster / node-red-contrib-wemo-emulator

Why might you want to emulate Wemo? Well I wanted to be able to control my Node-RED Raspberry Pi using my Amazon Echo. The Echo has Wemo support built in so I thought I'd give it a try.
17 stars 9 forks source link

Random offline errors #5

Closed JontWeightman closed 7 years ago

JontWeightman commented 7 years ago

Hi - works great but I have set up 8 emulated devices and when I ask Alexa to find devices "she" will sometimes find all 8 and sometimes not. Additionally "she" will sometimes loose a connection to a random device and then reconnect ?

I also find if I make any changes in node-red with emulated devices I need to reboot to get all the devices to be recognised.

I'm running node red on a rasp pi 1 running Jessie without the GUI.

biddster commented 7 years ago

Thanks for the report. I've noticed the same issue with detection.

However, I've never had an actuation actually fail, even if Alexa is reporting that the device is offline.

Do you actually get actuation failures?

JontWeightman commented 7 years ago

Yes - Alexa reports that the device is unavailable - yet I can switch the device through the iOS home bridge interface.

Jonathan

On 23 Nov 2016, at 00:57, biddster notifications@github.com wrote:

Thanks for the report. I've noticed the same issue with detection.

However, I've never had an actuation actually fail, even if Alexa is reporting that the device is offline.

Do you actually get actuation failures?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

biddster commented 7 years ago

So Alexa fails. Hmm.

I think we may have to talk to the wemore guy. This node just wraps up that library. I don't do anything other than start and stop it.

JontWeightman commented 7 years ago

No - Alexa replies "blah" is not responding.

If I tell Alexa to find devices she may find some of the missing devices and drop others - or may find them all.

If I have set up a group on Alexa she will not report that she can't access all the items - i.e. "Downstairs lights" but if I reference them individually I may get the error not responding.

In the Alexa app the device also shows as offline.

On 23 Nov 2016, at 21:55, biddster notifications@github.com wrote:

Does it work if you say 'Alexa turn blah on'?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

JontWeightman commented 7 years ago

As an example:

Clicking refresh renders a different result:

Each offline item is reported by Alexa as not responding when I say "Alexa turn on/off blah."

On 23 Nov 2016, at 21:55, biddster notifications@github.com wrote:

Does it work if you say 'Alexa turn blah on'?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

biddster commented 7 years ago

Can you give me some dimensions around the NR setup please so I can help?

How many wemo emulator nodes are you using? What's NR running on? Pi 1, 2 etc? Within the config of the wemo emulator nodes, have you specified a port or let it auto-allocate?

I do think we'll probably go have to talk to the wemore chap.

JontWeightman commented 7 years ago

Hi,

I'm currently running 9 wemo emulator nodes on a pi v1 that has Jessie installed with the bundled version of NR.

I am running homebridge on the same pi to connect it with the iOS devices to control the house through the Apple Home app.

I have 9 esp8266 units running Pete Scargills code that I poll through MQTT every 10 seconds to check their status to feedback to NR through to homebridge and the iOS devices.

I have not defined any port numbers in the code.

Appreciate the help - how many wemo emulator nodes do you run successfully and on what platform?

Jonathan

On 26 Nov 2016, at 21:59, biddster notifications@github.com wrote:

Can you give me some dimensions around the NR setup please so I can help?

How many wemo emulator nodes are you using? What's NR running on? Pi 1, 2 etc? Within the config of the wemo emulator nodes, have you specified a port or let it auto-allocate?

I do think we'll probably go have to talk to the wemore chap.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

biddster commented 7 years ago

I have 8 wemo emulator nodes configured and running in my workspace. This is running on the same as you, a pi1. The only difference is that I specified sequential port numbers for my wemo emulator nodes; 54265, 54266 etc.

Would you mind trying static sequential ports and see if things stabilise?

I've looked at the wemore code and all it does is start a web server. Node is pretty light weight so I wouldn't expect that it's a resource starvation issue. But there might be a way with wemore to start a single web server and have different resource URIs? I'm not sure if this is allowed with the wemo protocol though.

Luke

PS, I'd not seen the homebridge stuff, looks pretty cool.

JontWeightman commented 7 years ago

Hi Luke,

That's looking better - I had to reboot the pi to find them but they don't appear to be dropping off anymore.

I can also make changes in NR without them all dropping away as well.

Thanks

Jonathan

On 28 Nov 2016, at 22:03, biddster notifications@github.com wrote:

I have 8 wemo emulator nodes configured and running in my workspace. This is running on the same as you, a pi1. The only difference is that I specified sequential port numbers for my wemo emulator nodes; 54265, 54266 etc.

Would you mind trying static sequential ports and see if things stabilise?

I've looked at the wemore code and all it does is start a web server. Node is pretty light weight so I wouldn't expect that it's a resource starvation issue. But there might be a way with wemore to start a single web server and have different resource URIs? I'm not sure if this is allowed with the wemo protocol though.

Luke

PS, I'd not seen the homebridge stuff, looks pretty cool.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

biddster commented 7 years ago

Thanks for helping me on this. I'll dig a little deeper, perhaps the port allocation algorithm within wemore isn't that stable?

Either way, I think I'll change the emulator node so port is mandatory.

mikebiddell commented 7 years ago

errr mine is faultless and I specified sequential ports.... high numbers 55555, 55556 etc.

biddster commented 7 years ago

I've released a new version which recommends specifying a port in all documentation.