Page 1 of 2

esp-ali-smartliving SDK功能OTA升级失败

Posted: Wed Feb 15, 2023 3:47 pm
by maxchentt
芯片:esp-8266EX
ESP8266_RTOS_SDK:v3.3
github:https://github.com/espressif/esp-ali-smartliving.git
示例:ESP8266_RTOS_SDK\esp-ali-smartliving\examples\solutions\smart_light

直接使用官方的示例smart_light生成并烧录,设备配网成功后,使用阿里生活物联网平台OTA升级失败,提示:Not digestSign key in json doc of OTA,如下图
0101.png
0101.png (53.52 KiB) Viewed 28066 times
0102.jpg
0102.jpg (130.45 KiB) Viewed 28067 times
请问如何解决呢?

Re: esp-ali-smartliving SDK功能OTA升级失败

Posted: Thu Feb 16, 2023 3:35 am
by ESP_YJM
从日志看错误原因并不是 `Not digestSign key in json doc of OTA`, 而是 CA 证书校验失败。你看下你函数 iotx_ca_get 返回的是 NULL 还是证书?

Re: esp-ali-smartliving SDK功能OTA升级失败

Posted: Thu Feb 16, 2023 3:49 am
by maxchentt
具体怎样查询呢?有iotx_ca_get()调用方法吗?(函数在ali-smartliving-device-sdk-c 阿里的sdk中预编译的)
另外,设备联网已经联网成功了,联网过程也没有报错呀
(PS:乐鑫的另一个SDK:esp-aliyun 其中示例:smart_light,测试OTA升级功能是正常的)

Re: esp-ali-smartliving SDK功能OTA升级失败

Posted: Thu Feb 16, 2023 8:28 am
by ESP_YJM
你可以加点日志重新编译下 ali-smartliving-device-sdk-c SDK。调用方法可以直接搜这个函数,貌似就一个地方用。联网和 OTA 不是一个链接,OTA 有 OTA 自己的服务器,如果阿里 OTA 服务器换了证书,可能就需要更换 CA 证书。

Re: esp-ali-smartliving SDK功能OTA升级失败

Posted: Thu Feb 16, 2023 4:55 pm
by maxchentt
路径:esp-ali-smartliving\ali-smartliving-device-sdk-c\src\services\ota\impl\ota_fetch.c
加了日志打印,能正常获取CA证书,见下图:
0103.png
0103.png (34.02 KiB) Viewed 27907 times
查esp-ali-smartliving\ali-smartliving-device-sdk-c\src\infra\system\ca.c
证书 char *iotx_ca_crt 与阿里的 living_sdk_v1.6.6最新分支内容一致,应该不是证书问题,
请问接下来怎样处理呢?

Re: esp-ali-smartliving SDK功能OTA升级失败

Posted: Fri Feb 17, 2023 2:20 am
by ESP_YJM
我这边试了,OTA 没有问题,原来的证书也可以用。现在按如下方向排查:
1. 提供下你的 sdkconfig 和 ali-smartliving-device-sdk-c 下 make.settings 文件。
2. 提供下你阿里云物联网平台 OTA 升级配置相关截图。

Re: esp-ali-smartliving SDK功能OTA升级失败

Posted: Fri Feb 17, 2023 3:08 am
by maxchentt
以下图一为固件升级状态,阿里云后台截图(阿里生活物联网平台--天猫精灵直连)
fail to download.png
fail to download.png (27.37 KiB) Viewed 27862 times
图二为上传升级固件操作界面
0104.png
0104.png (46.59 KiB) Viewed 27862 times
附件中含smart_light 示例下 sdkconfig 文件 和 ali-smartliving-device-sdk-c 下 make.settings 文件

Re: esp-ali-smartliving SDK功能OTA升级失败

Posted: Fri Feb 17, 2023 5:19 am
by ESP_YJM
怀疑是内存不够了,你看下先优化点内存呢。

Re: esp-ali-smartliving SDK功能OTA升级失败

Posted: Fri Feb 17, 2023 10:35 am
by maxchentt
官方示例测试时联网报错,调整make menuconfig里component config->ESP8266-specific->ppT task stack size调大到3072。
没有改其他设置了,你这边用官方示例能正常ota空中升级吗?
另怎样优化内存使用呢,有具体建议嘛?

Re: esp-ali-smartliving SDK功能OTA升级失败

Posted: Mon Feb 20, 2023 2:22 am
by ESP_YJM
我这边有时也会出现你这个错误,所以我怀疑是内存不够导致。你可以参考 https://blog.csdn.net/ustccw/article/details/84136257 这个来优化 task 创建时的内存,看哪个 task 剩的多,你就进行裁剪。另外,OTA 也支持 http 的方式,如果你可以接受这种方式的话,也可以采取这种方案。启用方式在 ali-smartliving-device-sdk-c 下执行 make menuconfig->启用 FEATURE_SUPPORT_HTTP_OTA.