What is MQTT and how to add it into PICO?

For creating an IOT application, the most important thing is creating a platform allows user to monitor and control remotely user’s application.

As the current development on IOT application, there were a lot of IOT clouds allowing user to use their platform to create their own dream.

MQTT is one of the protocols will be used in IOT cloud. It required simple coding and data formatting to create a communication with IOT cloud.

MQTT is a protocol allows devices publish formatted data to a MQTT broker’s channel as a temporary storage. If there is a device has subscribed that related channel, it will collect this information from the MQTT broker for its own purpose.

As the MQTT could be consider as a real time communication, this only required a simple coding to allow low end solution like WIZnet with Raspberry Pi PICO to have an opportunity to create a IOT application on cloud platforms.

Adding MQTT protocol Procedure:

  1. Add adafruit_minimqtt library
  2. Basic WIZnet’s networking setups (Please refer link 5 and 6)
  3. Data formmating
  4. MQTT client setup
  5. Subscribe channels
  6. Connect MQTT broker
  7. Publish information to broker or Collect information from subscribed channels

Links:

  1. WIZnet’s MQTT example – https://maker.wiznet.io/2021/10/21/wiznet-ethernet-hatrp2040-mqtt-publish-mosquitto/
  2. WIZnet’s ASW cloud example – https://maker.wiznet.io/2021/12/31/connect-w5100s-evb-pico-to-aws-cloud/
  3. MQTT – https://mqtt.org/
  4. WIZnet’s general MQTT coding example – https://github.com/Wiznet/RP2040-HAT-CircuitPython/tree/master/examples/MQTT/PubSub
  5. How to add DHCO into your Raspberry Pi Pico? – https://www.iwiznet.cn/2021/12/20/how-to-add-dhcp-into-your-raspberry-pi-pico/
  6. How to create a simple TCP/IP connection? – https://www.iwiznet.cn/2021/12/15/how-to-create-a-simple-tcp-ip-connection/
MQTT communication diagram