-
Notifications
You must be signed in to change notification settings - Fork 9
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
Can't run: ValueError: too many values to unpack #42
Comments
Hi, I am surprised that |
here you go:
|
hum, that's strange, I can't get the same error now as I installed mosquitto on raspbian, not using it in a container anymore. But it stays on : INFO:switchbot_mqtt:connecting to MQTT broker localhost:1883 |
If you have discord maybe we can try to debug this together ? |
Could you verify that mosquitto is fully accessible at
I would prefer discussing the issue here (for future reference and because asynchronous communication is easier for me) |
closing due to inactivity |
i had the same issue as @enlight3d. i fixed the issue by editing the file at line 39: mqtt_broker_host, mqtt_broker_port = mqtt_client.socket().getpeername() became peerTuple = mqtt_client.socket().getpeername()
mqtt_broker_host, mqtt_broker_port = (peerTuple[0], peerTuple[1]) @fphammerle if you have time maybe this should get pushed into the lib. my python skills are minimal and i'm not confident this is the best way to fix this |
Hi @rursache, as previously said, I didn't expect getpeername() to return more than (host, port).
https://docs.python.org/3/library/socket.html#socket.socket.getpeername |
the output is |
Thanks! Would |
can't check right now but there's no reason not to, it's just another way to unwrap the tuple. i would argue that mqtt_broker_host, mqtt_broker_port, *_ = mqtt_client.socket().getpeername() looks better. i think that the |
Thanks! I pushed a fix to the main branch. |
fix released as v3.2.1 |
Hello, I first tried running the program using docker but no luck (PermissionError: Operation not permitted error from python in the container) so I thought I could try the normal way, but upon launching it, I'm getting this error:
I did have a mosquitto client running on docker when I tried this command.
I'm running this on a RPI3B+ using raspbian buster.
The text was updated successfully, but these errors were encountered: