Latest IDE/Cam Firmware broke app - MQTTClient incompatibility?

Doing Haar face detection on an H7 Plus and sending data to an MQTT broker, and with the latest firmware/IDE update, the MQTTClient is broken.

TypeError: "unexpected keyword argument ‘ssl’.

Any suggestions? Known issue? Workaround?

This appears to be the offending commit that broke it:

The ssl arg is no longer required, just remove it and it should work like it did before, it’s as easy as that.

Tried that. New error is “TypeError: extra positional arguments given”.

client = MQTTClient(client_id=“openmv”, server=“myserver.blah.blah”, port=8883, ssl_params={ “server_hostname”: “myserver.blah.blah” }, user=“USER”, password=“PASSWORD”)

There are no positional args in the line you posted, are you sure the error is raised from that line ? Can you please post the full exception backtrace ?

Traceback (most recent call last):
File “”, line 59, in
File “mqtt.py”, line 106, in connect
TypeError: extra positional arguments given
OpenMV v4.5.3; MicroPython v1.22-omv.r17; OPENMV4P-STM32H743

Is the issue with another breaking change in the ssl library? I needed to use the server_hostname keyword parameter in ssl_params to enable the ssl connection to work. Has that changed?

No, it’s wrap_socket the ssl_params should have been unpacked first. Try the attached library, if you copy it to storage it should be imported instead of the frozen one.

mqtt.py (7.5 KB)

If you confirm it’s working fine, I will commit the fix.

Sorry, actually use this one:

mqtt.py (7.5 KB)

Forgive my lack of knowledge here, but specifically where should I place this file?

That worked - and it exposed another breaking change in the image library - the img.gamma_corr function now throws the same error. I’ll have to look into that one separately.

I merged the mqtt fix. Note that a lot of code has been refactored in this release, and some args were renamed or removed, to simplify the API. We should have updated docs up very soon.

1 Like

Arguments must be passed per the docs now. We updated the parsing logic to enforce calling conventions.

1 Like