基于STM32L431设计的云端绿化管理系统

一、环境介绍 mcu: 采用意法半导体低功耗芯片 stm32l431rct6
编译软件:  keil5 + cubemx
云平台: 采用阿里云物联网云平台


二、功能与硬件介绍 2.1 功能介绍 前面的一篇文章是同样的环境,云平台采用的是腾讯物联网云平台(基于stm32l431设计的云端绿化管理系统(esp8266+腾讯物联网云平台)_ds小龙哥的专栏-csdn博客_stm32l431)
这篇文章将云平台换成了阿里云物联网平台,其他硬件功能都是一样的。
再次介绍一下功能:
这是采用stm32l431 + es8266设计的云端绿化管理系统,可以通过esp8266 wifi连接阿里云物联网平台,使用网页和阿里云的app远程进行绿化管理,比如:实时获取光照强度、温度、湿度、远程控制水泵进行浇水灌溉,在任何地方都可以给自己种的花花草草浇水,了解周边环境情况。
2.2 硬件介绍 开发板采用的是小熊开发板,包括完成绿化管理系统的所有功能都是采用小熊派开发板的配套套件完成。
小熊开发板板载了一个stlink调试器(就是stm32f103c8t6实现的),程序下载非常方便。串口1用来调试打印数据,esp8266是接在串口lpuart1上的。

小熊派开发板本身自带的例子程序也比较丰富,自带例子里采用的云平台是华为的物联网云平台,工程比较庞大使用了liteos操作系统。本文里的工程是重新编写的代码,使用裸机完成项目功能,没有跑操作系统,云平台采用阿里云平台服务器,mqtt协议和esp8266驱动代码都是重新编写,框架、逻辑比较清晰,代码量也较少,适合初学者入门学习。
相关传感器模块型号: (采用的是小熊开发板配套的e53_ia1扩展板)

wifi采用:esp8266
温湿度检测传感器采用:sht30
光照强度检测传感器采用:bh1750
电机采用:微型直流电机


三、阿里云物联网云平台 关于阿里云物联网平台的创建与使用之前也介绍过一篇,只不过mcu采用的是stm32f103c8t6,这篇文章mcu采用的是stm32l431rct6,属于低功耗系列,更加适合物联网领域;如果之前没有使用过阿里云物联网云平台,先参考这里学习了解一下:stm32+esp8266+mqtt协议连接阿里云物联网平台_ds小龙哥的专栏-csdn博客_stm32连接阿里云
3.1 在阿里云物联网平台创建产品 官网地址: 阿里云登录 - 欢迎登录阿里云,安全稳定的云计算服务平台

创建产品: 

配置产品模型参数:页面最后加密方式这些选择默认 

添加设备: 


设备添加之后,可以一键将设备证书复制下来保存到记事本,方便后面使用;不复制也没关系,后面也可以设备信息中查看的: 

{ productkey: a1ukqj2enej, devicename: greeningmanagement, devicesecret: a5268d71d363f1bd68e708c9097fa3d2} 设备添加完成:

在设备信息的页面也可以查看设备证书:


添加功能属性字段:



根据自己产品交互使用的数据类型进行定义:(绿化管理系统使用了温度、湿度、电机、光照强度一共4个数据字段。其中电机是读写类型,其他都是只读类型)




自定义功能属性添加完毕之后就发布上线:

查看物模型数据格式:后面通过mqtt协议向服务器上报数据就是这个格式

可以选择导出模型文件,导出是一个json格式文件,方便设备端开发参考。 

3.2  通过iot studio创建web可视化界面 地址: 阿里云登录 - 欢迎登录阿里云,安全稳定的云计算服务平台
之前旧版本的iot studio 选项是在产品页面里,现在移到控制台首页了。
新建项目:



 新建web应用:


设计web页面之前 先关联产品和设备:

选择对应的产品进行关联:

选择对应的设备进行关联:

关联成功:

