Code Generating Bug existing in the "Subscribe" Block of Software MQTT Module
-
When using Software MQTT Component, the code genrated is wrong. Because the "Subscribe" Block is not a "Statement" but a "Root" block, I can't change the subscribe action after mqtt successfully initialized. So the generated code looks like this:
def setup(): global kb, mqtt_client ...... ==========BAD CODE HERE================ mqtt_client.subscribe('/cardputer', mqtt__cardputer_event, qos=0) ===================================== M5.begin() kb = MatrixKeyboard() kb.set_callback(kb_pressed_event) mqtt_client = MQTTClient('cardputer', 'xxx.xxx.xxx.xxx', port=1883, user='xxx', password='xxx', keepalive=0) mqtt_client.reconnect() .....Note that the subscribe code generated Even Before M5.begin()!
You have to fix this BLOCKING Issue asap to make the block coding mqtt code useful. I can now only manually modify code to make sure the subscribe action works.
-
Please use connect instead of reconnect.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login