Giter Site home page Giter Site logo

ai-thinker-open / telink_sig_mesh Goto Github PK

View Code? Open in Web Editor NEW
93.0 7.0 41.0 9.46 MB

Telink 蓝牙芯片SIG Mesh SDK,可对接天猫精灵,小爱同学等

Assembly 0.56% C 92.02% C++ 5.32% Python 0.36% Shell 0.03% Objective-C 1.04% HTML 0.34% Perl 0.01% Makefile 0.33%
mesh ble telink

telink_sig_mesh's Introduction

Telink SIG Mesh SDK

Telink 泰凌位 蓝牙Mesh芯片软件开发套件

使用方法


获取TC32编译工具链(文档仅适用于Linux)

目前仅测试了linux及Mac OS系统,Windows系统仅提供了编译工具链,需自行设置环境变量

Mac OS版本获取编译工具链 git clone https://github.com/flyskywhy/tc32 -b macos

Windows 版本工具链下载地址 https://shyboy.oss-cn-shenzhen.aliyuncs.com/readonly/tc32-win.rar

linux版本获取编译工具链

wget https://shyboy.oss-cn-shenzhen.aliyuncs.com/readonly/tc32_gcc_v2.0.tar.bz2

解压到opt文件夹 (也可解压到其他文件夹)

sudo tar -xvjf tc32_gcc_v2.0.tar.bz2 -C /opt/

添加工具链到环境变量(以解压到/opt为例)

export PATH=$PATH:/opt/tc32/bin

测试是否搭建成功

tc32-elf-gcc -v

如果搭建成功将打印如下信息:

Using built-in specs.
COLLECT_GCC=tc32-elf-gcc
COLLECT_LTO_WRAPPER=/opt/tc32/lib/gcc/tc32-elf/4.5.1.tc32-elf-1.5/lto-wrapper
Target: tc32-elf
Configured with: ../../gcc-4.5.1/configure --program-prefix=tc32-elf- --target=tc32-elf --prefix=/opt/tc32 --enable-languages=c --libexecdir=/opt/tc32/lib --with-gnu-as --with-gnu-ld --without-headers --disable-decimal-float --disable-nls --disable-mathvec --with-pkgversion='Telink TC32 version 2.0 build' --without-docdir --without-fp --without-tls --disable-shared --disable-threads --disable-libffi --disable-libquadmath --disable-libstdcxx-pch --disable-libmudflap --disable-libgomp --disable-libssp -v --without-docdir --enable-soft-float --with-newlib --with-gcc --with-gnu- --with-gmp=/opt/tc32/addontools --with-mpc=/opt/tc32/addontools --with-mpfr=/opt/tc32/addontools
Thread model: single
gcc version 4.5.1.tc32-elf-1.5 (Telink TC32 version 2.0 build) 

获取SDK

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

编译

进入examples/8258_mesh工程目录

cd Telink_SIG_Mesh/examples/8258_mesh

执行下列编译指令:

make all

输出类似如下信息说明编译成功:

Invoking: Print Size
tc32-elf-size -t / ... /Telink_SIG_Mesh/examples/8258_mesh/out/8258_mesh.elf
text    data     bss     dec     hex filename
134720    2724   14160  151604   25034 / ... /Telink_SIG_Mesh/examples/8258_mesh/out/8258_mesh.elf
134720    2724   14160  151604   25034 (TOTALS)
Finished building: sizedummy

烧录程序到芯片

安信可自主开发了串口烧录工具,无需官方烧录器即可使用,前提是要先将安信可bootloader烧录到模块中。

串口烧录接线方式如下(安信可TB-02模块):

串口 模块
VCC 3V3
GND GND
TX RX
RX TX
RTS RST
DTR PA1

注意:PA1为boot选择引脚,为低电平进入下载模式,为高电平进入运行模式

烧录指令:

make flash

其他指令:

make erase_fw //擦除固件
make erase_key //擦除Mesh相关数据
make monitor //打开串口监控
python3 ../../make/Telink_Tools.py -p /dev/ttyUSB0 burn_triad 1345 78da07fa44a7 221746e805ac0e6269bd4d3e55f1145c //烧录三元组

telink_sig_mesh's People

Contributors

flyskywhy avatar ospanic avatar xuhongv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

telink_sig_mesh's Issues

进不去配网模式

为什么我烧了插座的固件和元组,按照三短两长的办法进不去配网模式了

这个是做什么的?

这个是个蓝牙设备?对接到天猫精灵、小爱音箱后能干什么?怎么玩呢?

