TG-12F使用SDK对接阿里生活物联网平台

发布于:2024-04-18 ⋅ 阅读:(128) ⋅ 点赞:(0)


前言

本篇文章介绍一下TG-12F使用SDK对接阿里生活物联网平台

一、注意

  1. 使用虚拟机软件安装Ubuntu或者64位Ubuntu系统;
  2. 使用git clone下载代码;

二、准备

1. 安装Ubuntu(版本20.04 X64)程序运行时库。按顺序逐条执行命令:

sudo apt-get update
sudo apt-get -y install libssl-dev:i386
sudo apt-get -y install libncurses-dev:i386
sudo apt-get -y install libreadline-dev:i386

2. 安装Ubuntu(版本20.04 X64)依赖软件包。按照顺序逐条执行命令:

sudo apt-get update
sudo apt-get -y install git wget make flex bison gperf unzip
sudo apt-get -y install gcc-multilib
sudo apt-get -y install libssl-dev
sudo apt-get -y install libncurses-dev
sudo apt-get -y install libreadline-dev
sudo apt-get -y install python3 python3-pip

3. 安装Python依赖包。按照顺序逐条执行命令:

python3 -m pip install aos-cube

安装完成后,使用aos-cube --version查看aos-cube的版本号,需确保aos-cube的版本号大于等于0.5.11
注意:如果在安装过程中遇到网络问题,可使用国内镜像文件:

### 安装/升级 pip
python -m pip install --trusted-host=mirrors.aliyun.com -i https://mirrors.aliyun.com/pypi/simple/ --upgrade pip
### 基于pip依次安装第三方包和aos-cube
pip install --trusted-host=mirrors.aliyun.com -i https://mirrors.aliyun.com/pypi/simple/   setuptools
pip install --trusted-host=mirrors.aliyun.com -i https://mirrors.aliyun.com/pypi/simple/   wheel
pip install --trusted-host=mirrors.aliyun.com -i https://mirrors.aliyun.com/pypi/simple/   aos-cube

三、获取SDK

git clone --recursive https://github.com/Ai-Thinker-Open/Ai-Thinker-Open-TG7100C_SDK.git

图一

四、编译代码

终端输入./build.sh直接编译即可:

./build.sh example smart_outlet tg7100cevb SINGAPORE ONLINE 0

图一

图二

五、烧录

1. 下载TG-12F的烧录工具

点我跳转链接
在这里插入图片描述

2. 打开烧录工具

图二
图三
图四

3. 选择烧录文件

图五
图六
图七
图八
图九
图十

4. 烧录

图十一
图十二

5.启动程序

图十三
按下RST键

图十四

六、烧录阿里五元组

1. 查看MAC

图一

2.在生活物联网平台创建产品

点击链接进入生活物联网平台
图二
图三
图四
图五
图六
图七
图八
图九
图十
图十一
图十二
图十三
图十四
图十五
图十六

图十七
图十八
图十七
图十八
图十九
图二十
图二十一

3.烧录五元组

AT+LINKKEYCONFIG="a18ZXlt4Bpx","123456789abc","9f81866005d1dc47ebccd5c1b3a3d77c","haR4qXTXLHxVhHYn","6172928"
//写入自己的Product Key,Device Name,Device Secret,Product Secret,Product Id

图二十三
图二十四
图二十五
将上面的的五个元素写到AT指令中对应的位置
例子:AT+LINKKEYCONFIG=“a1gPvqz3KNm”,“7cb94c47ec7f”,“d5a0cc30580fdc675688dd69b2e2a7ab”,“uVXRCCkABxl7z1SR”,“21765357”

将指令通过串口调试助手发送给模组;

图二十六

七、测试效果

  1. 手机安装天猫精灵APP,然后自行注册

  2. 手机连接天猫精灵(开启蓝牙)
    图一图二
    图三
    后面自行操作

  3. 对天猫精灵说“天猫精灵,找队友”

  4. 连接设备后,就可以发起指令了

  5. 下面就是天猫精灵找对友并连接后的界面,已连网的就是当前使用的:
    图一

总结

以上就是对TG-12F使用SDK对接阿里生活物联网平台介绍!
以上就是本期分享的内容,更多资料可从安信可官网上获取。

官方官网:https://www.ai-thinker.com
开发资料:https://docs.ai-thinker.com/
官方论坛:http://bbs.ai-thinker.com
技术支持:support@aithinker.com

参考链接

  1. https://help.aliyun.com/document_detail/171416.html?spm=a2c4g.180778.0.0.6f157fb3ckHf6h
  2. https://blog.csdn.net/xh870189248/article/details/112792363

网站公告

今日签到

点亮在社区的每一天
去签到