Giter VIP home page Giter VIP logo

microchiptech / pic32cxbz2_wbz45x_zigbee_ble_bridge Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 110.56 MB

"IoT Made Easy!"- This application demonstrates multiprotocol capabilities of PIC32CXBZ2/WBZ45x by acting as both a BLE and Zigbee CI device. This application showcases a Zigbee BLE Bridge, allowing a smartphone to connect to a Zigbee network via a BLE connection created by the WBZ451 device.

Makefile 27.76% C 72.18% C++ 0.06%
ble wbz451 wbz451-curiosity zigbee zigbee-ble-bridge

pic32cxbz2_wbz45x_zigbee_ble_bridge's Introduction

PIC32CXBZ2_WBZ45x ZIGBEE BLE Bridge Demo

"IoT Made Easy!"

Devices: | PIC32CXBZ2 | WBZ45x |
Features: | ZIGBEE | BLE |

⚠ Disclaimer

THE SOFTWARE ARE PROVIDED "AS IS" AND GIVE A PATH FOR SELF-SUPPORT AND SELF-MAINTENANCE. This repository contains example code intended to help accelerate client product development.

For additional Microchip repos, see: https://github.com/Microchip-MPLAB-Harmony

Checkout the Technical support portal to access our knowledge base, community forums or submit support ticket requests.

Contents

  1. Introduction
  2. Bill of materials
  3. Software Setup
  4. Harmony MCC Configuration
  5. Board Programming
  6. Run the demo

1. Introduction

This application demonstrates the multiprotocol functionality of the PIC32CXBZ2 device / WBZ451 module. Here a Zigbee BLE Bridge application is demonstrated using PIC32CXBZ2 / WBZ451 device that functions as both a BLE and a Zigbee CI device simultaneously. In this application, the user can connect a smartphone to a Zigbee network via a BLE connection created by the WBZ451 device. In order to this, the Zigbee console commands have been mapped to the BLE Transparent UART Service. With the help of console commands, the user can allow new devices to join the Zigbee network as well as monitor and control the Zigbee network.

Tip Go through the overview for understanding few key Zigbee 3.0 protocol concepts

2. Bill of materials

TOOLS QUANTITY
PIC32CX-BZ2 and WBZ451 Curiosity Development Board 3

3. Software Setup

  • MPLAB X IDE

    • Version: 6.05
    • XC32 Compiler v4.10
    • MPLAB® Code Configurator v5.1.17
    • PIC32CX-BZ_DFP v1.0.107
    • MCC Harmony
      • csp version: v3.13.1
      • core version: v3.11.1
      • CMSIS-FreeRTOS: v10.4.6
      • dev_packs: v3.13.0
      • wolfssl version: v4.7.0
      • crypto version: v3.7.6
      • wireless_pic32cxbz_wbz: v1.1.0
      • wireless_zigbee: v5.0.0
      • wireless_ble: v1.0.0
  • Any Serial Terminal application like TERA TERM terminal application

  • MPLAB X IPE v6.05

  • Microchip Bluetooth Data (MBD app)

4. Harmony MCC Configuration

Getting started with ZigBee BLE application in WBZ451 Curiosity board

Tip New users of MPLAB Code Configurator are recommended to go through the overview

Step 1 - Connect the WBZ451 CURIOSITY BOARD to the device/system using a micro-USB cable.

Step 2 - Create a new MCC Harmony project.

Step 3 - The "MCC - Harmony Project Graph" below depicts the harmony components utilized in this project.

  • In Device resources, go to wireless->drivers->zigbee->Device types and select Combined Interface. Accept Dependencies or satisfiers, select "Yes". The Combined Interface configuration is depicted as follows.

Note

To make the device as a Zigbee Coordinator, do not select "Act as bridge" option in the configuration options.

  • Add UART components needed for console logs and commands. Right click on the "⬦" in Zigbee console and add the satisfier and in the same way add SERCOM0 to the USART console.

  • The SERCOM0 UART configuration is depicted as follows.

  • From Device resources, go to Wireless->Drivers->BLE and select BLE STACK. Accept Dependencies or satisfiers, select "Yes".The configuration is depicted as follows.

  • From Device resources, go to Wireless->Drivers->BLE->Profiles and select TRANSPARENT Profile. Accept Dependencies or satisfiers. The configuration is depicted as follows.

  • From Device resources, go to Wireless->Drivers->BLE-> Services and select TRANSPARENT Service. Accept Dependencies or satisfiers.

  • From project graph, go to Plugins->PIN configuration and configure as follows.

PIN Configuration

Step 4 - Generate the code.

Step 5 - In "app_user_edits.c", make sure the below code line is commented

  • "#error User action required - manually edit files as described here".

Step 6 - Copy the mentioned files from this repository by navigating to the location mentioned below and paste it your project folder.

Note This application repository should be cloned/downloaded to perform the following steps.
Path firmware/src
  • Copy the "app_ble" folder, "app.c" and "app.h" which can be found by navigating to the following path: "...\firmware\src"
  • Paste the folder under source files in your project folder (...\firmware\src).

Step 7 - Clean and build the project. To run the project, select "Make and program device" button.

Getting started with other Zigbee applications in WBZ451 Curiosity board

  • Extended Light and Multisensor application folders will be available in this link.
  • Follow the steps provided in the above mentioned link to program the board.

5. Board Programming

Program the precompiled hex file using MPLAB X IPE

  • The application hex file can be found in the hex folder

  • Follow the steps provided in the link to program the precompiled hex file using MPLABX IPE to program the pre-compiled hex image.

Build and program the application using MPLAB X IDE

Follow the steps provided in the link to Build and program the application.

6. Run the demo

  • In this application, manual commissioning is used to create a Zigbee network.
  • The Zigbee CI and BLE transparent UART application starts advertising and we can establish a BLE Connection using MBD app.
  • The user can control the Zigbee network with his Mobile phone connected to Zigbee CI device via BLE Link
  • To trigger the commissioning procedures manually, the user has to issue the following console commands on BLE UART in MBD app as given below:

Step 1 - Network Formation – “invokeCommissioning 4 0”

  • If the device is a router or a coordinator it forms the network.

Step 2 - Network Steering – “invokeCommissioning 2 0”

  • The device starts to search for a network to join.

Step 3 - SetFBRole 0 - this command to be given on application endpoint acts as target.

Step 4 - Finding & Binding - “invokeCommissioning 8 0”

  • This command shall be given for any the devices which needs to be bound for clusters.

Step 5- Reset the other Zigbee devices to join into this network. Use "resetToFN" command on the console to reset the other Zigbee devices.

  • Once the network is established Extended light and Multisensor devices will start reporting their attribute values to Combined interface as shown in the video.
  • The Extended Light can be switched ON or OFF by issuing an onOff command(To get the network address, use getNetworkAddress command on your extended light device) from the CI as shown below. onOff -s 0x78ca 0x23 -on

Note

The user can also use "Commissioning on startup" on the Combined Interface device to create a Zigbee network. The procedure to commission a Zigbee network is discussed in detail in this link.

pic32cxbz2_wbz45x_zigbee_ble_bridge's People

Contributors

roopika-mm-mchp avatar sankar-mohan avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.