STM32WBA Zigbee Direct Setup using Ubisys or Direct Easy phone application


1. Overview

Zigbee Direct has three distinct device roles: ZVD, ZDD, and Zigbee Device.

  • The ZVD is basically a BLE device that can address both BLE devices and Zigbee Direct Devices
  • The Zigbee Device runs the Zigbee stack, and the 802.15.4 stack.
  • The ZDD is a ZD device that can communicate both with other ZD and with a ZVD (interoperability of BLE and Zigbee). A ZDD runs the Zigbee Direct stack and the 802.15.4 MAC stack.

Direct communication between a ZVD and Zigbee Device is not possible. The ZDD must be present to route messages from the ZVD to the Zigbee Device.

The Ubisys Smart Home Application for iPhone or the Ledvance Direct Easy Application functions as a Zigbee virtual device (ZVD) and may be used to control Zigbee radio devices from a mobile device. In configurations that include both Zigbee direct devices (ZDD) and standard Zigbee devices, the ZDD acts as a bridge to relay commands from your phone to Zigbee devices without Bluetooth capabilities.

The Ubisys Smart Home Application does not currently support android smartphones. This page and the Ubisys Smart Home Application must be used on an iPhone. The Ledvance Direct Easy Application is both available on Android and on iPhone IOs but this application is not available worldwide to be downloaded on the Apple store or Google play stores (Ledvance Direct Easy is available in Europe). This concurrent demo BLE and Zigbee is better suited for an STM32WBA65-NUCLEO since it required a large footprint.

This demo shows an STM32WBA65-NUCLEO Zigbee direct device (ZDD - ZigbeeDirect_OnOff Application) using the Ubisys ZVD iOS phone application or the Direct Easy ZVD application to control a Zigbee device (ZD - ZigbeeDirect_OnOff_Server_Router_Identify Application) via Bluetooth. The ZVD joins the ZDD Zigbee network and controls the Zigbee device by sending On and Off commands or Level control commands.

Summary of Demo 1: With Ubisys ZVD, setup of the minimal topology: ZVD and ZDD.

Summary of Demo 2: With Ubisys ZVD, setup of three devices topology: ZDD and ZVD and then adding the ZD.

Summary of Demo 3: With Ledvance Direct Easy (Android or IOs) ZVD, setup of the minimal topology: ZVD and ZDD.

The demo 1 or 3 was used to demonstrate Zigbee interoperability with Philips hue 1100 bulb or IKEA tradfri bulb using v1.7 STM32WBA release. The demonstration of interoperability need a special configuration where the ZDD is switched from router to coordinator.

In current Cube release STM32WBA version v1.8.0, the ZR Zigbee Router application provided is the ZD:

  • ZigbeeDirect_OnOff_Server_Router_Identify Application.

ZigbeeDirect_OnOff Zigbee application is the ZDD and the ZVD is the coordinator with v1.8 STM32WBA cube release.

2. Setup

In this section, we will:

  • Download and install the Ubisys Smart Home application on an iPhone or the Ledvance Direct Easy Application.
  • Build and flash the zdd ZigbeeDirect_OnOff Zigbee application to the NUCLEO-WBAxx.
  • Retrieve the line (on teraterm or termite) public Bluetooth address of the NUCLEO-WBAxx for use with a BLE sniffing solution.

2.1. Phone application installation for Ubisys or Ledvance

To install the smartphone application to be used as the ZVD:

  1. Either open the App Store app on your iPhone and search "Ubisys Smart Home" in the App Store.
  2. Or search "Direct Easy" in your favorite application search on an android Phone or on an IOs iPhone (Beware that the application has regional restrictions).
  3. Install the app.
  4. Enable Bluetooth on your iPhone communication settings.

2.2. STM32WBAxx ZDD configuration

NUCLEO-WBA65RI has the zdd applications in its directory BLE_Zigbee of the STM32CubeWBA release v1.8.0.

To configure the STM32WBA65 as a ZDD:

  1. Build the ZDD BLE_Zigbee/ZigbeeDirect_OnOff Zigbee application in either IAR, Keil or STM32CubeIDE.
  2. Download the output binary to the NUCLEO-WBA65RI using an IDE or STM32CubeProgrammer.

2.3. Retrieve public Bluetooth® address

To retrieve the public Bluetooth address of the NUCLEO-WBA65RI:

  1. Connect the NUCLEO-WBA65RI to a computer via USB-serial.
  2. Open a serial terminal (like teraterm).
  3. Power on the NUCLEO-WBA65RI.
  4. Record the public Bluetooth address shown in the debug output.
  5. Use this address to configure your Bluetooth sniffing solution.