下面继续编辑web页面:

可以更改页面名称:

添加组件,设计页面:  阿里云的web页面控件非常丰富,可以根据自己需求设计好看的页面。

接下来就要给每个控件配置数据源:


调整仪表盘的属性:刻度字号

配置完毕:


有域名的可以绑定到域名:

这里可以预览页面:

四、登录阿里云平台测试 4.1  mqtt协议登录的域名与端口号 关于mqtt协议登录所需要的参数官方说明文档: 使用mqtt.fx接入物联网平台 - 阿里云物联网平台 - 阿里云
mqtt登录域名的格式:
${yourproductkey}.iot-as-mqtt.${yourregionid}.aliyuncs.com 其中:
${yourproductkey}:请替换为设备所属产品的productkey
${yourregionid}:请替换为物联网平台设备所在地域代码。
下面是阿里云国内的服务器地域和可用区详情:
地域名称 所在城市 region id 可用区数量华北 1 青岛 cn-qingdao 2华北 2 北京 cn-beijing 10华北 3 张家口 cn-zhangjiakou 3华北 5 呼和浩特 cn-huhehaote 2华北 6 乌兰察布 cn-wulanchabu 3华东 1 杭州 cn-hangzhou 8华东 2 上海 cn-shanghai 8华南 1 深圳 cn-shenzhen 6华南 2 河源 cn-heyuan 2华南 3 广州 cn-guangzhou 2西南 1 成都 cn-chengdu 2  端口号是:1883
经过上面的格式解释,我的阿里云服务器登录的域名就是(选择的是上海服务器):a1ukqj2enej.iot-as-mqtt.cn-shanghai.aliyuncs.com
域名对应的ip地址(动态解析出来的):  106.14.207.159
在线解析域名网站:ip地址查询 ip查询 查ip 公网ip地址归属地查询 网站ip查询 同ip网站查询 ip反查域名 ip查域名 同ip域名
4.2  mqtt协议登录的id、用户名、密码 4.2.1 mqtt_clientid 固定格式:${clientid}|securemode=${mode},signmethod=${signmethod}|。
参数说明:
${clientid}:  设备id,一般填设备的硬件编号。我这里就直接填当前的设备名称,后面的密码里也要填这个id,必须一样就行。(设备名称就是创建设备的时候复制出来3个参数里的设备名称)
securemode=3:tcp直连模式,无需设置ssl/tls信息。
securemode=2:tls直连模式,需要设置ssl/tls信息。
${signmethod}:算法类型,支持hmacmd5和hmacsha1。
示例:
当前我的绿化管理系统设备名称是:greeningmanagement ,选择tcp直连模式,选择hmacsha1算法类型。
那么我的clientid就是:
greeningmanagement|securemode=3,signmethod=hmacsha1| 4.2.2 mqtt_username 固定格式:${devicename}&${productkey}
参数解释:
${devicename} 是设备的名称(就是创建设备的时候复制出来3个参数里的设备名称)
${productkey} 是设备的productkey(就是创建设备的时候复制出来3个参数里的productkey)
示例:
当前我的绿化管理系统设备名称是:greeningmanagement ,我的productkey是:a1ukqj2enej
那么我的username就是:
greeningmanagement&a1ukqj2enej 4.2.3 mqtt_password 下载密码生成小工具:使用mqtt.fx接入物联网平台 - 阿里云物联网平台 - 阿里云

下载工具,运行:

根据说明填充参数:

说明:productkey、devicename、devicesecret:是设备证书信息,可在控制台设备详情页查看。clientid在4.2.1小节里已经说过了。时间戳可以省略不填。
点击generate生成密码。
经过小工具生成后的密码是:
9e580b36ee7e001980af61ea09eaf85f0211c146 4.3  使用mqtt客户端工具登录阿里云服务器 mqtt客户端工具下载地址:qt应用编程: 编写mqtt客户端登录onetnet服务器完成主题订阅与发布_ds小龙哥的专栏-csdn博客_onenet topic订阅与发布
根据前面获取的参数填入,登录测试: (为了保证不会断开连接,可以勾选mqtt客户端右下角的心跳包选项,保活)

