01
概述
Link SDK
涂鸦Link SDK,即tuya-connect-kit。使用 C 语言实现,适用于开发者自主开发硬件设备逻辑业务接入涂鸦 IoT。Tuya Connect Kit 提供设备激活、DP 上下行和 OTA 等基础业务接口封装,Kit 不依赖具体设备平台及操作系统环境,也可以运行在单任务环境,仅需要支持 TCP/IP 协议栈及提供 SDK 必要的系统依赖接口即可完成接入。
该 Kit 的 C 代码文件通过以下目录结构提供:
- certs:设备私钥,设备证书,服务端 CA 根证书
- docs:参考文档
- libraries:外部依赖库,包含 MQTT client、HTTP client、mbedTLS 等
- interface:平台必要移植接口,SDK 功能接口
- include:SDK 有文件,包含了 SDK API
- src:SDK 源代码
- platform:平台移植接口适配
- utils:通用工具模块
- examples:例程
SDK详细介绍可以参考涂鸦connect-kit官网,这里不作赘述。移植过程中对sdk进行了少量修改,可以使用文件比对工具(例如:beyond compare)比较目录中的文件夹和压缩包中的源码,查看修改了哪里。
02
涂鸦 IoT 平台
1 注册账号
打开涂鸦 IoT 平台官网:https://www.tuya.com/cn/
点击右上角的注册,注册一个账号。注册完毕后,登录。
2 创建产品
1 点击左侧的产品
2 点击创建产品
3 当前组件使用的是 tuya-connect-kit 来连接涂鸦 IoT 平台,涂鸦会根据不同的方案产生不同的激活码,所以这里不能够使用涂鸦已经有的产品进行开发,需要选择其它。(如果希望使用涂鸦的软硬件快速开发,或者0代码开发,直接投产,可以选择下图中已经存在的产品)
4 同样选择自定义品类
5 这里选择产品开发(生态产品接入,会提供mqtt三要素,没有app使用)
6 使用自定义方案
7 完善产品信息,之后点击创建产品
8 选择自己需要的功能,可以选择已经存在的,也可以自定义
9 这里选择公共面板
10 选择Link SDK,选择硬件(这里选择这款硬件,不影响使用自己的硬件)
11 选择指南的任务
12 选择暂不测试
13 免费领取两个激活码,注意选择,授权码清单,之后下载授权码,界面意外关闭,可以按照第三张图找到,之后下载申请的激活码
3 生成二维码
1 二维码规则参考
2 在线免费生成二维码
03
涂鸦组件的使用
1 Gitee链接地址
组件位于amaziot_bloom_os_sdk\platforms\tuya\tuya-connect-kit Gitee源码地址:https://gitee.com/ning./hongdou Github源码地址:https://github.com/ayumid/hongdou 当前组件使用涂鸦提供的Link SDK中的tuya-connect-kit实现(Link SDK中还有tuya-open-sdk-for-device)。因为涂鸦平台对不同开发方式进行了识别,所以必须按照本文所描述步骤进行,否则可能无法连接涂鸦平台。 |
2 服务层组件功能介绍
提供涂鸦Link SDK(tuya-connect-kit)连接实例,实现设备通过app控制等。
该组件为平台组件,可以单独运行,不依赖于其它组件。
3 代码讲解
1 wait_network_ready
等待模组驻网成功,驻网超时后,会软复位模组。
C++ static void wait_network_ready(void) { int count = 0; int ready = 0;
while (!ready) { if (getCeregReady(isMasterSim0() ? IND_REQ_HANDLE : IND_REQ_HANDLE_1)) { ready = 1; } sample_mqtt_tls_tuya_catstudio_printf("wait_network_ready: %d s", count++); if (count > 300) PM812_SW_RESET();
OSATaskSleep(200); } } |
2 tuya_connectkit_task
调用tuya-connect-kit SDK中的demo,这里可以替换为其它demo。
C++ static void tuya_connectkit_task(void *ptr) { int ret = 0; wait_network_ready(); sample_mqtt_tls_tuya_catstudio_printf("\n\n\nSuccess in the net 2\n\n\n"); // cellular_demo(); switch_demo_non_qrcode(); } |
3 tuya_get_csq
获取当前设备的csq值,用于上报信息中的参数。
C++ int tuya_get_csq(void) { char atresbuf[16] = {0}; int err = 0; char *p = NULL; int csqValue = 99;
memset(atresbuf, 0, sizeof(atresbuf)); err = SendATCMDWaitResp(TEL_AT_CMD_ATP_10, "AT+CSQ\r\n", 2, "+CSQ", 1, NULL, atresbuf, sizeof(atresbuf));
if(strlen(atresbuf) >= 10 ) { p = strchr(atresbuf,':'); csqValue = atoi(p + 1); }
return csqValue; } |
4 tuya_get_imei
获取当前设备的imei值,用于上报信息中的参数。
C++ void tuya_get_imei(char *buffer) { char imei[24] = {0}; int err = 0; char *p = NULL; int errorCnt = 0;// wait_reg: memset(imei, 0, sizeof(imei)); err = SendATCMDWaitResp(TEL_AT_CMD_ATP_10, "AT+CGSN\r\n", 2, NULL, 1, NULL, imei, sizeof(imei));
if(strlen(imei) >= 15 ) { snprintf(buffer, 16, imei); return; } } |
5 tuya_get_imei
获取当前设备的iccid值,用于上报信息中的参数。
C++ void tuya_get_iccid(char *buffer) { char iccid[36] = {0}; int err = 0; char *p = NULL; int errorCnt = 0;// wait_reg: memset(iccid, 0, sizeof(iccid)); err = SendATCMDWaitResp(TEL_AT_CMD_ATP_10, "AT+ICCID\r\n", 2, "+ICCID", 1, NULL, iccid, sizeof(iccid));
if(strstr(iccid, "+ICCID") != NULL ) { p = strchr(iccid,':'); snprintf(buffer, 21, p + 2); return; } } |
6 tuya_send_task
主任务,上电后,代码会一直在while中循环上报csq,用户可以根据自己的业务来修改代码,实现自己的业务逻辑
C++ static void tuya_send_task(void *ptr) { int csq = 0; char imei[16] = {0}; char iccid[21] = {0}; char dp_muti_buf[128] = {0}; char dp_buf[16] = {0};
//"{\"103\":\"866663060145165\",\"104\":\"898604A41921C0467222\"}" tuya_get_imei(imei); tuya_get_iccid(iccid); snprintf(dp_muti_buf, 128, "{\"103\":\"%s\",\"104\":\"%s\"}", imei, iccid); tuya_send_multiple_value_data(dp_muti_buf);
while(1) { csq = tuya_get_csq(); snprintf(dp_buf, 16, "{\"102\":%d}", csq); tuya_send_csq_data(dp_buf); printf("send csq:%d", csq); tuya_sleep(3); } } |
4 Demo实战
4.1 创建一个Demo
复制20.4_trans_xtu示例工程,到同一个文件夹下,修改文件名为5.8.3-mqtt_tls_tuya_connect_kit,如图:
4.2 修改makefile
增加mbedTLS,这里不适用tuya-connect-kit中的mbedTLS,使用sdk本身的版本,增加tuya-connect-kit头文件和源文件路径,如图:
4.3 增加头文件
使用代码编辑器,将新建的工程文件加入代码编辑器中,打开main.c,修改main.c,加入am.h等头文件,如图:
main.c
4.4 修改代码
本例对switch_demo_non_qrcode进行了适当的修改,具体查看代码。
4.5 编译
在SDK根目录打开命令行,输入命令.\build.bat -l .\amaziot_bloom_os_sdk\sample\libraries\5.8.3-mqtt_tls_tuya_connect_kit\
C++ PS F:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF λ .\build.bat -l .\amaziot_bloom_os_sdk\sample\libraries\5.8.3-mqtt_tls_tuya_connect_kit\ 子目录或文件 out\bin 已经存在。 子目录或文件 build\mbedTLS 已经存在。 子目录或文件 build\obj 已经存在。 gnumake: Entering directory `F:/3.asr-b/cat.1-asr1606/1.software/BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF/amaziot_bloom_os_sdk/sample/libraries/5.8.3-mqtt_tls_tuya_connect_kit' armcc.exe -c --cpu Cortex-R4 --no_unaligned_access -g -O2 --apcs /inter --diag_suppress 2084,1,2,177,188,223,550,1296,2795,6319,9931,9933 --diag_error=warning --gnu --thumb --loose_implicit_cast -DDATA_COLLECTOR_IMPL -DISPT_OVER_SSP -DDIAG_SSP_DOUBLE_BUFFER_USE_DYNAMIC_ALLOCATION -DENV_XSCALE -DL1_DCXO_ENABLED -DLTE_HIGH_MOBILITY_OPTIMIZATION -DRUN_XIP_MODE -DCRANE_Z2 -DCA_LONG_IPC_MSG -DNEZHA3 -DNEZHA3_1826 -DUPGRADE_PLMS -DUPGRADE_PLMS_SR -DLTE_GSMMULTIBCCH -DGPLC_LTE_RSSI_SCAN -DL1V_NEW_RSSI -DUPGRADE_PLMS_3G -DUPGRADE_PLMS_L1 -DUPGRADE_FG_PLMS -DFG_PLMS_URR -DUPGRADE_L1A_FG_PLMS -DUPGRADE_PLMS_STAGE_2 -DUPGRADE_MBCCH -DMULTI_BCCH_READY_IND -DURR_MRAT_ICS_SEARCH -DUPGRADE_ICS -DMRAT_NAS -DUPGRADE_PLMS_SEARCH_API -DICS_MBCCH -DICS_MBCCH_2G_RSSI -DDIAG_NEWPP -DPHS_SW_DEMO -DPHS_SW_DEMO_TTC -DPHS_SW_DEMO_TTC_PM -DFULL_SYSTEM -D_DDR_INIT_ -D_TAVOR_HARBELL_ -DUPGRADE_ARBEL_PLATFORM -D_TAVOR_B0_SILICON_ -DTDL1C_SPY_ENABLE -DDLM_TAVOR -DTAVOR -DFLAVOR_DUALCORE -DDEBUG_D2_MOR_REG_RESEREVED_ENABLE -D_DIAG_USE_COMMSTACK_ -D_TAVOR_DIAG_ -DPM_DEBUG_MODE_ENABLED -DPM_D2FULL_MODE -DPM_EXT_DBG_INT_ARR -DFEATURE_WB_AMR_PS -DMACRO_FOR_LWG -DHL_LWG -DOPTIMIZE_FOR_2G_BCCH -DPLAT_TEST -D_FDI_USE_OSA_ -DPLAT_USE_THREADX -DLWIP_IPNETBUF_SUPPORT -DCRANE_MCU_DONGLE -DAT_OVER_UART -DPHS_SW_DEMO_TTC_PM -DUPGRADE_LTE_ONLY -DEXT_AT_MODEM_SUPPORT -DLTEONLY_THIN_SINGLE_SIM -DLFS_FILE_SYS -DLFS_FILE_SYS_V2 -DPSM_ENABLE -DNO_PAHO_MQTT -DNO_XML -DNO_LWM2M -DREMOVE_MBEDTLS -DNO_AT_NET -DCRANE_SD_NOT_SUPPORT -DNTP -DYMODEM_EEH_DUMP -DENABLE_DM_LTEONLY -DLTEONLY_THIN -DNO_EXTEND_MY_Q_AT -DNOT_SUPPORT_HTTPS -DNOT_SUPPORT_PM813 -DCRANEL_4MRAM -DREMOVE_PB -DUART_NEW_VERSION -DREMOVE_MEP -DREMOVE_SMS -DREMOVE_ENVSIM -DAPN_INCODE -DLTEONLY_THIN_SINGLE_SIM_2MFLASH -DASR160X_OPENCPU_FEATURE -DENABLE_UART3_FEATRUE -DENABLE_UART4_FEATRUE -DYUGE_MBEDTLS_3_2_1 -DENABLE_MAC_TX_DATA_LOGGING -DDISABLE_NVRAM_ACCESS -DINTEL_UPGRADE_EE_HANDLER_SUPPORT -DLTE_W_PS -DL1_DUAL_MODE -DUPGRADE_HERMON_DUAL -DINTEL_UPGRADE_DUAL_RAT -DINTEL_UPGRADE_GPRS_CIPHER_FLUSH -DUPGRADE_ENHANCED_QUAD_BAND -DINTEL_2CHIP_PLAT -DI_2CHIP_PLAT -DUPGRDE_TAVOR_COMMUNICATION -DRUN_WIRELESS_MODEM -DFLAVOR_DDR12MB_GB1MB5 -DFEATURE_SHMEM -DACIPC_ENABLE_NEW_CALLBACK_MECHANISM -DRELIABLE_DATA -DMAP_NSS -DTV_FNAME="\"SW_PLATFORM=PMD2NONE PHS_SW_DEMO PHS_SW_DEMO_PM SRCNUCLEUS FULL_SYSTEM NOACRTC PDFLT PLAT_TEST PV2 DIAGOSHMEM NVM WITHL1V\"" -DTV_FDESC="\"SW_DESCRIPTION=\"" -DENABLE_ACIPC -D_DATAOMSL_ENABLED_ -DUSB_CABLE_DETECTION_VIA_PMIC -DMIPS_TEST -DMIPS_TEST_RAM -DFLAVOR_DIET_RAM -DNVM_INCLUDE -DMSL_INCLUDE -DMSL_POOL_MEM -DNO_AUDIO -DOSA_QUEUE_NAMES -D_DIAG_DISABLE_USB_ -DOSA_NUCLEUS -DOSA_USED -DPM_D2NONE_MODE -DCRANE_SOC_TEMPERATURE_SENSOR -DL1_SW_UPDATE_FOR_DIGRF -DPHS_L1_SW_UPDATE_R7 -DUPGRADE_LTE -DFRBD_CALIB_NVM -DFRBD_AGC_CALIB -DFRBD_FDT_CALIB -DHSPA_MPR -DCAPT_PARAMS_OPTIMIZE -DL1_WB_R99_ONLY -DL1V_WB_R99_ONLY -DINTERGRATED_RF_SUPPORT -DL1_RX_DIV_SUPPORT -DENABLE_OOS_HANDLING -DTAVOR_D2_WB_L1_SUPPORT -DL1_DDR_HIGH_FREQ -DUPGRADE_DIGRF3G_SUPPORT -DW_PS_PLUS_G_PAGING -D"NO_APLP=0" -DINTEL_UPGRADE_UNIFIED_VOICE_TASK -DINTEL_UPGRADE_R99 -DAPLP_SPY_ENABLE -D__TARGET_FEATURE_DOUBLEWORD -DWHOLE_UMTS_STACK -DUSE_TTPCOM_CSR_BLUETOOTH_AUDIO_GAIN_CONTROL -DL1_UPGRADE_R5 -DUPGRADE_EDGE -DUPGRADE_R4_FS1 -DINTEL_UPGRADE_GSM_CRL_IF -DUPGRADE_EGPRS_M -DINTEL_UPGRADE_EGPRS_M -DINTEL_UPGRADE_RF_PARAMS_IN_CF_TDS -DINTEL_UPGRADE_2SAMPLES_PER_SYMBOL -D"GPRS_MULTISLOT_CLASS=12" -D"EGPRS_MULTISLOT_CLASS=12" -DMARVELL_UPGRADE_BSIC_REDESIGN -DMSL_INCLUDE -DINTEL_HERMON_SAC -DCRANE_CUST_BUILD -DL1_SW_UPDATE_FOR_DIGRF -DFLAVOR_COM -DSILICON_PV2 -DSILICON_SEAGULL -DSILICON_TTC_CORE_SEAGULL -DPCAC_INCLUDE -Otime -DBUILD_DATE="\"03 25 2024\"" -DBUILD_TIME="\"10:56:28\"" -Iatcmds\inc -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\hop\telephony\yuge\inc -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\hal\UART\inc -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\hal\core\inc -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\hal\PMU\inc -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\hal\GPIO\inc -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\os\posix\inc -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\diag\diag_logic\src -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\csw\SysCfg\inc -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\csw\platform\inc -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\env\win32\inc -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\csw\BSP\inc -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\csw\platform\dev_plat\build -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\os\osa\inc -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\os\threadx\inc -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\os\nu_xscale\inc -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\pcac\psm\inc -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\pcac\httpclient\src -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\diag\diag_logic\inc -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\hop\timer\inc -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\hop\intc\inc -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\csw\PM\inc -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\hop\pm\inc -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\softutil\TickManager\inc -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\hop\BSP\inc -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\hop\telephony\atcmdsrv\inc -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\hop\telephony\atparser\inc -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\hop\telephony\sdk\inc -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\pcac\httpclient\inc -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\pcac\ci\inc -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\pcac\lwipv4v6\src\include -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\pcac\lwipv4v6\src\include\arch -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\pcac\lwipv4v6\src\include\ipv4 -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\pcac\lwipv4v6\src\include\ipv6 -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\pcac\lwipv4v6\src\include\lwip -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\pcac\lwipv4v6\src\include\netif -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\hop\mmi_mat\inc -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\tavor\Arbel\inc -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\tavor\env\inc -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\hop\telephony\modem\inc -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\pcac\duster\inc -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\pcac\fota\inc -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\hal\I2C\inc -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\hal\ACIPC\inc -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\softutil\fatsys\flash -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\softutil\FDI\src\INCLUDE -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\hal\MMU\inc -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\softutil\FDI\src\FDI_ADD -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\softutil\FDI\src\FM_INC -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\softutil\fatsys\fs\hdr -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\softutil\littlefs\inc -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\pcac\tts\inc -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\pcac\dial\inc -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\softutil\csw_memory\inc -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\hop\utilities\inc -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\hop\commpm\inc -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\softutil\nvm\inc -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\softutil\EEhandler\inc -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\softutil\EEhandler\src -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\hop\RTC\inc -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\hop\telephony\ci_client\inc -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\hal\BT_device\inc -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\hal\UART\inc -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\hop\mrd\inc -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\hop\dma\inc -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\softutil\softutil\inc -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\hal\SPI\inc -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\pcac\websocket\inc -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\pcac\atnet_srv\inc -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\softutil\fotacomm\inc -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\aud_sw\Audio\inc -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\aud_sw\ACM_COMM\inc -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\aud_sw\audio_stub\src -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\hop\aam\inc -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\aud_sw\AudioHAL\inc -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\hal\dbgshell\inc -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\include\asr160x\pcac\opencpu\inc -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\CSDK_CODE\mbedTLS\mbedTLS_3_2_1\asros -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\CSDK_CODE\mbedTLS\mbedTLS_3_2_1 -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\CSDK_CODE\mbedTLS\mbedTLS_3_2_1\inc -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\CSDK_CODE\mbedTLS\mbedTLS_3_2_1\include -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\CSDK_CODE\mbedTLS\mbedTLS_3_2_1\include\mbedtls -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\CSDK_CODE\mbedTLS\mbedTLS_3_2_1\inc\mbedtls -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\CSDK_CODE\mbedTLS\mbedTLS_3_2_1\tests\include\test -DSDK_ENABLE_MBEDTLS -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\amaziot_bloom_os_sdk\utils -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF/amaziot_bloom_os_sdk/platforms/tuya/tuya-connect-kit\examples\switch_demo_non_qrcode -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF/amaziot_bloom_os_sdk/platforms/tuya/tuya-connect-kit\include -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF/amaziot_bloom_os_sdk/platforms/tuya/tuya-connect-kit\utils -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF/amaziot_bloom_os_sdk/platforms/tuya/tuya-connect-kit\interface -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF/amaziot_bloom_os_sdk/platforms/tuya/tuya-connect-kit\middleware -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF/amaziot_bloom_os_sdk/platforms/tuya/tuya-connect-kit\libraries\coreJSON\source\include -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF/amaziot_bloom_os_sdk/platforms/tuya/tuya-connect-kit\libraries\coreMQTT\source\include -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF/amaziot_bloom_os_sdk/platforms/tuya/tuya-connect-kit\libraries\coreHTTP\source\include -IF:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF/amaziot_bloom_os_sdk/platforms/tuya/tuya-connect-kit\libraries\coreHTTP\source\dependency\3rdparty\http_parser -o build\obj/ext_at_cmds.o F:/3.asr-b/cat.1-asr1606/1.software/BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF/amaziot_bloom_os_sdk/sample/libraries/5.8.3-mqtt_tls_tuya_connect_kit/atcmds/src/ext_at_cmds.c armlink.exe build\obj/core_http_client.o build\obj/http_parser.o build\obj/core_json.o build\obj/core_mqtt.o build\obj/core_mqtt_serializer.o build\obj/core_mqtt_state.o build\obj/cJSON.o build\obj/aes_inf.o build\obj/backoff_algorithm.o build\obj/crc32.o build\obj/uni_md5.o build\obj/MultiTimer.o build\obj/network_wrapper.o build\obj/storage_wrapper.o build\obj/system_wrapper.o build\obj/mqtt_client_wrapper.o build\obj/http_client_wrapper.o build\obj/atop_base.o build\obj/atop_service.o build\obj/file_download.o build\obj/iotdns.o build\obj/matop_service.o build\obj/mqtt_bind.o build\obj/mqtt_service.o build\obj/tuya_endpoint.o build\obj/tuya_iot.o build\obj/tuya_ota.o build\obj/switch_demo_non_qrcode.o build\obj/main.o build\obj/ext_at_cmds.o build\obj/ext_at_controller.o build\CSDK_CODE.lib \ -o F:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\out\bin\Arbel_PMD2NONE_40M.axf \ --via F:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\prebuilt_1606l\Arbel_PMD2NONE_targ_objliblist.txt \ --elf \ --scatter F:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\prebuilt_1606l\Crane_DS_4M_Ram_2M_Flash_XIP_CIPSRAM_Common_SingleSIM.sct \ --predefine="-DLTEONLY_THIN_SINGLE_SIM" --predefine="-DASR160X_OPENCPU_FEATURE" \ --map --symbols --info sizes,totals \ --list F:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\out\bin\Arbel_PMD2NONE_40M.map \ --keep init.o(Header) --keep init.o(Vectors) --diag_suppress 6312,6314,6319,6329 \ --feedback F:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\out\feedbackLinkOptLteonlyThin_SingleSim_NoSMS.txt F:\3.asr-b\cat.1-asr1606\1.software\BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF\tools\buildimage_1606l.bat SDK_PROD_TYPE : [DM] SDK_CUST_SKU : [THIN_SINGLE_SIM_NO_SMS] SDK_PS_MODE : [LTEONLY] SDK_CHIP_VER : [Z2A0] SDK_OS_TYPE : [TX] Platform Convertion Tools v4.01 with PS option extension Convertion done! |INPUT |out\bin\cp_1606L.bin |MARK |NAME |EXEADDR .LOADADDR.LENGTH .CPZLADDR|COMPRESS STASTIC | |--------|--------|--------.--------.--------.--------|------------------------------| |This Is LteOnly 4M| |RW_CPZ_1|DDR_RW_ |7e119000.800a1244.0000cff8.800a2000|0000cff8->00003000 |This Is LteOnly 4M| |RW_CPZ_2|PS_NCAH |7e388000.800ae23c.00001300.800a5000|00001300->00001000 |This Is LteOnly 4M| |RW_CPZ_3|ITCM |7e3dac00.800af53c.0000f51c.800a6000|0000f51c->0000a000 |This Is LteOnly 4M| |RW_CPZ_4|CODE_PS |7e1aa000.800bea58.00030d68.800b0000|00030d68->0001e000 |This Is LteOnly 4M| |RW_CPZ_5|CODEPSB |7e1dc000.800ef7c0.000339bc.800ce000|000339bc->0001b000 |This Is LteOnly 4M| |RW_CPZ_6|CODEPSC |7e213000.8012317c.000323ec.800e9000|000323ec->0001b000 |This Is LteOnly 4M| |RW_CPZ_7|CODEPSD |7e249000.80155568.00028d88.80104000|00028d88->0001a000 |This Is LteOnly 4M| |RW_CPZ_8|CODEPSE |7e277000.8017e2f0.0002e310.8011e000|0002e310->0001a000 |This Is LteOnly 4M| |RW_CPZ_9|CODEPSF |7e2a9000.801ac600.0001c948.80138000|0001c948->00011000 |This Is LteOnly 4M| |RW_CPZ_A|CODE_PL |7e2ca000.801c8f48.0002fd70.80149000|0002fd70->0001e000 |This Is LteOnly 4M| |RW_CPZ_B|CODEPLB |7e2fa000.801f8cb8.0003905c.80167000|0003905c->00021000 |This Is LteOnly 4M| |RW_CPZ_C|CODEPLC |7e337000.80231d14.000268d4.80188000|000268d4->00011000 |--------|--------|--------.--------.--------.--------|------------------------------| | | 0x002415e8 -> 0x00182000| | | 2.255(MB) -> 1.508(MB)| |------------------------------------------------------------------------------------| cp_1606L.axf cp_1606L.bin cp_1606L.map gnumake: Leaving directory `F:/3.asr-b/cat.1-asr1606/1.software/BLOOM_OS_1606_OPENCPU_1191_A09_WIHT_NEWRF/amaziot_bloom_os_sdk/sample/libraries/5.8.3-mqtt_tls_tuya_connect_kit' "copy NEZHAC_CP_CNR_MIFI_TX.bin to ./ "
已复制 1 个文件。 |
4.6 生成固件
参考入门中开发工具,生成工具。
4.7 扫描二维码,添加设备
app添加设备后,设备上电,demo运行后,会上报一次iccid、imei,之后循环上报设备csq值
5 总结
根据实验现象,按照本文所述流程,可以实现红豆平台连接涂鸦 IoT 平台。
注:本文部分内容来源于网络,如有侵权,请及时联系我们。
本文章源自奇迹物联开源的物联网应用知识库Cellular IoT Wiki,更多技术干货欢迎关注收藏Wiki:Cellular IoT Wiki 知识库(https://rckrv97mzx.feishu.cn/wiki/wikcnBvAC9WOkEYG5CLqGwm6PHf)
文章评论(0条评论)
登录后参与讨论