본문으로 바로가기

[NCS] [matter] SmartThings 앱에서 light-bulb 제어하기

category 미분류 항목 2023. 10. 20. 11:25

: nRF7002 DK 보드에 matter light bulb 이미지와 SmartThings 앱을 연동해 봤습니다.

 

▶ 기본 준비사항

 → Nordic nRF7002-DK 보드

 → 삼성 SmartThings Station

 

 → Visual Studio Code 에서  matter light_bulb 프로젝트 이미지 빌드 && 플래시

 

 → 스마트폰에 SmartThings 앱 설치

 

 → QR 코드 ( DK 보드 시리얼 부팅로그 다음처럼 나옴.)

     >> https://project-chip.github.io/connectedhomeip/qrcode.html?data=MT%3A6FCJ142C00KA0648G00

 

 

  SmartThings 앱을 통한  matter 장치 연결 과정

   → SmartThings Station 이 연결된 상태에서 아래 그림의 우측상단의 "기기 추가 아이콘"를 눌러줍니다.

 

   → 기기추가 화면에서 "QR 코드 스캔" 선택

 

 

→   아래 사이트의 QR 코드를 스캔 해줍니다.

    https://project-chip.github.io/connectedhomeip/qrcode.html?data=MT%3A6FCJ142C00KA0648G00

 

→   자동 진행 화면

→   Matter 인증기기가  아니라는 창이 나오면  계속 눌러줍니다.

 

→   WIFI 네트워크 확인

 

→  삼성계정에 MATTER 장치 등록을 하네요.

 

→  기기이름 설정후 완료 버튼 클릭

 

 

▶ Matter  Light-bulb 장치의 LED2  ON/OFF  하기

  →  SmartThings 앱에서 Matter   Light-bulb 장치 선택

   : SmartThings Station 장비가 없으면 동작 안함.

 

 →  전원 버튼 클릭시 ON/OFF 토글 됩니다.

   >> nRF7002 보드에서 Button2 를 누를경우 앱상에도 현재 상태 반영됩니다.

 

 

 

→  light bulb LED2 On/OFF 시 시리얼 로그

>> LED2 OFF
I: 138576 [EM]>>> [E:50890r S:47612 M:155836868] (S) Msg RX from 1:5D63ACC59E0B41DD [406B] --- Type 0001:08 (IM:InvokeCommandRequest)
I: 138589 [ZCL]Toggle ep1 on/off from state 1 to 0
I: 138593 [ZCL]Setting on/off to OFF due to level change
I: 138598 [ZCL]Toggle ep1 on/off from state 1 to 0
I: 138603 [ZCL]Cluster OnOff: attribute OnOff set to 0
I: Turn Off Action has been initiated
I: Turn Off Action has been completed
I: 138615 [ZCL]Off completed. reset OnTime to  0
I: 138622 [EM]<<< [E:50890r S:47612 M:232732421 (Ack:155836868)] (S) Msg TX to 1:5D63ACC59E0B41DD [406B] --- Type 0001:09 (IM:InvokeCommandResponse)
I: 138635 [IN](S) Sending msg 232732421 on secure session with LSID: 47612
I: 138644 [EM]<<< [E:22608i S:47612 M:232732422] (S) Msg TX to 1:5D63ACC59E0B41DD [406B] --- Type 0001:05 (IM:ReportData)
I: 138655 [IN](S) Sending msg 232732422 on secure session with LSID: 47612
I: 138663 [DMG]Refresh Subscribe Sync Timer with min 1 seconds and max 30 seconds
I: 138673 [EM]>>> [E:50890r S:47612 M:155836869 (Ack:232732421)] (S) Msg RX from 1:5D63ACC59E0B41DD [406B] --- Type 0000:10 (SecureChannel:StandaloneAck)
I: 138689 [EM]>>> [E:22608i S:47612 M:155836870 (Ack:232732422)] (S) Msg RX from 1:5D63ACC59E0B41DD [406B] --- Type 0001:01 (IM:StatusResponse)
I: 138702 [IM]Received status response, status is 0x00
I: 138708 [EM]<<< [E:22608i S:47612 M:232732423 (Ack:155836870)] (S) Msg TX to 1:5D63ACC59E0B41DD [406B] --- Type 0000:10 (SecureChannel:StandaloneAck)
I: 138722 [IN](S) Sending msg 232732423 on secure session with LSID: 47612


