477 views|0 replies

6824

Posts

11

Resources
The OP
 

[DigiKey "Smart Manufacturing, Non-stop Happiness" Creative Competition] Implementing STM32F746 LVGL+LwIP+MQTT data transmission and reception [Copy link]

 

[DigiKey "Smart Manufacturing, Non-stop Happiness" Creative Competition] Porting FreeRTOS + LVGL + Lwip to implement TCPclient

After completing lvgl_lwip+tcp, if you need to send and receive data, then using mqtt is one of the best choices.

【Study Materials】

The learning materials for this transplantation come from Wildfire's "LwIP Application and Development Guide"

The online URL is: 21. MQTT Protocol - [Wildfire] LwIP Application Development Practical Guide - Based on Wildfire STM32 Documentation (embedfire.com)

Transplantation process

1. Download source code:

链接已隐藏,如需查看请登录或者注册

Extraction code: b92p

  1. After downloading, find the mqtt example and copy the MQTT folder in the source code to the project directory:
  2. Then copy the two files mqttclient.c/h to the Src directory:
  3. Modify the server IP address, username and password in mqttclient.h:
  4. Create two new tasks in freeRTOS and enable the recv and send tasks in the tasks:

6. Send a message in the lvgl key event, read the event in the sending task, and if there is a pressed message, send it to the server.

[Experimental results]

  1. Open the mqttx debugger, connect to the mqtt server, send a message, and print the message content on the serial port:

2. Press the button on the development board to publish a message, which can be received in mqttx

【discuss】

In the process of debugging mqtt, I found that FreeRTOS is difficult to control the stack size of the task. If the task stack is too large, the task will fail to start or crash during operation. Can anyone with experience give me some advice?

This post is from DigiKey Technology Zone
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list