MQTT Client Subscription

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
MMliam
Posts: 121
Joined: Mon May 07, 2018 1:08 pm

MQTT Client Subscription

Post by MMliam » Tue Dec 14, 2021 12:13 am

I've been experimenting with MQTT in microPython. I have clients that publish & subscribe.
Regarding subscription I've created examples that use [client.check_msg()] and [return_msg = client.check_msg()] in a loop; retrieving messages in a previously set call-back function.

What's not clear is the form [return_msg = client.check_msg()]. So far whether the call-back retrieves a message or not the return_msg always appears to return None (a NoneType). I would have though it might also return the received message, but apparently it does not; it still returns None.

What are the other possible returns are possible by return_msg = client.check_msg() beside None?

Post Reply