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

PyPortal_MQTT_Control: not working on CircuitPython 5.3 #1110

Open
mikewop opened this issue May 18, 2020 · 3 comments
Open

PyPortal_MQTT_Control: not working on CircuitPython 5.3 #1110

mikewop opened this issue May 18, 2020 · 3 comments
Assignees

Comments

@mikewop
Copy link

mikewop commented May 18, 2020

It seems the library MiniMQTT has changed. The code in PyPortal_MQTT_Control uses

# Set up a MiniMQTT Client client = MQTT(socket, broker = secrets['broker'], port = 1883, username = secrets['user'], password = secrets['pass'], network_manager = wifi)
But the latest MiniMQTT library from adafruit-circuitpython-bundle-py-20200516.zip
defines a signature of:
def __init__( self, broker, port=None, username=None, password=None, client_id=None, is_ssl=True, log=False, keep_alive=60, ):

Notice that "socket" and "network_manager" are no longer part of the constructor.

Error:
Traceback (most recent call last): File "code.py", line 205, in <module> TypeError: function got multiple values for argument 'broker'
The code seems to be out of date w.r.t to the latest version of minimqtt

@brentru
Copy link
Member

brentru commented May 18, 2020

@mikewop Thanks for reporting this issue., a similar issue is open on MiniMQTT (adafruit/Adafruit_CircuitPython_MiniMQTT#25) and I will be taking a look at it later today.

@brentru
Copy link
Member

brentru commented May 19, 2020

@mikewop I patched MiniMQTT's hostname (adafruit/Adafruit_CircuitPython_MiniMQTT#33). However, this guide's code is still not up to date w.r.t the most recent version of MiniMQTT.

@ladyada Should I ping Richard A. (https://learn.adafruit.com/pyportal-mqtt-sensor-node-control-pad-home-assistant) who authored this guide? I could update the code but would not be able to test it as I don't have Home Assistant set up.

@ladyada
Copy link
Member

ladyada commented May 20, 2020

@brentru yep please contact 'em to update the guide, if you can submit the PR then they could test it!

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