如何连接小爱同学?

复现:
xzw@xzw-RTX2070:~/Telink_SIG_Mesh/example/RGBCW_Ali_Mesh/mesh$ gedit mesh_config.h 

mesh_config.h

...
125 #if __PROJECT_MESH_PRO__
126 #define MESH_USER_DEFINE_MODE MESH_NORMAL_MODE // must normal
127 #elif __PROJECT_SPIRIT_LPN__
128 //#define MESH_USER_DEFINE_MODE MESH_SPIRIT_ENABLE // must spirit
129 #define MESH_USER_DEFINE_MODE MESH_MI_ENABLE
130 #else
131 //#define MESH_USER_DEFINE_MODE MESH_SPIRIT_ENABLE
132 #define MESH_USER_DEFINE_MODE MESH_MI_ENABLE
133 #endif
...

然后
xzw@xzw-RTX2070:~/Telink_SIG_Mesh/example/RGBCW_Ali_Mesh/mesh$ cd ..
xzw@xzw-RTX2070:~/Telink_SIG_Mesh/example/RGBCW_Ali_Mesh$ make all

问题出现
Building file: mesh/ev.c
Building file: mesh/factory_reset.c
Building file: mesh/fast_provision_model.c
Building file: mesh/generic_model.c
Building file: mesh/light.c
mesh/light.c: In function 'set_ct_mode':
mesh/light.c:228:29: error: 'ST_TRANS_HSL_HUE' undeclared (first use in this function)
mesh/light.c:228:29: note: each undeclared identifier is reported only once for each function it appears in
mesh/light.c:229:29: error: 'ST_TRANS_HSL_SAT' undeclared (first use in this function)
mesh/light.c:230:4: error: 'HSL_set' undeclared (first use in this function)
mesh/light.c:230:12: error: expected ';' before 'HSL'
mesh/light.c:231:4: error: 'RGB_set' undeclared (first use in this function)
mesh/light.c:231:12: error: expected ';' before 'RGB'
mesh/light.c:232:4: error: 'HSL' undeclared (first use in this function)
mesh/light.c:235:4: warning: implicit declaration of function 'HslToRgb'
mesh/light.c:235:18: error: 'RGB' undeclared (first use in this function)
make: *** [mesh/mesh.mk:51:out/mesh/light.o] 错误 1
xzw@xzw-RTX2070:~/Telink_SIG_Mesh/example/RGBCW_Ali_Mesh$

使用make flash时报错无法上传

错误信息:
python3 ../../make/Telink_Tools.py -p /dev/ttyUSB0 burn /home/dreamc/Telink_SIG_Mesh/examples/8258_mesh/out/8258_mesh.bin
Pyserial is not installed for /usr/bin/python3. Check the README for installation instructions.
Traceback (most recent call last):
File "../../make/Telink_Tools.py", line 17, in
import serial
ModuleNotFoundError: No module named 'serial'
../../make/makefile:116: recipe for target 'flash' failed
make: *** [flash] Error 1
确定usb是在ttyusb0,python版本3.6.9 Ubuntu18.04
请问这是哪里出了问题?

关于用TB-02模组连接天猫精灵的问题

1、我想自己进行二次开发,连接天猫精灵,自己开发的代码需要准备使用FreeRTOS,我需要使用哪个SDK?用Telink_SIG_Mesh还是Telink_825X_SDK?如果是使用后者,怎么集成接入天猫精灵?在git上的FreeRTOS的初始化配置文件FreeRTOSConfig.h,我是否可以修改其中一些参数来满足我的业务需要,修改时候,需要注意哪些问题,有没有不能修改的参数?
2、关于低功耗问题。当模组进入低功耗的时候,设备自己再次唤醒,比如喂狗或者天猫精灵有消息下发,此时模组需要重新进行软件初始化吗?下图是我在Telink手册中发现的低功耗示意图,如果进入deep sleep retention后,再次唤醒需要重新初始化软件,这个在运行业务流程中不可接受
初始化图
3、模组如果需要被外部唤醒,设置某个IO管脚唤醒后,低功耗状态下最大功耗是多少?

makefile:116: recipe for target 'flash' failed

make flash python ../../make/Telink_Tools.py -p /dev/ttyUSB2 burn /home/q/Telink_SIG_Mesh/examples/8258_mesh/out/8258_mesh.bin make: python: Command not found ../../make/makefile:116: recipe for target 'flash' failed make: *** [flash] Error 127

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.