AliOS-Things icon indicating copy to clipboard operation
AliOS-Things copied to clipboard

linkkitapp示例中的设备激活凭证如何从外部输入

Open nostalgia-w opened this issue 8 years ago • 4 comments

linkkitapp的示例中,需要根据云端产生的设备凭证,修改头文件framework/protocol/linkkit/iotkit/sdk-encap/imports/iot_import_product.h下的设备凭证信息。 #define PRODUCT_KEY "a1BDCKKSpdu" #define PRODUCT_SECRET "Rp0aCxyRnd2ecrCX" #define DEVICE_NAME "MVwo1x7hB2pyEbXlLkzE" #define DEVICE_SECRET "OKHWuIaMzwtJAjUzPRLG1rcYxFo43akU" 但是假如设备量产,那肯定不可能每个设备都修改程序内的这个头文件,然后编译烧录。 而且固件升级的时候,假如这个设备凭证是写死在程序中的,那批量固件升级的时候就全变成一个设备了。 想问一下,有没有办法可以像wifi账号密码一样,不写死的程序内,而是通过别的方式,比如用串口通过kv set将这个激活凭证写在设备内?

nostalgia-w avatar Jul 04 '18 06:07 nostalgia-w

framework/protocol/linkkit/iotkit/hal-impl/rhino/HAL_PRODUCT_rhino.c,使用HAL_GetDeviceSecret函数就可以解决上面的问题,前提板子支持KV。 方法:可以先试试HAL_SetDeviceSecret函数,然后看板子里的kv list,就知道HAL_GetDeviceSecret函数怎么用了。

nostalgia-w avatar Jul 09 '18 08:07 nostalgia-w

请问 esp8266板子支持KV吗

xuhongv avatar Sep 12 '18 13:09 xuhongv

支持

发自我的 iPhone

在 2018年9月12日,21:35,徐宏 <[email protected]mailto:[email protected]> 写道:

请问 esp8266板子支持KV吗

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHubhttps://github.com/alibaba/AliOS-Things/issues/399#issuecomment-420649831, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AkTY8aLE2BkRroW5dCwlzijEKkbiuNMnks5uaQ2TgaJpZM4VCAoc.

nostalgia-w avatar Sep 13 '18 07:09 nostalgia-w

请问 esp8266板子支持KV吗

我用的是esp-wroom-02,内核是esp8266,是有KV的,就是你存的地址要自己改一下。他AliOS Things里的esp8266是按照一块开发板的地址来设置的,如果你发现存不了,或者提示错误,就看看改改存的地址。 可以先从github上的文档了解一下https://github.com/alibaba/AliOS-Things/wiki/Flash-and-KV-Storage-Porting-Guide.zh 在cli下面1. 先kv list看下输出 有木有输出 2. kv set test abc看看能否设下去 3. kv get test看看读出来的值是不是设下去的值

nostalgia-w avatar Sep 13 '18 07:09 nostalgia-w