如果登录成功,在阿里云控制台页面上可以看到设备已经在线:


如果设备能成功上线,那么就说明mqtt所需要的参数都已经填正确了,接下来就可以正常订阅、发布主题了。
4.4  主题订阅、发布测试 属性上报主题与属性设置主题格式:

发布主题:
/sys/a1ukqj2enej/greeningmanagement/thing/event/property/post
上报属性消息的格式(精简格式):  
{method:thing.event.property.post,params:{temperature:11.1,humidity:12.1,illumination:13,machine:1}}
上报属性消息的格式详细格式(可以带上id和版本号): 
{method:thing.event.property.post,id:1234567890,params:{temperature:66.1,humidity:22.1,illumination:88,,machine:1},version:1.1.1}
订阅主题:
/sys/a1ukqj2enej/greeningmanagement/thing/service/property/set
通过mqtt客户端订阅主题、上报属性数据:

     把相关的参数填正确,然后登陆,订阅、发布测试:

阿里云物联网平台云端收到的数据: 
地址:阿里云登录 - 欢迎登录阿里云,安全稳定的云计算服务平台


点击页面上的的按钮,mqtt客户端可以收到下发的消息(要先订阅才能收到消息):

注意:  阿里云按钮点击下发消息之后,客户端收到后要重新上报一次按钮的状态回去,不然阿里云按钮会恢复之前的状态。
五、stm32代码测试 stm32的代码主要分为以下几个部分:
1.  esp8266底层驱动代码:   完成esp8266模式配置、数据发送,应答检测等底层网络接口。
2.  mqtt协议代码:这是参考标准mqtt编写c语言版本mqtt协议框架代码,实现了重要的几个接口(主题订阅、主题发布、心跳包、登录mqtt服务器),底层采用esp8266发送数据。 这个mqtt协议不是使用esp8266本身的sdk,是根据mqtt协议自己实现的,所以如果使用其他的网卡,移植也很方便,不挑网卡设备。
3.  传感器初始化代码: 完成温湿度传感器、光照强度传感器的驱动代码编写。
4.  lcd屏代码:  lcd是spi接口的,可以显示温湿度、光照强度数据。
5.  main函数:  完成整个逻辑代码编写,检测阿里云平台是否有下发的指令,进行分析,完成水泵的开关控制;当温室和湿度到达某个阀值,自动控制水泵浇水,并上报给阿里云平台;主程序里1秒检测一次温湿度、光照强度、电机状态主动上报给阿里云平台;在设备端按下按键(模拟现场实体开关)也可以控制水泵浇水或者关闭,这些状态都会实时上报给云平台。
程序的模板是使用cubemx生成的。

