Aws Iot 设备客户端设置不起作用。

0

【以下的问题经过翻译处理】 你好,我一直在尝试按照这里的教程设置rpi,但是当我运行命令./aws-iot-device-client --config-file ~/dc-configs/dc-testconn-config.json时,终端上会显示错误,提示找不到aws crt sdk,并出现类似以下的致命错误:

2022-04-11T07:38:13.850Z [WARN]  {Config.cpp}: Key {template-name} was provided in the JSON configuration file with an empty value
2022-04-11T07:38:13.850Z [WARN]  {Config.cpp}: Key {csr-file} was provided in the JSON configuration file with an empty value
2022-04-11T07:38:13.850Z [WARN]  {Config.cpp}: Key {device-key} was provided in the JSON configuration file with an empty value
2022-04-11T07:38:13.850Z [WARN]  {Config.cpp}: Key {file} was provided in the JSON configuration file with an empty value
2022-04-11T07:38:13.850Z [WARN]  {Config.cpp}: Key {publish-file} was provided in the JSON configuration file with an empty value
2022-04-11T07:38:13.851Z [WARN]  {Config.cpp}: Key {subscribe-file} was provided in the JSON configuration file with an empty value
2022-04-11T07:38:13.851Z [WARN]  {Config.cpp}: Shadow Name {shadow-name} was provided in the JSON configuration file with an empty value
2022-04-11T07:38:13.851Z [WARN]  {Config.cpp}: Input file {shadow-input-file} was provided in the JSON configuration file with an empty value
2022-04-11T07:38:13.851Z [WARN]  {Config.cpp}: Output file {shadow-output-file} was provided in the JSON configuration file with an empty value
2022-04-11T07:38:13.851Z [INFO]  {Config.cpp}: Successfully fetched JSON config file
1 Antwort
0

【以下的回答经过翻译处理】 你好,Subham。我按照教程操作成功了。你遇到的错误在这里发生:https://github.com/awslabs/aws-iot-device-client/blob/main/source/SharedCrtResourceManager.cpp#L135

    if (!FileUtils::FileExists(logFilePath))
    {
        // Create an empty file with the expected permissions.
        if (!FileUtils::CreateEmptyFileWithPermissions(logFilePath, S_IRUSR | S_IWUSR))
        {
            return false;
        }
    }

FileExists()返回false,但文件似乎确实存在。我认为FileExists()方法可能会遇到failbitbadbiteofbit

我认为你应该重新启动RPi,让它运行fsck。如果问题仍然存在,请删除日志并尝试再次运行:rm /var/log/aws-iot-device-client/sdk.log

您还可以在配置中将enable-sdk-logging设置为false,以彻底绕过此文件检查和创建。

profile picture
EXPERTE
beantwortet vor 5 Monaten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen