|
| 1 | +NFC-based commissioning |
| 2 | +----------------------- |
| 3 | + |
| 4 | +.. toggle:: |
| 5 | + |
| 6 | + You can commission a Matter accessory over NFC using the Matter NFC Transport Layer (NTL). |
| 7 | + The device emulates a Type 4 Tag and exposes both the Matter application and a standard NDEF Tag Application with the onboarding payload. |
| 8 | + |
| 9 | + NFC tags can support either ``powered mode``, in which the device is fully powered on by its own power supply during NFC operation, or ``unpowered mode``, where the tag operates exclusively using energy harvested from the NFC polling device (such as a phone). |
| 10 | + The NFC-based commissioning feature in Nordic Matter SDK supports only ``powered mode``. |
| 11 | + The Nordic SoC must be on and running (not only powered by NFC field) for NFC-based commissioning to work. |
| 12 | + Please ensure your application's power arrangements match this requirement, as many NFC use cases commonly advertise unpowered operation, but this implementation does not. |
| 13 | + |
| 14 | + This feature requires a board with the on-chip NFCT peripheral and an NFC antenna connected. |
| 15 | + It is supported on Nordic DK targets that provide NFCT, such as the nRF52840 DK, nRF5340 DK, nRF54L15 DK, and nRF54LM20 DK. |
| 16 | + |
| 17 | + .. note:: |
| 18 | + You cannot use NFC-based commissioning if the :kconfig:option:`CONFIG_CHIP_NFC_ONBOARDING_PAYLOAD` Kconfig option is enabled. |
| 19 | + |
| 20 | + To enable NFC-based commissioning, set the following Kconfig option to ``y``: |
| 21 | + |
| 22 | + * :kconfig:option:`CONFIG_CHIP_NFC_BASED_COMMISSIONING` |
| 23 | + |
| 24 | + You can also use the following related option: |
| 25 | + |
| 26 | + * :kconfig:option:`CONFIG_CHIP_NFC_BASED_COMMISSIONING_APDU_DEBUG` - Enables additional debug logging of ISO-DEP APDU traffic. |
| 27 | + |
| 28 | + Commissioning flow: |
| 29 | + |
| 30 | + * As soon as the Matter server finishes initializing, the NFC tag serves an NDEF onboarding payload that advertises the NFC rendezvous flag. |
| 31 | + Tap the tag with a commissioner that supports Matter NTL to start commissioning; no button press is required. |
| 32 | + The setup code is also printed to the UART log with the NFC rendezvous flag. |
| 33 | + * Once commissioning completes successfully, NFC tag emulation is automatically stopped. |
| 34 | + |
| 35 | + .. note:: |
| 36 | + While NFC-based commissioning is active, commissioning over Bluetooth LE might take longer than usual. |
| 37 | + The device first attempts to use NFC and only falls back to Bluetooth LE afterwards, which delays the Bluetooth LE pairing. |
| 38 | + A log message is printed when Bluetooth LE commissioning is attempted while NFC commissioning is still active. |
| 39 | + |
| 40 | + Build a |matter_type| with NFC-based commissioning support as follows: |
| 41 | + |
| 42 | + .. tabs:: |
| 43 | + |
| 44 | + .. group-tab:: |nRFVSC| |
| 45 | + |
| 46 | + Add ``-DCONFIG_CHIP_NFC_BASED_COMMISSIONING=y`` to :guilabel:`Extra CMake arguments` in your build configuration. |
| 47 | + |
| 48 | + .. group-tab:: Command line |
| 49 | + |
| 50 | + .. code-block:: console |
| 51 | + |
| 52 | + west build -p -b <board_target> -- -DCONFIG_CHIP_NFC_BASED_COMMISSIONING=y |
| 53 | + |
| 54 | + Replace ``<board_target>`` with a supported board target, for example ``nrf52840dk/nrf52840``. |
0 commit comments