5.1  main.c代码/** ****************************************************************************** * @file : main.c * @brief : main program body ****************************************************************************** ** this notice applies to any and all portions of this file * that are not between comment pairs user code begin and * user code end. other portions of this file, whether * inserted by the user or by software development tools * are owned by their respective copyright owners. * * copyright(c) 2019 stmicroelectronics * * redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * 1. redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. neither the name of stmicroelectronics nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * this software is provided by the copyright holders and contributors as is * and any express or implied warranties, including, but not limited to, the * implied warranties of merchantability and fitness for a particular purpose are * disclaimed. in no event shall the copyright holder or contributors be liable * for any direct, indirect, incidental, special, exemplary, or consequential * damages (including, but not limited to, procurement of substitute goods or * services; loss of use, data, or profits; or business interruption) however * caused and on any theory of liability, whether in contract, strict liability, * or tort (including negligence or otherwise) arising in any way out of the use * of this software, even if advised of the possibility of such damage. * ****************************************************************************** *//* includes ------------------------------------------------------------------*/#include main.h#include stm32l4xx_hal.h#include i2c.h#include usart.h#include gpio.h#include e53_ia1.h#include lcd.h#include spi.h#include mqtt.h#include esp8266.h/* user code begin includes */#include stdio.h/* user code end includes */void systemclock_config(void);#define esp8266_wifi_ap_ssid cmcc-cqvn //将要连接的路由器名称 --不要出现中文、空格等特殊字符#define esp8266_ap_password 99pu58cb //将要连接的路由器密码//阿里云物联网服务器的设备信息#define mqtt_clientid greeningmanagement|securemode=3,signmethod=hmacsha1|#define mqtt_username greeningmanagement&a1ukqj2enej#define mqtt_password 9e580b36ee7e001980af61ea09eaf85f0211c146 //订阅与发布的主题#define set_topic /sys/a1ukqj2enej/greeningmanagement/thing/service/property/set //订阅#define post_topic /sys/a1ukqj2enej/greeningmanagement/thing/event/property/post //发布//保存温湿度、光照强度e53_ia1_data_typedef e53_ia1_data;//显示文本char lcd_text_str[50];uart_handletypedef at_usart;//低功耗串口初始化int32_t at_usart_init(void){ at_usart.instance = lpuart1; at_usart.init.baudrate = 115200; at_usart.init.wordlength = uart_wordlength_8b; at_usart.init.stopbits = uart_stopbits_1; at_usart.init.parity = uart_parity_none; at_usart.init.hwflowctl = uart_hwcontrol_none; at_usart.init.mode = uart_mode_rx | uart_mode_tx; if(hal_uart_init(&at_usart) != hal_ok) { _error_handler(__file__, __line__); } // __hal_uart_clear_flag(usart, uart_flag_tc); __hal_uart_enable_it(&at_usart, uart_it_idle); __hal_uart_enable_it(&at_usart, uart_it_rxne); hal_nvic_enableirq(lpuart1_irqn); //使能usart1中断通道 hal_nvic_setpriority(lpuart1_irqn, 3, 3); //抢占优先级3,子优先级3 return 0;}unsigned char esp8266_recvbuf[max_recv_cnt];unsigned int esp8266_recv_cnt=0;unsigned int esp8266_recv_flag=0;void lpuart1_irqhandler(){ //接收到数据 if(__hal_uart_get_flag(&at_usart, uart_flag_rxne) != reset) { if(esp8266_recv_cntrdr & 0x00ff); } else { esp8266_recv_flag=1; } } else if (__hal_uart_get_flag(&at_usart, uart_flag_idle) != reset) { __hal_uart_clear_idleflag(&at_usart); esp8266_recv_flag=1; }}void at_senddata(unsigned char *p,unsigned int len){ int i=0; for(i=0;iisr & 0x40) == 0); //循环发送,直到发送完毕 lpuart1->tdr = p[i]; }}char mqtt_message[200];int main(void){ int i=0; int cnt=0; int motor_state=0; hal_init(); systemclock_config(); mx_gpio_init(); mx_i2c1_init(); mx_spi2_init(); mx_usart1_uart_init(); at_usart_init(); //初始化硬件 stm32l431rc_bearpibh1750_i2c1\stm32l431rc_bearpibh1750_i2c1.axf: error: l6218e: undefined symbol printf (referred from main.o). init_e53_ia1(); lcd_init(); lcd_clear(black);//清屏为黑色 lcd_showstring(20, 00, 240, 32, 32, init esp8266);//显示字符串,字体大小32*32 if(esp8266_init()) { printf(esp8266硬件检测错误.\n); lcd_clear(black);//清屏为黑色 lcd_showstring(0, 00, 240, 32, 32, esp8266 error);//显示字符串,字体大小32*32 } else { lcd_clear(black);//清屏为黑色 lcd_showstring(20, 00, 240, 32, 32, esp8266 ok);//显示字符串,字体大小32*32 printf(准备连接到指定的服务器.\n); //非加密端口 printf(wifi:%d\r\n,esp8266_sta_tcp_client_mode(esp8266_wifi_ap_ssid,esp8266_ap_password,a1ukqj2enej.iot-as-mqtt.cn-shanghai.aliyuncs.com,1883,1)); } //2. mqtt协议初始化 mqtt_init(); //3. 连接阿里云iot服务器 while(mqtt_connect(mqtt_clientid,mqtt_username,mqtt_password)) { printf(服务器连接失败,正在重试...\n); hal_delay(500); } printf(服务器连接成功.\n); //3. 订阅主题 if(mqtt_subscribetopic(set_topic,0,1)) { printf(主题订阅失败.\n); } else { printf(主题订阅成功.\n); } while (1) { if(hal_gpio_readpin(key1_gpio_port,key1_pin)==gpio_pin_reset)//查询按键key1低电平 { hal_delay(10);//消抖 if(hal_gpio_readpin(key1_gpio_port,key1_pin)==gpio_pin_reset)//查询按键key1低电平 { hal_gpio_writepin(led_gpio_port,led_pin,gpio_pin_set);//亮 //补光灯亮 hal_gpio_writepin(ia1_light_gpio_port, ia1_light_pin, gpio_pin_set); //电机转 hal_gpio_writepin(ia1_motor_gpio_port, ia1_motor_pin, gpio_pin_set); motor_state=1; } } if(hal_gpio_readpin(key2_gpio_port,key2_pin)==gpio_pin_reset)//查询按键key2低电平 { hal_delay(10);//消抖 if(hal_gpio_readpin(key2_gpio_port,key2_pin)==gpio_pin_reset)//查询按键key2低电平 { hal_gpio_writepin(led_gpio_port,led_pin,gpio_pin_reset);//灭 //补光灯灭 hal_gpio_writepin(ia1_light_gpio_port, ia1_light_pin, gpio_pin_reset); //电机停 hal_gpio_writepin(ia1_motor_gpio_port, ia1_motor_pin, gpio_pin_reset); motor_state=0; } } cnt++; hal_delay(10); if(cnt>=100) { cnt=0; e53_ia1_read_data(); printf(光照强度:%.1f %%\r\n, e53_ia1_data.lux); printf(湿度:%.1f %%\r\n,e53_ia1_data.humidity); printf(温度:%.1f ℃\r\n, e53_ia1_data.temperature); sprintf(lcd_text_str,l: %0.1f %%,e53_ia1_data.lux); lcd_showstring(40, 50+10+32*1, 240, 32, 32,lcd_text_str); sprintf(lcd_text_str,h: %.1f %%,e53_ia1_data.humidity); lcd_showstring(40, 50+10+32*2, 240, 32, 32,lcd_text_str); sprintf(lcd_text_str,t: %.1f c,e53_ia1_data.temperature); lcd_showstring(40, 50+10+32*3, 240, 32, 32,lcd_text_str); //切换引脚的状态 hal_gpio_togglepin(led_gpio_port,led_pin); //上传数据 sprintf(mqtt_message,{\method\:\thing.event.property.post\,\id\:\1234567890\,\params\:{\temperature\:%f,\humidity\:%f,\illumination\:%f,\machine\:%d},\version\:\1.1.1\}, e53_ia1_data.temperature,e53_ia1_data.humidity,e53_ia1_data.lux,motor_state); mqtt_publishdata(post_topic,mqtt_message,0); //根据湿度自动灌溉 if((int)e53_ia1_data.humidity5) { esp8266_recvbuf[esp8266_recv_cnt]='\0'; //使用字符串查找函数 if(strstr((char*)&esp8266_recvbuf[5],\machine\:1)) { motor_state=1; //电机状态更新 //电机转 hal_gpio_writepin(ia1_motor_gpio_port, ia1_motor_pin, gpio_pin_set); printf(开启电机...\n); } else if(strstr((char*)&esp8266_recvbuf[5],\machine\:0)) { //电机停 hal_gpio_writepin(ia1_motor_gpio_port, ia1_motor_pin, gpio_pin_reset); motor_state=0; printf(关闭电机...\n); } for(i=0;i;i++)printf(%c,esp8266_recvbuf[i]);>;i++)>)> 5.2  mqtt.c代码#include mqtt.hu8 *mqtt_rxbuf;u8 *mqtt_txbuf;u16 mqtt_rxlen;u16 mqtt_txlen;u8 _mqtt_txbuf[256];//发送数据缓存区u8 _mqtt_rxbuf[256];//接收数据缓存区typedef enum{ //名字 值 报文流动方向 描述 m_reserved1 =0 , // 禁止 保留 m_connect , // 客户端到服务端 客户端请求连接服务端 m_connack , // 服务端到客户端 连接报文确认 m_publish , // 两个方向都允许 发布消息 m_puback , // 两个方向都允许 qos 1消息发布收到确认 m_pubrec , // 两个方向都允许 发布收到(保证交付第一步) m_pubrel , // 两个方向都允许 发布释放(保证交付第二步) m_pubcomp , // 两个方向都允许 qos 2消息发布完成(保证交互第三步) m_subscribe , // 客户端到服务端 客户端订阅请求 m_suback , // 服务端到客户端 订阅请求报文确认 m_unsubscribe , // 客户端到服务端 客户端取消订阅请求 m_unsuback , // 服务端到客户端 取消订阅报文确认 m_pingreq , // 客户端到服务端 心跳请求 m_pingresp , // 服务端到客户端 心跳响应 m_disconnect , // 客户端到服务端 客户端断开连接 m_reserved2 , // 禁止 保留}_typdef_mqtt_message;//连接成功服务器回应 20 02 00 00//客户端主动断开连接 e0 00const u8 parket_connetack[] = {0x20,0x02,0x00,0x00};const u8 parket_disconnet[] = {0xe0,0x00};const u8 parket_heart[] = {0xc0,0x00};const u8 parket_heart_reply[] = {0xc0,0x00};const u8 parket_suback[] = {0x90,0x03};void mqtt_init(void){ //缓冲区赋值 mqtt_rxbuf = _mqtt_rxbuf; mqtt_rxlen = sizeof(_mqtt_rxbuf); mqtt_txbuf = _mqtt_txbuf; mqtt_txlen = sizeof(_mqtt_txbuf); memset(mqtt_rxbuf,0,mqtt_rxlen); memset(mqtt_txbuf,0,mqtt_txlen); // //无条件先主动断开// mqtt_disconnect();// hal_delay(100);// mqtt_disconnect();// hal_delay(100);}/*函数功能: 登录服务器函数返回值: 0表示成功 1表示失败*/u8 mqtt_connect(char *clientid,char *username,char *password){ u8 i,j; int clientidlen = strlen(clientid); int usernamelen = strlen(username); int passwordlen = strlen(password); int datalen; mqtt_txlen=0; //可变报头+payload 每个字段包含两个字节的长度标识 datalen = 10 + (clientidlen+2) + (usernamelen+2) + (passwordlen+2); //固定报头 //控制报文类型 mqtt_txbuf[mqtt_txlen++] = 0x10; //mqtt message type connect //剩余长度(不包括固定头部) do { u8 encodedbyte = datalen % 128; datalen = datalen / 128; // if there are more data to encode, set the top bit of this byte if ( datalen > 0 ) encodedbyte = encodedbyte | 128; mqtt_txbuf[mqtt_txlen++] = encodedbyte; }while ( datalen > 0 ); //可变报头 //协议名 mqtt_txbuf[mqtt_txlen++] = 0; // protocol name length msb mqtt_txbuf[mqtt_txlen++] = 4; // protocol name length lsb mqtt_txbuf[mqtt_txlen++] = 'm'; // ascii code for m mqtt_txbuf[mqtt_txlen++] = 'q'; // ascii code for q mqtt_txbuf[mqtt_txlen++] = 't'; // ascii code for t mqtt_txbuf[mqtt_txlen++] = 't'; // ascii code for t //协议级别 mqtt_txbuf[mqtt_txlen++] = 4; // mqtt protocol version = 4 对于 3.1.1 版协议,协议级别字段的值是 4(0x04) //连接标志 mqtt_txbuf[mqtt_txlen++] = 0xc2; // conn flags mqtt_txbuf[mqtt_txlen++] = 0; // keep-alive time length msb mqtt_txbuf[mqtt_txlen++] = 100; // keep-alive time length lsb 100s心跳包 保活时间 mqtt_txbuf[mqtt_txlen++] = byte1(clientidlen);// client id length msb mqtt_txbuf[mqtt_txlen++] = byte0(clientidlen);// client id length lsb memcpy(&mqtt_txbuf[mqtt_txlen],clientid,clientidlen); mqtt_txlen += clientidlen; if(usernamelen > 0) { mqtt_txbuf[mqtt_txlen++] = byte1(usernamelen); //username length msb mqtt_txbuf[mqtt_txlen++] = byte0(usernamelen); //username length lsb memcpy(&mqtt_txbuf[mqtt_txlen],username,usernamelen); mqtt_txlen += usernamelen; } if(passwordlen > 0) { mqtt_txbuf[mqtt_txlen++] = byte1(passwordlen); //password length msb mqtt_txbuf[mqtt_txlen++] = byte0(passwordlen); //password length lsb memcpy(&mqtt_txbuf[mqtt_txlen],password,passwordlen); mqtt_txlen += passwordlen; } memset(mqtt_rxbuf,0,mqtt_rxlen); esp8266_recv_flag=0; esp8266_recv_cnt=0; mqtt_sendbuf(mqtt_txbuf,mqtt_txlen); hal_delay(200); memcpy((char *)mqtt_rxbuf,esp8266_recvbuf,esp8266_recv_cnt); for(i=0;i;i++)printf(%#x> 5.3 设备运行效果 串口打印调试数据: 连接成功



