CBU模组如何获取当地天气

Wi-Fi 设备、Wi-Fi 低功耗设备、Wi-Fi BLE 双模设备、Ethernet设备、Ethernet+Wi-Fi设备等
Post Reply
18688714932
Posts: 6

我看到SDK3.9.0里面有个VOID example_iot_http(INT_T argc, CHAR_T *argv[])函数通过#define WEATHER_API "tuya.device.public.weathers.get"
#define API_VERSION "1.0"获取天气,实际测试发现报错:

[04-30 13:12:59 ty E][lr:0xc3219] Open session failed: https://a3.tuyacn.com/d.json?a=tuya.dev ... 3aa1d83704 (-1)
[04-30 13:12:59 ty E][lr:0xaed17] Post Data Return Fail.-2050
[04-30 13:12:59 ty E][my_rtc.c:51] ret:-2050
请问如何才能CBU模组直接获取到当地天气?

yingtao_33
Posts: 229

Re: CBU模组如何获取当地天气

向云端访问天气时,要先保证设备已经配上网且成功连接涂鸦云。可先查看示例中的readme

18688714932
Posts: 6

Re: CBU模组如何获取当地天气

已经配网成功的而且连上网络,app已经可以正常操作设备了,但是还是报错这个异常。获取当地天气是新增的功能,其他已经开发完成的正常运行。还有可能什么问题?

yingtao_33
Posts: 229

Re: CBU模组如何获取当地天气

你在IDE上 更新一下example,天气的atop 接口有改变的。

yingtao_33
Posts: 229

Re: CBU模组如何获取当地天气

企业微信截图_17144600262772.png

下载 2.0.5版本的example.

#define WEATHER_API "thing.weather.get"
#define API_VERSION "1.0"

Post Reply