Page 1 of 4

调用tuya_iot_soc_init_param接口,,返回OPRT_OK,却没有收到回调信息

Posted: 2025年 Apr 25日 11:02
by zszn_ll

我这边先调用tuya_iot_init_params接口初始化tuya,之后调用tuya_iot_set_gw_prod_info写入uuid和authkey,再之后调用tuya_iot_soc_init_param注册active_shorturl和gw_status_cb的回调接口。每一步接口调用返回的值都是OPRT_OK,但是却没有收到回调。

开发环境:Android NDK

NDK版本:28.0.12674087 rc2

类型开发包:联网单品开发:Ethernet设备开发包
描述:TuyaOS 基础能力建设
TuyaOS 版本:TuyaOS-3.8.23

组件开发包:tuyaos-iot_3.8.22_arm-linux-androideabi-49_linux_wired_com_0.0.7

处理器 厂商 分类 芯片

SoC Android Ethernet Android-Arm-32-bit

demo代码:

tuya_device.cpp
(4.21 KiB) Downloaded 3 times

Re: 调用tuya_iot_soc_init_param接口,,返回OPRT_OK,却没有收到回调信息

Posted: 2025年 Apr 25日 11:12
by 卢台长

你好,请提供下日志
没收收到回调,可能的原因如下:

  1. 没有正确返回网络连接成功状态
  2. 授权信息不支持扫码配网

Re: 调用tuya_iot_soc_init_param接口,,返回OPRT_OK,却没有收到回调信息

Posted: 2025年 Apr 25日 11:15
by zszn_ll

10:59:27.229 tuya_iot_init com.example.ndk_test V tuya_iot_init_params result:0
10:59:27.230 tuya_iot_init com.example.ndk_test V tuya_iot_set_gw_prod_info uuid:uuid6befb0bff9f2c7a6 authKey:cldbYxYAVsHbzjVtzqe0ktSPIfn2eCE1 rt:0
10:59:27.239 tuya_iot_init com.example.ndk_test V tuya_iot_soc_init_param pid:c0sz1jjjcdqekbwl rt:0


Re: 调用tuya_iot_soc_init_param接口,,返回OPRT_OK,却没有收到回调信息

Posted: 2025年 Apr 25日 11:22
by 卢台长

tkl_output.c
适配下日志打印接口
VOID_T tkl_log_output(CONST CHAR_T *format, ...)


Re: 调用tuya_iot_soc_init_param接口,,返回OPRT_OK,却没有收到回调信息

Posted: 2025年 Apr 25日 13:42
by zszn_ll

tuyalog:

tuya_log.txt
(27.87 KiB) Downloaded 2 times

Re: 调用tuya_iot_soc_init_param接口,,返回OPRT_OK,却没有收到回调信息

Posted: 2025年 Apr 25日 13:52
by 卢台长

你好,从日志看是未适配网络接口,我们默认的模板是适配linux,用安卓重新适配下
tkl_wired.c适配下
tkl_wired_get_status接口。用于获取网络状态
包括其他接口


Re: 调用tuya_iot_soc_init_param接口,,返回OPRT_OK,却没有收到回调信息

Posted: 2025年 Apr 25日 16:23
by zszn_ll

我这边适配了一下,但是还是存在一些问题,还遗漏了哪些没有适配呢?
log:

tuya_log.txt
(41.98 KiB) Downloaded 5 times

Re: 调用tuya_iot_soc_init_param接口,,返回OPRT_OK,却没有收到回调信息

Posted: 2025年 Apr 25日 16:36
by 卢台长

你好,看网络状态是通的,但是dns获取不到IP地址,


Re: 调用tuya_iot_soc_init_param接口,,返回OPRT_OK,却没有收到回调信息

Posted: 2025年 Apr 25日 18:01
by zszn_ll

目前获取到了IP地址,但是还是连接不上。log:

tuya_log.txt
(60.15 KiB) Downloaded 1 time

Re: 调用tuya_iot_soc_init_param接口,,返回OPRT_OK,却没有收到回调信息

Posted: 2025年 Apr 25日 18:28
by 卢台长

感觉是系统dns返回有问题,你去ping下这个域名