samples/boards/nrf/mesh/onoff_level_lighting_vnd_app/README.html · samples/boards/nrf/mesh/onoff_level_lighting_vnd_app/README.rst 공식 원문 ↗

Zephyr 3.7.0 · Boards · Nordic Mesh Models

Bluetooth Mesh OnOff·Level·Lighting·Vendor

두 element에 OnOff, Level, Lightness, CTL과 Vendor model을 결합합니다.

Official pathsamples/boards/nrf/mesh/onoff_level_lighting_vnd_app/README.html
Source filesamples/boards/nrf/mesh/onoff_level_lighting_vnd_app/README.rst
Source versionZephyr 3.7.0
TranslationFull · reviewed

본문 기준: Zephyr 3.7.0 LTS3 · 이후 유지보수 패치는 별도입니다.

Part 1

요약·해설

Root·secondary model 구성, hardware association과 meshctl group 설정을 설명합니다.

Root

16 models

Secondary

3 models

Elements

2 per node

Part 2

접을 수 있는 영어 원문 전체

영어 원문 전체 펼치기
원문 SHA-256 DA056E3D4A7D97FEA60216496097766CECEEBC5A6D013B3E0F49F65798A7D2F5
.. _bluetooth-mesh-onoff-level-lighting-vnd-sample:

Bluetooth: Mesh Generic OnOff, Generic Level, Lighting & Vendor Models
######################################################################
Overview
********
This is a application demonstrating a Bluetooth Mesh node in
which Root element has following models

- Generic OnOff Server
- Generic OnOff Client
- Generic Level Server
- Generic Level Client
- Generic Default Transition Time Server
- Generic Default Transition Time Client
- Generic Power OnOff Server
- Generic Power OnOff Setup Server
- Generic Power OnOff Client
- Light Lightness Server
- Light Lightness Setup Server
- Light Lightness Client
- Light CTL Server
- Light CTL Setup Server
- Light CTL Client
- Vendor Model

And Secondary element has following models

- Generic Level Server
- Generic Level Client
- Light CTL Temperature Server

Prior to provisioning, an unprovisioned beacon is broadcast that contains
a unique UUID. It is obtained from the device address set by Nordic in the
Factory information configuration register (FICR).

Associations of Models with hardware
************************************
For the nRF52840-PDK board, these are the model associations:

* LED1 is associated with generic OnOff Server's state which is part of Root element
* LED2 is associated with Vendor Model which is part of Root element
* LED3 is associated with generic Level (ROOT) / Light Lightness Actual value
* LED4 is associated with generic Level (Secondary) / Light CTL Temperature value
* Button1 and Button2 are associated with gen. OnOff Client or Vendor Model which is part of Root element
* Button3 and Button4 are associated with gen. Level Client / Light Lightness Client / Light CTL Client which is part of Root element

States of Servers are bounded as per Bluetooth SIG Mesh Model Specification v1.0

After provisioning, the button clients must
be configured to publish and the LED servers to subscribe.
If a server is provided with a publish address, it will
also publish its relevant status.

Requirements
************
This sample has been tested on the Nordic nRF52840-PDK board, but would
likely also run on the nrf52dk/nrf52832 board.

Building and Running
********************
This sample can be found under :zephyr_file:`samples/boards/nrf/mesh/onoff_level_lighting_vnd_app` in the
Zephyr tree.

The following commands build the application.

.. zephyr-app-commands::
   :zephyr-app: samples/boards/nrf/mesh/onoff_level_lighting_vnd_app
   :board: nrf52840dk/nrf52840
   :goals: build flash
   :compact:

Provisioning is done using the BlueZ meshctl utility. In this example, we'll use meshctl commands to bind:

- Button1, Button2, and LED1 to application key 1. It then configures Button1 and Button2
  to publish to group 0xC000 and LED1 to subscribe to that group.
- Button3, Button4, and LED3 to application key 1. It then configures Button3 and Button4
  to publish to group 0xC000 and LED3 to subscribe to that group.

.. code-block:: console

   discover-unprovisioned on
   provision <discovered UUID>
   menu config
   target 0100
   appkey-add 1
   bind 0 1 1000
   bind 0 1 1001
   bind 0 1 1002
   bind 0 1 1003
   sub-add 0100 c000 1000
   sub-add 0100 c000 1002
   pub-set 0100 c000 1 0 5 1001
   pub-set 0100 c000 1 0 5 1003

The meshctl utility maintains a persistent JSON database containing
the mesh configuration. As additional nodes (boards) are provisioned, it
assigns sequential unicast addresses based on the number of elements
supported by the node. This example supports 2 elements per node.

The meshctl target for configuration must be the root element's unicast
address as it is the only one that has a configuration server model. If
meshctl is gracefully exited, it can be restarted and reconnected to
network 0x0.