>> LED2 ON
uart:~$ I: 160480 [EM]>>> [E:50891r S:47612 M:155836871] (S) Msg RX from 1:5D63ACC59E0B41DD [406B] --- Type 0001:08 (IM:InvokeCommandRequest)
I: 160492 [ZCL]Toggle ep1 on/off from state 0 to 1
I: 160497 [ZCL]On Command - OffWaitTime :  0
I: 160503 [ZCL]On/Toggle Command - Stop Timer
I: 160508 [ZCL]Cluster OnOff: attribute OnOff set to 1
I: Turn On Action has been initiated
I: Turn On Action has been completed
I: 160519 [ZCL]Cluster LevelControl: attribute CurrentLevel set to 1
I: 160526 [EM]<<< [E:50891r S:47612 M:232732424 (Ack:155836871)] (S) Msg TX to 1:5D63ACC59E0B41DD [406B] --- Type 0001:09 (IM:InvokeCommandResponse)
I: 160540 [IN](S) Sending msg 232732424 on secure session with LSID: 47612
I: 160550 [EM]<<< [E:22609i S:47612 M:232732425] (S) Msg TX to 1:5D63ACC59E0B41DD [406B] --- Type 0001:05 (IM:ReportData)
I: 160561 [IN](S) Sending msg 232732425 on secure session with LSID: 47612
I: 160569 [DMG]Refresh Subscribe Sync Timer with min 1 seconds and max 30 seconds
I: 160579 [EM]>>> [E:50891r S:47612 M:155836872 (Ack:232732424)] (S) Msg RX from 1:5D63ACC59E0B41DD [406B] --- Type 0000:10 (SecureChannel:StandaloneAck)
I: 160607 [EM]>>> [E:22609i S:47612 M:155836873 (Ack:232732425)] (S) Msg RX from 1:5D63ACC59E0B41DD [406B] --- Type 0001:01 (IM:StatusResponse)
I: 160619 [IM]Received status response, status is 0x00
I: 160625 [EM]<<< [E:22609i S:47612 M:232732426 (Ack:155836873)] (S) Msg TX to 1:5D63ACC59E0B41DD [406B] --- Type 0000:10 (SecureChannel:StandaloneAck)
I: 160647 [IN](S) Sending msg 232732426 on secure session with LSID: 47612
I: 190578 [DMG]Refresh subscribe timer sync after 29 seconds
I: 190585 [EM]<<< [E:22610i S:47612 M:232732427] (S) Msg TX to 1:5D63ACC59E0B41DD [406B] --- Type 0001:05 (IM:ReportData)
I: 190595 [IN](S) Sending msg 232732427 on secure session with LSID: 47612
I: 190603 [DMG]Refresh Subscribe Sync Timer with min 1 seconds and max 30 seconds
I: 190664 [EM]>>> [E:22610i S:47612 M:155836874 (Ack:232732427)] (S) Msg RX from 1:5D63ACC59E0B41DD [406B] --- Type 0001:01 (IM:StatusResponse)
I: 190676 [IM]Received status response, status is 0x00
I: 190682 [EM]<<< [E:22610i S:47612 M:232732428 (Ack:155836874)] (S) Msg TX to 1:5D63ACC59E0B41DD [406B] --- Type 0000:10 (SecureChannel:StandaloneAck)
I: 190695 [IN](S) Sending msg 232732428 on secure session with LSID: 47612

 

 

 

 

< 기타 >

light-bulb  부팅로그

