스크립트를 사용하여 Hub SDK 배포 - 에 대한 관리형 통합 AWS IoT Device Management

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

스크립트를 사용하여 Hub SDK 배포

설치 스크립트를 사용하여 관리형 통합 Hub SDK 구성 요소를 수동으로 배포한 다음 배포를 검증합니다. 이 섹션에서는 스크립트 실행 단계 및 확인 프로세스에 대해 설명합니다.

환경 준비

SDK 설치 스크립트를 실행하기 전에 다음 단계를 완료합니다.

  1. 폴더 middleware 내에 라는 artifacts 폴더를 생성합니다.

  2. 허브 미들웨어 파일을 middleware 폴더에 복사합니다.

  3. SDK를 시작하기 전에 초기화 명령을 실행합니다.

    중요

    각 허브 재부팅 후 초기화 명령을 반복합니다.

    #Get the current user _user=$(whoami) #Get the current group _grp=$(id -gn) #Display the user and group echo "Current User: $_user" echo "Current Group: $_grp" sudo mkdir -p /dev/aipc/ sudo chown -R $_user:$_grp /dev/aipc sudo mkdir -p /data/ace/kvstorage sudo chown -R $_user:$_grp /data/ace/kvstorage

Hub SDK 스크립트 실행

아티팩트 디렉터리로 이동하여 start_iotmi_sdk.sh 스크립트를 실행합니다. 이 스크립트는 허브 SDK 구성 요소를 올바른 순서로 시작합니다. 다음 예제 로그를 검토하여 성공적인 시작을 확인합니다.

참고

실행 중인 모든 구성 요소에 대한 로그는 artifacts/logs 폴더 내에서 찾을 수 있습니다.

hub@hub-293ea release_Oct_17$ ./start_iotmi_sdk.sh -------Stopping SDK running processes--- DeviceAgent: no process found ------Starting SDK------- -------Creating logs directory---------- Logs directory created. -------Verifying Middleware paths------- All middleware libraries exist -------Verifying Middleware pre reqs--- AIPC and KVstroage directories exist -------Starting HubOnboarding----------- -------Starting MQTT Proxy----------- -------Starting Event Manager----------- -------Starting Zigbee Service---------- -------Starting Zwave Service---------- /data/release_Oct_17/middleware/AceZwave/bin /data/release_Oct_17 /data/release_Oct_17 -------Starting CDMB-------------------- -------Starting Agent-------------------- -------Starting Provisioner-------------- -------Checking SDK status--------------- hub 6199 1.7 0.7 1004952 15568 pts/2 Sl+ 21:41 0:00 ./iotmi_mqtt_proxy -C /data/aws/iotmi/config/iotmi_config.json Process 'iotmi_mqtt_proxy' is running. hub 6225 0.0 0.1 301576 2056 pts/2 Sl+ 21:41 0:00 ./middleware/AceCommon/bin/ace_eventmgr Process 'ace_eventmgr' is running. hub 6234 104 0.2 238560 5036 pts/2 Sl+ 21:41 0:38 ./middleware/AceZigbee/bin/ace_zigbee_service Process 'ace_zigbee_service' is running. hub 6242 0.4 0.7 1569372 14236 pts/2 Sl+ 21:41 0:00 ./zwave_svc Process 'zwave_svc' is running. hub 6275 0.0 0.2 1212744 5380 pts/2 Sl+ 21:41 0:00 ./DeviceCdmb Process 'DeviceCdmb' is running. hub 6308 0.6 0.9 1076108 18204 pts/2 Sl+ 21:41 0:00 ./IoTManagedIntegrationsDeviceAgent Process 'DeviceAgent' is running. hub 6343 0.7 0.7 1388132 13812 pts/2 Sl+ 21:42 0:00 ./iotmi_lpw_provisioner Process 'iotmi_lpw_provisioner' is running. ------Successfully Started SDK----

허브 프로비저닝 확인

iot_provisioning_state 필드가 로 /data/aws/iotmi/config/iotmi_config.json 설정되어 있는지 확인합니다PROVISIONED.

에이전트 작업 확인

로그 파일에 에이전트 시작 메시지와 성공적인 초기화가 있는지 확인합니다.

tail -f -n 100 logs/agent_logs.txt

예시

[2024-09-06 02:31:54.413758906][Device_Agent][info] Successfully subscribed to topic: south/bF|gi_044F8821D0193608C8D5BF80858E20A56E3A8490/control [2024-09-06 02:31:54.513956059][Device_Agent][info] Successfully subscribed to topic: south/bF|gi_044F8821D0193608C8D5BF80858E20A56E3A8490/setup
참고

artifacts 디렉터리에 iotmi.db 데이터베이스가 있는지 확인합니다.

LPW-Provisioner 작업 확인

로그 파일에 LPW-Provisioner 시작 메시지와 성공적인 초기화가 있는지 확인합니다.

tail -f -n 100 logs/provisioner_logs.txt

다음 코드에 예가 나와 있습니다.

[2024-09-06 02:33:22.068898877][LPWProvisionerCore][info] Successfully subscribed to topic: south/bF|gi_044F8821D0193608C8D5BF80858E20A56E3A8490/setup