Error while running the IoT Demo tutorial on Raspberry Pi4

0

I am going through the AWS IoT tutorial for Building Demos, using Raspberry Pi. I was able to successfully carry out steps till https://docs.aws.amazon.com/iot/latest/developerguide/iot-dc-install-configure.html whereas when I run the following commands from the turorial: cd ~/aws-iot-device-client/build ./aws-iot-device-client --config-file ~/dc-configs/dc-testconn-config.json

I get the following error:

2022-05-18T06:21:41.735Z [DEBUG] {Config.cpp}: Did not find a runtime configuration file, assuming Fleet Provisioning has not run for this device 2022-05-18T06:21:41.735Z [DEBUG] {EnvUtils.cpp}: Updated PATH environment variable to: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games:/home/pi/.local/bin:/home/pi/.aws-iot-device-client:/home/pi/.aws-iot-device-client/jobs:/home/pi/aws-iot-device-client/build:/home/pi/aws-iot-device-client/build/jobs 2022-05-18T06:21:41.736Z [INFO] {Main.cpp}: Now running AWS IoT Device Client version v1.6.7-532a710 2022-05-18T06:21:41.749Z [ERROR] {FileUtils.cpp}: Failed to create directory /var/log/aws-iot-device-client/ 2022-05-18T06:21:41.749Z [ERROR] {Main.cpp}: *** AWS IOT DEVICE CLIENT FATAL ERROR: Failed to initialize AWS CRT SDK. AWS IoT Device Client must abort execution, reason: Failed to initialize AWS CRT SDK Please check the AWS IoT Device Client logs for more information

질문됨 2년 전303회 조회
1개 답변
1
수락된 답변

Hi. It's a permission issue. Assuming you are running Device Client as user pi, it doesn't have permissions to create the /var/log/aws-iot-device-client directory. (If you accepted the default configuration, that's where the log file will go.)

I have Device Client running on an RPi4. I can't remember if I took a few steps not documented in that tutorial. However, if you run the following commands, I think you will be able to progress (assuming you are user pi):

sudo mkdir /var/log/aws-iot-device-client
sudo chmod 745 /var/log/aws-iot-device-client
sudo chown pi:pi /var/log/aws-iot-device-client

That will create the directory and make pi the owner. The 745 is as documented here: https://github.com/awslabs/aws-iot-device-client/blob/main/docs/PERMISSIONS.md

Then Device Client will be able to write logs there if you run Device Client as user pi.

profile pictureAWS
전문가
Greg_B
답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인