---
title: "RP2040 Ethernet HAT MQTT[Mosquitto] Publisher/Subscriber"
url: "https://maker.wiznet.io/WIZnet/projects/rp2040-ethernet-hat-mqtt%5Bmosquitto%5D-publisher-subscriber/"
markdown_url: "https://maker.wiznet.io/WIZnet/projects/rp2040-ethernet-hat-mqtt%5Bmosquitto%5D-publisher-subscriber/md"
type: "UCC: User Created Content"
author: "louis_m"
author_url: "https://iotedition.tistory.com/9"
editor: "WIZnet"
editor_url: "https://maker.wiznet.io/"
original_author: "louis_m"
original_url: "https://iotedition.tistory.com/9"
published: "2023-02-20"
language: "en"
likes: 3
views: 182
comments: 0
source: "WIZnet Makers (https://maker.wiznet.io/)"
---

# RP2040 Ethernet HAT MQTT[Mosquitto] Publisher/Subscriber

> RP2040 Ethernet HAT MQTT[Mosquitto] Publisher/Subscriber

Original author: louis_m (source: https://iotedition.tistory.com/9)

## Article

**DETAILS**

## **MQTT?**

- Lightweight message protocols created for use in M2M and the Internet of Things.

It works on TCP.

- It consists of a &lt;Broker>&lt;Publisher>&lt;Subscriber> structure rather than a &lt;Server> and &lt;Client> structure.

&lt;Publisher> issues Topic.

&lt;Subscriber> subscribes to Topic.

&lt;Broker> serves as a relay and is suitable for 1:N communication.

![](https://blog.kakaocdn.net/dn/5po7r/btrgwDuJxkJ/j7MX1n5dyVRXkqcl3S7fjk/img.png)

#### **WIZnet Circuitpython Link –**[** https://github.com/Wiznet/RP2040-HAT-CircuitPython**](https://github.com/Wiznet/RP2040-HAT-CircuitPython)

![](https://maker.wiznet.io/uploads/2021/10/MQTT_5-300x195.png)

## WIZnet github code Upload toRP2040

From WIZnet github, take the file inside the library and copy it to the lib folder inside the Pico.

and MQTT/PubSub/W5x00_MQTT_pubsub.py file to code.py in Raspberry Pi pico.

![](https://maker.wiznet.io/uploads/2021/10/MQTT_1-300x125.png) ![](https://maker.wiznet.io/uploads/2021/10/MQTT_2-300x119.png)

## **Run MQTT mosquitto broker and client connect**

![](https://maker.wiznet.io/uploads/2021/10/MQTT_3-300x185.png) ![](https://maker.wiznet.io/uploads/2021/10/MQTT_4-300x201.png)

Execution Video Link

<https://www.youtube.com/watch?v=vtMPr-vCbEo>

---

Source: https://maker.wiznet.io/WIZnet/projects/rp2040-ethernet-hat-mqtt%5Bmosquitto%5D-publisher-subscriber/
