eschava / broadlink-mqtt

MQTT client to control BroadLink devices
MIT License
222 stars 60 forks source link

ERROR No Broadlink device found #25

Closed fsmoreno closed 6 years ago

fsmoreno commented 6 years ago

hy, i have a two broadlinks,rm pro and rm mini but when i start python mqtt.py it doesnt found my device return ERROR No Broadlink device found

eschava commented 6 years ago

Do you have several networks on your box? If yes, then you can experiment with local_address config parameter to specify the address of the correct networking device

aaamitsingh commented 6 years ago

@eschava : I'm also getting the same error "ERROR No Broadlink device found" but my problem is bit different. I have tested this application on three different networks and in first two networks it's working but in third networks, it's not.

a) Network 1: It is my home network and here I'm using normal 20$ Tplink wifi and everything is working fine.

b) Network 2: Here I have used my mobile hotspot for testing and everything is working as expected.

c) Network 3: It's my office network and wifi used here is enterprise level Cisco wifi. The device is getting connected I can check this through any IP analyzer tool. But when I'm running the applicating I'm getting the above error.

Can you describe in details what you mean by "Do you have several networks on your box?" and what we have to change in "local_address config parameter"?

eschava commented 6 years ago

Can you describe in details what you mean by "Do you have several networks on your box?" and what we have to change in "local_address config parameter"?

I mean computer could be connected to several networks using different network adapters. And to select correct one (network with Broadlink device) you should specify local IP address related to that network using local_address config parameter

aaamitsingh commented 6 years ago

Broadlink RMpro is connected with Cisco AP and its IP is "192.168.1.31' I have changed the local_address to 127.0.0.1 but it's still not working :(

eschava commented 6 years ago

Could you please paste here output of "ifconfig -a" if script is run on Linux or "ipconfig" for Windows?

aaamitsingh commented 6 years ago

The strange thing is when I'm using different AP instead of Cisco in the same network its working but not working with Cisco AP. Here is the output of "ifconfig -a" eth0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500 ether b8:27:eb:ba:81:60 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 inet6 ::1 prefixlen 128 scopeid 0x10 loop txqueuelen 1000 (Local Loopback) RX packets 217 bytes 17577 (17.1 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 217 bytes 17577 (17.1 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.1.31 netmask 255.255.255.0 broadcast 192.168.1.255 inet6 fe80::2e3e:82c9:f265:ce74 prefixlen 64 scopeid 0x20 ether b8:27:eb:ef:d4:35 txqueuelen 1000 (Ethernet) RX packets 554 bytes 35941 (35.0 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 261 bytes 40899 (39.9 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

eschava commented 6 years ago

Did you try with local_address="192.168.1.31" ?

aaamitsingh commented 6 years ago

Sorry for the late reply @eschava, Today I bought another pair of RM mini 3 and RM Pro+ but unfortunately they also have the same issue. I have also tried with your suggested setting local_address="192.168.1.31" but the issue still persists.

eschava commented 6 years ago

Does it work with Android application if Cisco AP is used?

aaamitsingh commented 6 years ago

Unfortunately not working with Android App also. I have tried with both the app eControll and ihc(Intelligent Home Center) to configure RM pro 3+ and RM 3 min but getting this error "Cannot find the device to be added" but my device is getting connected in the network I can see the device through I/P analyzer tool.

Can you explain how the app and mqtt.py discover the device?

eschava commented 6 years ago

I do not know how Android app works But python client sends broadcast UDP message to 255.255.255.255:80 and waits for an answer

aaamitsingh commented 6 years ago

Can you send me a flow chart that how the connection get established and example of data broadcast message and answer? It will very helpful for me to debug further.

eschava commented 6 years ago

Sorry, that's all that I know You can check sources of the python-broadlink library to get details