This is a project targeted at educating the ‘maker community’ on how to use the MQTT protocol for bidirectional communication with the ESP32 to publish messages and subscribe to topics. The code and underlying setup also can also be used as a boilerplate for more professional solutions since it is robust and compatible with a range of hardware systems.
https://www.hivemq.com/article/iot-tutorial-bidirectional-mqtt-communication-esp32/
Read more here in the presentation
T-Display-S3 is a ESP32-S3 development board. It is equipped with a color 1.9" LCD screen and two programmable buttons. Communication using I8080 interface. Retains the same layout design as T-Display. You can directly use ESP32S3 for USB communication or programming.
MQTT is a lightweight, publish-subscribe, machine to machine network protocol for message queue/message queuing service. It is designed for connections with remote locations that have devices with resource constraints or limited network bandwidth, such as in the Internet of Things.
mqtt pub -h broker.hivemq.com -t TkkrLab/SubTopic -m "zaterdag1"
mqtt sub -h broker.hivemq.com -t TkkrLab/#
- https://code.visualstudio.com/download
- https://github.com/hivemq/mqtt-cli/releases/download/v4.22.0/mqtt-cli-4.22.0-win.zip
- https://hivemq.github.io/mqtt-cli/
- https://mqttx.app/downloads
to reset to factory empty:
python -m esptool --chip esp32-s3 erase_flash
T-Display-S3 is available from: LILYGO, Amazon and Aliexpress.
Please use Arduino ESP32 version below 3.0. There are too many changes in version 3.0 and it has not been updated yet.
- In Arduino Preferences, on the Settings tab, enter the
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
URL in theAdditional boards manager URLs
input box. - Click OK and the software will install.
- Search for ESP32 in Tools → Board Manager and install
esp32
(Arduino-ESP32) - Copy everything from this repository lib folder to Arduino library folder (e.g.
C:\Users\YourName\Documents\Arduino\libraries
) - Select the correct settings in the Tools menu as shown below.
Setting | Value |
---|---|
USB CDC On Boot | Enabled |
CPU Frequency | 240MHz (WiFi) |
Core Debug Level | None |
USB DFU On Boot | Enabled |
Events Run On | Core 1 |
Flash Mode | QIO 80MHz |
Flash Size | 16MB (128Mb) |
JTAG Adapter | Integrated USB JTAG |
Arduino Runs On | Core 1 |
USB Firmware MSC On Boot | Disabled |
Partition Scheme | Huge APP (3MB No OTA/1MB SPIFFS) |
PSRAM | OPI PSRAM |
USB Mode | Hardware CDC and JTAG |
- Install VisualStudioCode and Python
- Search for the
PlatformIO
plugin in theVisualStudioCode
extension and install it. - After the installation is complete, you need to restart
VisualStudioCode
- After restarting
VisualStudioCode
, selectFile
in the upper left corner ofVisualStudioCode
->Open Folder
-> select theT-Display-S3
directory - Click on the
platformio.ini
file, and in theplatformio
column, cancel the sample line that needs to be used, please make sure that only one line is valid - Click the (✔) symbol in the lower left corner to compile
- Connect the board to the computer USB
- Click (→) to upload firmware
- Click (plug symbol) to monitor serial output
- The program can be written normally, but there is still no display after writing
- There are factory test files in the firmware folder, which can be flashed into the board to check whether the board is normal. If there is still no display, then it can be judged that there is a problem with the board or the screen
- Delete the <TFT_eSPI> in the libraries, and replace the <TFT_eSPI> in the folder of the main page to the libraries directory
- When opening the Arduino IDE, it prompts whether to upgrade the library, please choose not to upgrade, otherwise it will overwrite the configuration of the <TFT_eSPI> display