Easy IoT 实现 mqtt 实验
一、实验目的及要求
【实验一】实现Easy IoT 配置 。
【实验二】实现Easy IoT 上 mqtt 消息的通讯
二、实验原理与内容
实现 mind+ 下 Easy IoT 上 mqtt 消息的通讯。
三、实验软硬件环境
硬件:掌控板
软件:Mind+
四、实验过程(实验步骤、记录、数据、分析)
1.核心代码截图
模块1:连接 WiFi、mqtt,Topic 1 发送信息到Topic 0
注意:通讯双方需要使用一样的 lot_id 和 lot_pwd "
模块2:收到信息(即 Topic 1 收到由 Topic 0 发送的信息)并亮灯提醒。
模块3:回复 Topic 0 信息并关灯
代码区:
/*!
* MindPlus
* mpython
*
*/
#include <MPython.h>
#include <DFRobot_Iot.h>
// 函数声明
void obloqMqttEventT1(String& message);
void onButtonBPressed();
// 静态常量
const String topics[5] = {
"eOGA5iFGg","SS405mKGg","","","