uart:~$ *** Booting Zephyr OS build v3.3.99-ncs1-1 ***
I: Init CHIP stack
I: 168 [DL]BLE address: F2:A0:A0:5A:56:48
D: 201 [DL]WiFiManager has been initialized
I: 206 [SVR]Subscription persistence not supported
I: 210 [SVR]Server initializing...
I: 214 [TS]Last Known Good Time: [unknown]
I: 218 [TS]Setting Last Known Good Time to firmware build time 2023-10-19T20:46:33
I: 227 [DMG]AccessControl: initializing
I: 231 [DMG]Examples::AccessControlDelegate::Init
I: 235 [DMG]AccessControl: setting
I: 238 [DMG]DefaultAclStorage: initializing
I: 242 [DMG]DefaultAclStorage: 0 entries loaded
D: 246 [IN]UDP::Init bind&listen port=5540
E: 250 [IN]SO_REUSEPORT failed: 109
D: 253 [IN]UDP::Init bound to port=5540
D: 257 [IN]BLEBase::Init - setting/overriding transport
D: 262 [IN]TransportMgr initialized
I: 270 [ZCL]Using ZAP configuration...
I: 277 [DMG]AccessControlCluster: initializing
D: 282 [DL]Boot reason: 1
I: 284 [ZCL]Initiating Admin Commissioning cluster.
I: 289 [ZCL]Endpoint 1 On/off already set to new value
I: 295 [ZCL]Cluster LevelControl: attribute CurrentLevel set to 1
D: 303 [IN]SecureSession[0x200041d0]: Allocated Type:1 LSID:63608
D: 309 [DL]CHIPoBLE advertising set to on
I: 312 [DIS]Updating services using commissioning mode 1
I: 318 [DIS]CHIP minimal mDNS started advertising.
D: 322 [DL]Using wifi MAC for hostname
I: 327 [DIS]Advertise commission parameter vendorID=65521 productID=32773 discriminator=3840/15 cm=1
D: 336 [DIS]Responding with _matterc._udp.local
D: 340 [DIS]Responding with A4B6032B541000E7._matterc._udp.local
D: 346 [DIS]Responding with F4CE360024C2.local
D: 350 [DIS]Responding with F4CE360024C2.local
D: 354 [DIS]Responding with _V65521._sub._matterc._udp.local
D: 359 [DIS]Responding with _S15._sub._matterc._udp.local
D: 364 [DIS]Responding with _L3840._sub._matterc._udp.local
D: 370 [DIS]Responding with _CM._sub._matterc._udp.local
D: 375 [DIS]Responding with A4B6032B541000E7._matterc._udp.local
I: 381 [DIS]CHIP minimal mDNS configured as 'Commissionable node device'; instance name: A4B6032B541000E7.
I: 390 [DIS]mDNS service published: _matterc._udp
I: 395 [DIS]Updating services using commissioning mode 1
I: 400 [DIS]CHIP minimal mDNS started advertising.
D: 404 [DL]Using wifi MAC for hostname
I: 409 [DIS]Advertise commission parameter vendorID=65521 productID=32773 discriminator=3840/15 cm=1
D: 418 [DIS]Responding with _matterc._udp.local
D: 422 [DIS]Responding with A4B6032B541000E7._matterc._udp.local
D: 428 [DIS]Responding with F4CE360024C2.local
D: 432 [DIS]Responding with F4CE360024C2.local
D: 436 [DIS]Responding with _V65521._sub._matterc._udp.local
D: 441 [DIS]Responding with _S15._sub._matterc._udp.local
D: 447 [DIS]Responding with _L3840._sub._matterc._udp.local
D: 452 [DIS]Responding with _CM._sub._matterc._udp.local
D: 457 [DIS]Responding with A4B6032B541000E7._matterc._udp.local
I: 463 [DIS]CHIP minimal mDNS configured as 'Commissionable node device'; instance name: A4B6032B541000E7.
I: 472 [DIS]mDNS service published: _matterc._udp
I: 477 [IN]CASE Server enabling CASE session setups
D: 482 [IN]SecureSession[0x20004288]: Allocated Type:2 LSID:63609
I: 487 [SVR]Joining Multicast groups
I: 491 [SVR]Server Listening...
I: 494 [DL]Device Configuration:
I: 497 [DL]  Serial Number: 11223344556677889900
I: 501 [DL]  Vendor Id: 65521 (0xFFF1)
I: 505 [DL]  Product Id: 32773 (0x8005)
I: 508 [DL]  Product Name: not-specified
I: 513 [DL]  Hardware Version: 0
I: 516 [DL]  Setup Pin Code (0 for UNKNOWN/ERROR): 20202021
I: 522 [DL]  Setup Discriminator (0xFFFF for UNKNOWN/ERROR): 3840 (0xF00)
I: 529 [DL]  Manufacturing Date: (not set)
I: 533 [DL]  Device Type: 65535 (0xFFFF)
I: 538 [SVR]SetupQRCode: [MT:6FCJ142C00KA0648G00]
I: 542 [SVR]Copy/paste the below URL in a browser to see the QR Code:
I: 548 [SVR]https://project-chip.github.io/connectedhomeip/qrcode.html?data=MT%3A6FCJ142C00KA0648G00
I: 557 [SVR]Manual pairing code: [34970112332]
I: 565 [DL]CHIP task running
I: 579 [DL]CHIPoBLE advertising started
I: 584 [ZCL]Cluster OnOff: attribute OnOff set to 0
I: 588 [ZCL]Cluster LevelControl: attribute CurrentLevel set to 254
I: 596 [DL]NFC Tag emulation started
I: 30583 [DL]CHIPoBLE advertising mode changed to slow
I: 30592 [DL]CHIPoBLE advertising started

uart:~$
uart:~$

 

 light-bulb  와 SmartThings 앱 연결 구성시 로그 메시지

light-bulb_connect.lgo.txt
0.09MB

 

그럼 수고하세요.

반응형