The meshctl utility also supports a onoff model client that can be used to
change the state of any LED that is bound to application key 0x1.
This is done by setting the target to the unicast address of the element
that has that LED's model and issuing the onoff command.
Group addresses are not supported.

This application was derived from the sample mesh skeleton at
:zephyr_file:`samples/bluetooth/mesh`.

See :ref:`bluetooth samples section <bluetooth-samples>` for details.

Part 3

한국어 전문 번역

개요

Generic OnOff, Generic Level, Lighting, Vendor model을 함께 제공하는 Bluetooth Mesh node application입니다. Root element에는 다음 model이 있습니다.

  • Generic OnOff Server
  • Generic OnOff Client
  • Generic Level Server
  • Generic Level Client
  • Generic Default Transition Time Server
  • Generic Default Transition Time Client
  • Generic Power OnOff Server
  • Generic Power OnOff Setup Server
  • Generic Power OnOff Client
  • Light Lightness Server
  • Light Lightness Setup Server
  • Light Lightness Client
  • Light CTL Server
  • Light CTL Setup Server
  • Light CTL Client
  • Vendor Model

Secondary element에는 다음 model이 있습니다.

  • Generic Level Server
  • Generic Level Client
  • Light CTL Temperature Server

Provisioning 전에는 고유 UUID가 들어 있는 unprovisioned beacon을 broadcast합니다. UUID는 Nordic가 Factory Information Configuration Register(FICR)에 설정한 device address에서 얻습니다.

Model과 hardware의 연결

nRF52840-PDK board에서 model과 hardware의 관계는 다음과 같습니다.

  • LED1은 root element에 속한 Generic OnOff Server의 state와 연결됩니다.
  • LED2는 root element에 속한 Vendor Model과 연결됩니다.
  • LED3는 Generic Level(root)의 state 또는 Light Lightness Actual value와 연결됩니다.
  • LED4는 Generic Level(secondary)의 state 또는 Light CTL Temperature value와 연결됩니다.
  • Button1과 Button2는 root element에 속한 Generic OnOff Client 또는 Vendor Model과 연결됩니다.
  • Button3과 Button4는 root element에 속한 Generic Level Client, Light Lightness Client 또는 Light CTL Client와 연결됩니다.

Server state의 범위는 Bluetooth SIG Mesh Model Specification v1.0에 따라 제한됩니다.

Provisioning 뒤에는 button client가 publish하고 LED server가 subscribe하도록 구성해야 합니다. Server에 publish address를 제공하면 관련 status도 publish합니다.

요구 사항

이 sample은 Nordic nRF52840-PDK board에서 시험되었으며, nrf52dk/nrf52832 board에서도 실행될 가능성이 높습니다.

Build와 실행

Sample은 Zephyr tree의 samples/boards/nrf/mesh/onoff_level_lighting_vnd_app에 있습니다. 다음 명령으로 application을 build하고 flash합니다.

west build -b nrf52840dk/nrf52840 samples/boards/nrf/mesh/onoff_level_lighting_vnd_app
west flash

Provisioning은 BlueZ meshctl utility로 수행합니다. 이 예에서는 다음 관계를 bind하고 publish·subscribe를 설정합니다.

  • Button1, Button2, LED1을 application key 1에 bind합니다. Button1과 Button2는 group 0xC000으로 publish하고 LED1은 그 group을 subscribe합니다.
  • Button3, Button4, LED3을 application key 1에 bind합니다. Button3과 Button4는 group 0xC000으로 publish하고 LED3은 그 group을 subscribe합니다.
discover-unprovisioned on
provision <discovered UUID>
menu config
target 0100
appkey-add 1
bind 0 1 1000
bind 0 1 1001
bind 0 1 1002
bind 0 1 1003
sub-add 0100 c000 1000
sub-add 0100 c000 1002
pub-set 0100 c000 1 0 5 1001
pub-set 0100 c000 1 0 5 1003

meshctl은 Mesh configuration을 담은 persistent JSON database를 유지합니다. Node(board)를 추가로 provision하면 node가 지원하는 element 수를 기준으로 연속된 unicast address를 할당합니다. 이 예는 node당 element 2개를 지원합니다.

Configuration server model은 root element에만 있으므로 configuration을 위한 meshctl target은 root element의 unicast address여야 합니다. meshctl을 정상적으로 종료했다면 다시 시작해 network 0x0에 reconnect할 수 있습니다.

meshctl의 OnOff model client를 사용하면 application key 0x1에 bind된 LED의 state를 바꿀 수 있습니다. 해당 LED model이 있는 element의 unicast address를 target으로 설정하고 OnOff command를 실행합니다. Group address는 지원하지 않습니다.

이 application은 samples/bluetooth/mesh의 Mesh skeleton sample에서 파생되었습니다. 자세한 내용은 Bluetooth sample section을 참조하십시오.

Source

출처

영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.