六、阿里云生活物联网平台 官网首页:生活物联网平台 - 帮助中心 - 阿里云
生活物联网平台是阿里云iot针对生活领域推出的物联网平台,以解决家电智能化的问题。

生活物联网平台提供了设备接入能力,有公版app可以直接开发使用;下篇文章再讲解生活物联网平台使用示例。
完整项目源代码下载地址(不懂可以私信问): https://download.csdn.net/download/xiaolong1126626497/19272620


区块链中的分叉全面解析
什么是光合有效辐射,它的作用是怎样的
自制光驱雕刻机diy教程
物联网时代下智慧水务发展所需的仪表
高性能模拟、混合集成电路设计供应商——XBLW芯伯乐
基于STM32L431设计的云端绿化管理系统
TPMS技术及轮胎定位原理的电路设计
基于CD4017的电子骰子电路
国家电网变压器标准 电力变压器的原理 变电站工作原理
极客对Xilinx Vivado HLS工具使用经验和心得
机器人技术重心应从军用转到民用
采甩EPlKl000C208-3芯片实现温度检测无线发射接收系统设计
最新的机器人将怎样用于工业与军事
定位精准至“厘米级” 高精度“赋能”全社会
电动机选型注意事项
基于Arduino与机智云的家居环境远程系统设计(云平台部署)
AI算法进步神速对人工智能意味着什么
海康威视获得发明专利授权:“一种人体应激性信息识别方法、装置及电子设备
中国电信将持续强化IPTV平台赋能,打造有温度的“智慧乡村”!
马云:未来30年 数据将取代石油,成最强大能源