When you connect the NUCLEO-WBA65RI to a computer via USB-serial, you will have access to a limited command line. Type help to get a listing of the commands available and their descriptions.

3. Demo 1 Procedure using Ubisys Smart Home ZVD

In this section, we will:

  • Start the ZDD BLE_Zigbee/ZigbeeDirect_OnOff application on the NUCLEO-WBA65RI.
  • Connect the iPhone to the STM32WBA65 ZDD.
  • Configuring and add a component to the ubisys Smart Home application.
  • Control the ZDD using the iPhone.

3.1. Start the ZDD application

To start the ZDD application on the NUCLEO-WBA65RI:

  1. Power on the NUCLEO-WBA65RI.
  2. The ZDD application starts and begins sending Bluetooth® Low Energy (BLE) advertisement messages.
Info white.png Information
The ZDD stops advertising after approximately 3 minutes.

3.2. Connect the iPhone to the STM32WBAxx ZDD

To connect the Ubisys Smart Home app to the ZDD:

  1. Open the Ubisys Smart Home app on your iPhone.
  2. A screen displaying "Connect Gateway…" appears.
    • Press the "x" in the top left corner to skip this step.
  3. A screen displaying "Facilities" appears.
    • If the Facilities screen does not automatically appear, access the screen from the main menu of the app by selecting the menu path: Settings > Facilities.
  4. Press the edit symbol in the top right.
  5. Select "New Facility."
  6. Select "Create via Bluetooth..."
  7. Use the three dots to select the advertising ZDD.
    • If the ZDD appears in the Facilities screen with the message "Does not permit joining," enter the "pjoin" command on the ZDD to re-enable joining or press push button SW1 on the ZDD to re-enable joining.
Connectivity ZigbeeDirectConnectionwithiphone.png
  1. In the notification, confirm that the ZDD has the expected Bluetooth® address by pressing OK.
Connectivity Ubisys Notificationv1.8 forZDD WBA.png
  1. This will start the connection process. During this process, the ZVD also commissions the ZDD to form a Zigbee network. Wait for the connection process to finish.
Connectivity ZigbeeDirect waitconnection.png
  1. When the Discover Devices notification appears, select "Yes, just the device."
Connectivity ZigbeeDirect step10.png

The app begins searching for components. The process completes within a few seconds. At this point, an entry for your ZDD appears in the Facility menu along with an entry in the components menu under the menu path:

Configuration > Basic Configuration > Components

Info white.png Information
It may take a minute after a new connection before the device appears in the components menu.

3.3. Managing components

