bwssytems / ha-bridge

Home automation bridge that emulates a Philips Hue light system and can control other systems such as a Vera, Harmony Hub, Nest, MiLight bulbs or any other system that has an http/https/tcp/udp interface. This is a compact impl to run on small format computers. This is impl started from this project https://github.com/armzilla/amazon-echo-ha-bridge.
Apache License 2.0
1.45k stars 198 forks source link

Problems with finding Devices #1283

Open FrancisHGR opened 3 years ago

FrancisHGR commented 3 years ago

Hey everyone,

I spent so much time debugging the latest version 5.4.0 (literally days) because after I had to switch my router and wifi setup, nothing was working. I wanted to share my findings with you as this might prevent some frustration that I experienced plenty of. I know there are lots of threads here with bit pieces of information, it's however hard to find it and a bit chaotic.

I had the ha-bridge running since maybe 3 or 4 years, everything was fine but since some time problems started coming up and devices weren't reached by Alexa.

It seems that there is a huge problem on the detection of devices on ports other than 80 since some time. So I can without good conscience not recommend to run it on another port. This could vary depending on which Echo you have, I am talking about an Echo Dot 2 and 3, both on the latest software.

The even bigger issue though, was the numbering of devices. After importing my old devices, I was not able to edit the function calls, everytime I did so the changes were discarded after saving. This is NOT an file permission issue. Also UpnP Trace was activated and Alexa found the ha-bridge, but never got the devices communicated. This was because my devices were numbered below the config-setting of I think 100. I set it up to 400 and renumbered them, now everything is working again.

Hope that saves some time and pain. Would be good to put that in the documentation on the front page.

Kallagan99 commented 3 years ago

hello Francis ! Thanks for this sum up. Have you information about needed communication ports between HABridge machine & Alexa Echo ?

FrancisHGR commented 3 years ago

http 80 and UPNP 50000 as is the basic setting seem to be reliable for Alexa

Kallagan99 commented 3 years ago

http 80 and UPNP 50000 as is the basic setting seem to be reliable for Alexa

but if the 2 devices (HABridge server & Alexa) are on the same network, nothing on the router should block communication, isn't it ?

Kammi61871 commented 3 years ago

Ok my solution to work again is.

i had installed v4.5.5 no devices respons, Deleted all devices updated to v5.4.0 no devices found, go back to v4.5.6 renumber devices, discover alexe all my devices found and respons and working with alexa again.

on pi u can add multiple virtuel adapter on eth0 or wlan0 to work on port 80

sudo ifconfig
eth0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether b8:27:eb:56:14:30  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 277654  bytes 140248704 (133.7 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 277654  bytes 140248704 (133.7 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.142  netmask 255.255.255.0  broadcast 192.168.0.255
        ether b8:27:eb:03:41:65  txqueuelen 1000  (Ethernet)
        RX packets 22888  bytes 12367796 (11.7 MiB)
        RX errors 0  dropped 1568  overruns 0  frame 0
        TX packets 13009  bytes 5133517 (4.8 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0:0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.144  netmask 255.255.255.255  broadcast 192.168.0.255
        ether b8:27:eb:03:41:65  txqueuelen 1000  (Ethernet)

wlan0:1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.146  netmask 255.255.255.255  broadcast 192.168.0.255
        ether b8:27:eb:03:41:65  txqueuelen 1000  (Ethernet)

wlan0:2: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.148  netmask 255.255.255.255  broadcast 192.168.0.255
        ether b8:27:eb:03:41:65  txqueuelen 1000  (Ethernet)

wlan0:3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.186  netmask 255.255.255.255  broadcast 192.168.0.255
        ether b8:27:eb:03:41:65  txqueuelen 1000  (Ethernet)

wlan0:4: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.150  netmask 255.255.255.255  broadcast 192.168.0.255
        ether b8:27:eb:03:41:65  txqueuelen 1000  (Ethernet)
FrancisHGR commented 3 years ago

http 80 and UPNP 50000 as is the basic setting seem to be reliable for Alexa

but if the 2 devices (HABridge server & Alexa) are on the same network, nothing on the router should block communication, isn't it ?

Yes in theory nothing should block it. However I saw some very fishy behavior, which I think is related to the mechanism with which Alexa scans for relevant devices. I used 3 routers and countless combinations. Biggest problem was definitely the numbering of devices, especially if you import old settings. Port other than 80 was the second biggest problem, was just hoping to guide some people that might have also problems like that.

Also, I still have problems with Alexa saying that my connection has timed out and the device is not reachable... even though the device is already on, all tests via the link on the bridge or directly on my host produce no errors.

Kallagan99 commented 3 years ago

I read a lot of times about number of devices and use of port 80. I removed all devices but one, so this shouldn't be an issue. I use port 80...

Is there somewhere a documentation about network communications between HABridge, Echo device & Amazon servers ? Can the HABridge been installed on another network ?