TA的每日心情 | 开心 2020-12-9 12:47 |
---|
签到天数: 1 天 [LV.1]初来乍到
|
本帖最后由 mossan 于 2021-1-17 20:43 编辑
第一步,用这个例子:
https://www.arduino.cn/thread-102228-1-1.html
或者使用AliOS-Things-3.1.0\application\example\linkkit_demo。
第二步,Arduino IDE例子:
1、在ESP8266_AliYun库文件示例基础上做了修改,支持SmartConfig,支持ArduinoJson6.0以上版本。
2、库文件:
https://gitee.com/schuck/ESP8266_AliYun
3、修改Arduino\libraries\PubSubClient\PubSubClient.h:
// MQTT_MAX_PACKET_SIZE : Maximum packet size. Override with setBufferSize().
#ifndef MQTT_MAX_PACKET_SIZE
#define MQTT_MAX_PACKET_SIZE 1024
#endif
// MQTT_KEEPALIVE : keepAlive interval in Seconds. Override with setKeepAlive()
#ifndef MQTT_KEEPALIVE
#define MQTT_KEEPALIVE 30
#endif
|
|