Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install instructions no longer work #87

Open
digginsa opened this issue Nov 10, 2020 · 23 comments
Open

Install instructions no longer work #87

digginsa opened this issue Nov 10, 2020 · 23 comments

Comments

@digginsa
Copy link

Hello,

I have some BG1 and have followed the install instructions but always get the below error when running ./mqtt.py

File "./mqtt.py", line 4, in
import broadlink # pip install broadlink
File "/home/digginsa/.local/lib/python2.7/site-packages/broadlink/init.py", line 100
dev_type: int,
^
SyntaxError: invalid syntax

@eschava
Copy link
Owner

eschava commented Nov 10, 2020

Looks like new release of python-broadlink library doesn't work with Python 2.7, only Python 3

@digginsa
Copy link
Author

Looks like new release of python-broadlink library doesn't work with Python 2.7, only Python 3

Thanks for the response, I updated my Python to 3.7 but still get the same error any tips? appreciate in advance.

@eschava
Copy link
Owner

eschava commented Nov 10, 2020

What command do you use to run mqtt.py with Python 3.7?

@digginsa
Copy link
Author

im just running ./mqtt.py currently

What command do you use to run mqtt.py with Python 3.7?

im just running ./mqtt.py currently

@eschava
Copy link
Owner

eschava commented Nov 10, 2020

I guess it still uses Python 2.7
Could you please try command
python3 mqtt.py instead?

@digginsa
Copy link
Author

I guess it still uses Python 2.7
Could you please try command
python3 mqtt.py instead?

now het the following I did the pip install -r requirements.txt and paho installed but the same error.

Traceback (most recent call last):
File "mqtt.py", line 3, in
import paho.mqtt.client as paho # pip install paho-mqtt
ModuleNotFoundError: No module named 'paho'

@eschava
Copy link
Owner

eschava commented Nov 10, 2020

pip also should be from Python 3
e.g. pip3 or python3 -m pip install -r requirements.txt

@digginsa
Copy link
Author

pip also should be from Python 3
e.g. pip3 or python3 -m pip install -r requirements.txt

progress (I think) appreciate, just need to sort out the custom.conf now.

Traceback (most recent call last):
File "mqtt.py", line 587, in
devices = get_device(cf)
File "mqtt.py", line 347, in get_device
return configure_device(devices[0], topic_prefix)
File "mqtt.py", line 395, in configure_device
device.auth()
File "/home/digginsa/.local/lib/python3.7/site-packages/broadlink/device.py", line 198, in auth
check_error(response[0x22:0x24])
File "/home/digginsa/.local/lib/python3.7/site-packages/broadlink/exceptions.py", line 137, in check_error
raise exception(error_code)
broadlink.exceptions.AuthenticationError: [Errno -1] Authentication failed

@eschava
Copy link
Owner

eschava commented Nov 10, 2020

"Authentication failed" means that the Broadlink device is currently connected to the phone application. In order to use it by this tool you need to reset the device and connect it to broadlink-mqtt only
I'll add this to the main instructions

@digginsa
Copy link
Author

digginsa commented Nov 10, 2020 via email

@eschava
Copy link
Owner

eschava commented Nov 10, 2020

I'm not sure. You have either remove it from the mobile app or reset device settings to wipe out the connection between device and application

@digginsa
Copy link
Author

digginsa commented Nov 10, 2020 via email

@digginsa
Copy link
Author

digginsa commented Nov 10, 2020 via email

@digginsa
Copy link
Author

digginsa commented Nov 11, 2020 via email

@eschava
Copy link
Owner

eschava commented Nov 11, 2020

just need to work out now how to add additional sockets

what mode (device_type) do you use in your configuration?

@digginsa
Copy link
Author

digginsa commented Nov 11, 2020 via email

@eschava
Copy link
Owner

eschava commented Nov 11, 2020

You should use multiple_lookup type to use autodiscovery for multiple devices

@digginsa
Copy link
Author

digginsa commented Nov 11, 2020 via email

@eschava
Copy link
Owner

eschava commented Nov 11, 2020

Yes, this is what auto-lookup is for
The only thing that is essential for lookup modes is correct local_address if your device is connected to multiple networks

@digginsa
Copy link
Author

digginsa commented Nov 11, 2020 via email

@eschava
Copy link
Owner

eschava commented Nov 11, 2020

Looks like you changed mqtt_multiple_subprefix_format to {type}_{host}
So now you need to send commands to the topic like broadlink/BG1_192.168.1.71/power/1 not broadlink/power/1

@digginsa
Copy link
Author

digginsa commented Nov 11, 2020 via email

@dal31b05
Copy link

dal31b05 commented Dec 3, 2023

pip also should be from Python 3 e.g. pip3 or python3 -m pip install -r requirements.txt

I have tried this but I still get the ModuleNotFoundError: No module named 'paho' error.

paho is definitely installed as I get Requirement already satisfied if I run the installer again.
I have tried adding the package path to sys.path but that didn't help.
Not sure what I can try next.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants