Skip to content

Conversation

@bricevalenza
Copy link

Hello,

With the last version of mqtt, I have two errors:

  1. Connecthandler() takes 3 positional arguments but 4 were given

Resolution :

  • def connecthandler(mqc,userdata,rc):
  • def connecthandler(mqc,userdata,rc,properties=None ):
  1. %d format : a number is required, not dict.

Resolution:
replace %d with %s in logging messages
Example :

  •     logging.info("Connected to MQTT broker with rc=%d" % (rc))
    
  • logging.info("Connected to MQTT broker with rc=%s" % (rc))
    

error : 
1) Connecthandler()  takes 3 positional arguments but 4 were given
2) %d format : a number is required, not dict.
Update 

            llcmd = eiscp.core.command_to_iscp(msg.payload.decode("utf-8"))

error with set topic (bytes / string error)
@bricevalenza
Copy link
Author

bricevalenza commented Mar 30, 2021

I was able to make the "set" topic work

I needed to modify the "llcmd = eiscp.core.command_to_iscp" part.
I read that it could be a change of behavior with Python 3

Now, this (on MQTT Explorer): works :
image

@Zefiro
Copy link

Zefiro commented Aug 5, 2021

Hi bricevalenza,

Seems we have run into the same issues (see other pullrequests). I'm not familiar with Python, but since it imports paho.mqtt.client I'd assume this to be the relevant documentation:
https://www.eclipse.org/paho/index.php?page=clients/python/docs/index.php#on-connect

on_connect(client, userdata, flags, rc)
flags is a dict that contains response flags from the broker:

so if you're putting rc as third parameter, that'd explain why you get a dict instead of a number. (and %d works for the fourth parameter)

Not sure what issues you had with /set - I'm currently only using onkyo/set/system-power and onkyo/set/master-volume, and both work for me.

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

Successfully merging this pull request may close these issues.

2 participants