eschava / broadlink-mqtt

MQTT client to control BroadLink devices
MIT License
224 stars 61 forks source link

"Authentication failed" when connecting to wifi with Broadlink app (works on IHC) #77

Closed utech-git closed 4 years ago

utech-git commented 4 years ago

Hello,

I'm having trouble using broadlink-mqtt when I connect my broadlink to wifi via the "new" Broadlink App (https://play.google.com/store/apps/details?id=cn.com.broadlink.econtrol.international). After connecting to wifi with the app, when I start broadlink-mqtt i get the following error: (I masked the IP and MAC)

$ ./broadlink-mqtt/mqtt.py
[2020-06-30 10:19:29,407] DEBUG Connected to 'RM2' Broadlink device at '192.168.XXX.YYY' (MAC AA:BB:CC:DD:EE:FF) and started listening for commands at MQTT topic having prefix 'broadlink/RM2_DD_EE_FF/'
Traceback (most recent call last):
  File "/home/pi/broadlink-mqtt/mqtt.py", line 580, in <module>
    devices = get_device(cf)
  File "/home/pi/broadlink-mqtt/mqtt.py", line 363, in get_device
    device = configure_device(device, topic_prefix + mqtt_subprefix)
  File "/home/pi/broadlink-mqtt/mqtt.py", line 394, in configure_device
    device.auth()
  File "/home/pi/.local/lib/python3.7/site-packages/broadlink/__init__.py", line 225, in auth
    check_error(response[0x22:0x24])
  File "/home/pi/.local/lib/python3.7/site-packages/broadlink/exceptions.py", line 97, in check_error
    raise exception(error_code)
broadlink.exceptions.AuthenticationError: Authentication failed

(The error happens both on lookup or when I set the device_type, address and MAC on custom.conf).

But the weird thing is that when I connect the broadlink on wifi with the IHC App (https://play.google.com/store/apps/details?id=cn.com.broadlink.econtrol.plus) It works fine.

I made the test twice (connecting via broadlink app, getting the error, then resetting broadlink, connecting with IHC and working) and with 2 different broadlinks.

Right now it is working fine for me, so it's ok if you guys close the issue. I don't know if you are aware of this (or maybe it's something wrong with my configurations). But i think it would help some people if this was stated on the README page until it gets fixed.

Thanks for your work on this project!

eschava commented 4 years ago

Yes, it's a known issue and it definitely needs mentioning in the README I'll try to adjust it Thanks for your investigation!

PAJ320 commented 4 years ago

I am unable to connect my BG sockets via the IHC app, only the new BG app works. Consequently I am getting the Authentication error mentioned above. Do you have any suggestions for a workaround?

eschava commented 4 years ago

I've added a "known issues" section in the docs with this item only. Unfortunately, I'm not good at writing docs but I hope it will help somebody

VincentSC commented 3 years ago

@eschava Here's some text you can use

Connect Broadlink device to wifi

You need to use the Broadlink e-control app or Broadlink Intelligent Home Center to get the device connected to wifi. Don't use BroadLink -Universal TV Remote, as it is known to lock devices. Other apps have not been tested.

Press the reset-button for 5+ seconds till the led starts flashing continuously. Now it is in "smart mode". Go to the e-control or Intelligent home Center app and add a new device. Fill in the wifi-credentials and start scanning while staying close to the device. When the led starts flashing slower, it is discovered. When the led turns off, it is configured.

You (theoretically) can configure multiple devices at one.

Error messages

If you think you see reasons to improve the library, you are very welcome to contribute!

eschava commented 3 years ago

@eschava Here's some text you can use

Connect Broadlink device to wifi

Thanks a lot! Added these texts to the information page

VincentSC commented 3 years ago

Just ping me here, if you want me to write texts or to reformulate some texts