The Ubisys app uses components to link UI controls to device functions. Functionalities of Zigbee devices are addressed via endpoints. Endpoints are displayed in the app with a preceding hashtag (#). The provided application will have an OnOff cluster on endpoint 1. In this section, we will:

  1. View the components on your device
  2. Edit the component name
  3. Create a room
  4. Add the component to the room

To manage components in the Ubisys app:

  1. Access the components menu by navigating to the menu path:

    Configuration > Basic Configuration > Components.

  2. If you do not see your device as a component, refresh the components menu by swiping down.
    • There may be a delay of a minute or so between the time a new device joins the network and when it appears in the components menu.
  3. Select the device with the correct Bluetooth® address from the components menu.
Connectivity ZDD SelectComponent ZDv1.8.png
  1. Select the edit symbol and change the name of the device to "light nucleo".
Connectivity ZDD NameComponent lightnucleo ZDv1.8.png
  1. Navigate to the menu path:
  2. Configuration > Basic Configuration > Rooms

  3. Select the edit symbol.
  4. Select the plus symbol located next to "New Room".
  5. Name the room and select the check mark.
  6. Connectivity Ubisys RoomName forZDD WBA.png
  7. Select the newly created room.
  8. Navigate to the menu path:
  9. Edit > Add device

  10. Select the light switch component (OnOff server) on the expected endpoint.
  11. Select the check mark.
  12. Select the check mark again to finish adding devices to the room.

3.4. Sending On and Off Commands

To send On and Off commands to the Zigbee device:

  1. Navigate to the menu path:

    Building Control > <Name of room>

  2. A circle button will appear to toggle the light switch on and off.
Connectivity ZDD Component lightOnorOff v1.8.png

With this process complete, the circle button now signifies when the cluster is turned on by changing color to green.

Info white.png Information
There may be a delay of a few seconds between the time the cluster is turned activated and when the circle button changes state.

3.5. Disconnecting the ZVD from the ZDD

To disconnect the ZVD from the ZDD:

  1. Navigate to the menu path:

    Settings > Facilities > Edit

  2. Select the red minus symbol next to the device
  3. Confirm by selecting "delete"
Connectivity Ubisys InitRemovePreviousFacilities forZDD WBA.png

4. Demo 2 Procedure using Ubisys Smart Home ZVD

In this section, we will:

  • Check the ZDD ZigbeeDirect_OnOff application to highlight that it is a Zigbee ZDD.
  • Start the ZDD ZigbeeDirect_OnOff application on the NUCLEO-WBA65RI.
  • Connect the iPhone to the STM32WBAxx ZDD.
  • Add a ZD Zigbee Device ZigbeeDirect_OnOff_Server_Router_Identify to the ZDD’s Zigbee network.
  • Add optionally two components to the ubisys Smart Home application.
  • Control the Zigbee devices using the iPhone.

4.1. Check the ZDD application

The ZDD ZigbeeDirect_OnOff application allow you to form a network. Here are the few lines in app_zigbee_endpoint.c that configure the startup of the ZDD:

void APP_ZIGBEE_ApplicationInit(void) {
   LOG_INFO_APP( "ZIGBEE Application Init" );
   /* Initialization of the Zigbee stack */
   APP_ZIGBEE_Init();
 
    /* Configure Application Form/Join parameters : Startup, Persistence and Start */
   stZigbeeAppInfo.eStartupControl = ZbStartTypeJoin;
   stZigbeeAppInfo.bPersistNotification = false;
    /* USER CODE BEGIN APP_ZIGBEE_ApplicationInit */
   stZigbeeAppInfo.bNwkStartup = false;
   

4.2. Start the ZDD and ZD application

To start the ZDD application on the NUCLEO-WBA65RI:

  1. Power on the NUCLEO-WBA65RI with ZigbeeDirect_OnOff application.
  2. The ZDD application starts and begins sending Bluetooth® Low Energy (BLE) advertisement messages.

4.3. Connect the iPhone to the STM32WBA65 ZDD

To connect the Ubisys Smart Home app to the ZDD:

  1. Open the Ubisys Smart Home app on your iPhone.
  2. A screen displaying "Connect Gateway…" appears.
    • Press the "x" in the top left corner to skip this step.
  3. A screen displaying "Facilities" appears.
    • If the Facilities screen does not automatically appear, access the screen from the main menu of the app by selecting the menu path: Settings > Facilities.
  4. Press the edit symbol in the top right.
  5. Select "New Facility."
  6. Select "Create via Bluetooth."
  7. Use the three dots to select the advertising ZDD.
    • If the ZDD appears in the Facilities screen with the message "Does not permit joining," enter the "pjoin" command on the ZDD teraterm to re-enable joining.
Connectivity ZigbeeDirectConnectionwithiphone.png
  1. In the opened notification, confirm that the ZDD has the expected Bluetooth® address and press OK.
Connectivity Ubysis Notificationv1.8 forZDD WBA.png
  1. This will start the connection process. During this process, the ZVD commissions the ZDD to form a Zigbee network. Wait for the ZDD connection process to finish by having on the ZVD the question "Discover Devices?". Do not answer the question yet!
Connectivity ZigbeeDirect waitconnection.png

4.4. Connect the STM32WBAxx Zigbee Device to the STM32WBAxx ZDD

  1. Power on the second NUCLEO-WBA65RI with ZigbeeDirect_OnOff_Server_Router_Identify application.
  2. After 15 seconds, if the ZigbeeDirect_OnOff_Server_Router_Identify board does not have its blue LED ON, indicating that the ZDD and the ZD have formed a network, then type the "pjoin" command on the ZDD teraterm to re-enable joining. After 15 seconds, the ZigbeeDirect_OnOff_Server_Router_Identify board should have its blue LED ON
  3. When the ZigbeeDirect_OnOff_Server_Router_Identify board will have its blue LED ON, then select "Yes, the entire network." to the bellow question "Discover Devices?".
Connectivity ZigbeeDirect step10.png

The app begins connecting with all ZD components that are connected to the ZDD. The process completes within two minutes with a message "Accept Changes" that is displayed on the ZVD for a short time. At this point, an entry for your ZDD appears in the Facility menu along with two STM entries in the components menu under the menu path.

Configuration > Basic Configuration > Components

Info white.png Information
It may take a minute after a new connection before the device appears in the components menu.

At the end of the configuration, verify that 2 STM components are available in the component menu. If it is not the case, then re-do all the steps from the start with a teraterm open on the ZDD to follow the steps dynamically.

Connectivity UbisysD2 Select2component forZD WBA.png

This ZDD teraterm indicates that the ZDD is connected to the ZD and that the ZDD is connected to the ZVD.

Connectivity UbisysD2 AddingSecondZDWBA6component toZDD.png

To connect a ZD device to the ZVD, an expert Ubisys option is indicated here:

  1. Access the Basic Configuration menu by navigating to the menu path:

    Configuration > Basic Configuration

  2. Select "Open for new devices".
Connectivity ZigbeeDirect openfornewdevice.png
  1. Navigate to the menu path:

    Configuration > Basic Configuration > Components

  2. Swipe down to refresh the page.
  3. *There may be a delay of a minute or so between the time Swipe down and when it appears in the components menu.
  4. Select the device with the correct Bluetooth® address from the components menu. This step is not needed when using STM32WBA65 applications.

4.5. Managing components

The Ubisys app uses components to link UI controls to device functions. Functionalities of Zigbee devices are addressed via endpoints. In the provided application, the OnOff cluster is on endpoint 1. In this section, we will:

  1. Create a room
  2. Add the components to the room
  3. Edit the components name

To manage components in the Ubisys app:


  1. Navigate to the menu path:
  2. Configuration > Basic Configuration > Rooms

  3. Select the edit symbol.
  4. Select the plus symbol located next to "New Room".
  5. Name the room and select the check mark.
  6. Connectivity UbisysD2 NamingLivintRoom forZDD WBA.png
  7. Select the newly created room.
  8. Navigate to the menu path or select the pencil to add device on a dark window:
  9. Edit > Add device

  10. Select the two STM32WBA65 components on the expected endpoint.
  11. Select the check mark.
  12. Select the check mark again to finish adding devices to the room.
  13. Select the edit symbol and change the name of the device to "onoff" and "lightsensitivitycontrol".
  14. Connectivity UbisysD2 Adding2WBA6component forZD WBA.png

4.6. Sending On and Off Commands

To send On and Off commands to the Zigbee device:

  1. Navigate to the menu path:

    Building Control > Name of room>

  2. Circle buttons will appear to toggle the lights switch on and off.
Connectivity UbisysD2 2LightsOff forZD WBA.png
Connectivity UbisysD2 2LightsOn forZD WBA.png

With this process complete, the circle buttons now signifies when the cluster is turned on by changing color to green.

Info white.png Information
There may be a delay of a few seconds between the time the cluster is turned activated and when the circle button changes state.

4.7. Sending On and Off commands or level control commands to bulbs

In this topology:

Connectivity Ubisys control bulb.png

Once the setup is complete, the display will be the following:

Connectivity Ubisys Smart Home Application Zigbee Direct Setup 1746024973550.png

4.8. Disconnecting the ZVD from the ZDD

To disconnect the ZVD from the ZDD and the Zigbee device:

  1. Navigate to the menu path:

    Settings > Facilities > Edit

  2. Select the red minus symbol next to the device
  3. Confirm by selecting "delete"

5. Demo 3 Procedure using Ledvance Direct Easy

In this section, we will:

  • Start the ZDD BLE_Zigbee/ZigbeeDirect_OnOff application on the NUCLEO-WBA65RI.
  • Connect the smartphone to the STM32WBA65 ZDD.
  • Configuring and add a component to the Ledvance Direct Easy application.
  • Control the ZDD using the smartphone ZVD.

5.1. Start the ZDD application

To start the ZDD application on the NUCLEO-WBA65RI:

  1. Power on the NUCLEO-WBA65RI.
  2. The ZDD application starts and begins sending Bluetooth® Low Energy (BLE) advertisement messages.
Info white.png Information
The ZDD stops advertising after approximately 3 minutes.

5.2. Connect and use the smartphone with the STM32WBAxx ZDD

To connect the Easy Direct app to the ZDD:

  1. Open the Easy Direct app on your smartphone.
  2. A screen displaying "accept conditions" appears and you have to accept geolocalisation and conditions.
  3. A screen displaying "Create Zone" appears and follow the flowcharts till the end.
    • If the ZDD appears in the Facilities screen with the message "Does not permit joining," enter the "pjoin" command on the ZDD to re-enable joining or press push button SW1 on the ZDD to re-enable joining.
Connectivity DirectEasy Ledvance CreateZoneTillSearch.png

Start the search.

Connectivity DirectEasy Ledvance SearchZDDinZone.png

This will end the connection process. During this process, the ZVD also commissions the ZDD to form a Zigbee network.

Connectivity DirectEasy Ledvance EndSearch.png

The app begins searching for components. The process completes within a few seconds. At this point, an entry for your ZDD appears in the selected Zone and is ready to use.

To send On and Off commands to the Zigbee device:

Press the on/off symbol on the right side of the ZDD. It will toggle the light switch on and off.

Connectivity DirectEasy Ledvance UsingLight.png