| Skill Level | Area of Focus | Operating System | Platform/Hardware |
|---|---|---|---|
| Beginner | Bluetooth, IoT, Education, Embedded, Smart Home | RTOS | QCA 402x WiFi/BLE/ZigBee |
This project is intended to help you get familiar with the QCA4020 System-On-Chip (SoC) Product Development kit. The QCA4020 IoT solution offers Wi-Fi, Bluetooth low energy (BLE), and 802.15.4 capable radios in a single-chip package.
The project uses the “Onboard” sample demo included in the SDK with the Eclipse IDE to get started.
As part of this project, you will set up the development environment, import, build and flash a project on the QCA402x development board using the Eclipse IDE. You will then load a sample application on your Android smartphone to read the sensor values that are sent from the development board. The application will:
- Display the list of devices you’ve configured under the Zigbee network
- Allow you to select the Zigbee-connected QCA402x device, read the sensor values, and control the light intensity via a cloud connection.
Objective
The “Onboard_demo” application included in the SDK provides a mechanism to demonstrate end-to-end communication between the QCA402x development boards and the mobile app through cloud network or wireless technology. Using the “Onboard_demo” application, the objective of this project is to explain the steps needed to onboard the QCA4020 development kit to the AWS cloud network.
There are two separate applications/components required to set up the onboarding:
- “Onboard_demo” application running on QCA4020 development kit
- “QCAOnboard and Sensor” application running on the mobile device.
The mobile app, which can also be found in the downloaded SDK package, is designed to read sensor data and control sensors on the QCA4020 development kit. The communication happens through BLE or Wi-Fi (between the mobile application and development kit) and Zigbee/Thread (between the various development kits in the setup). The QCA4020 development kit is connected to the home access point to send the sensor information to the AWS cloud network.
The desired outcome for this project is to use the onboard demo application in “With Cloud” mode to directly read/write sensor data from the development kit using the BLE and Zigbee connections.
Materials Required / Parts List / Tools
- Two QCA4020 Development Kits (One used as coordinator, second used as end device)
- Python version 2.7.X
- Eclipse IDE for C/C++
- openOCD
Additional Resources
Build / Assembly Instructions
In the Box
The contents of the QCA4020 Development kit, as seen above, include:
- QCA4020 development board
- USB to Micro USB cables
- Power supply
- Jumpers
- Setup guide
For the time being, you can set the kit aside while you install the software components and set up the development environment on your computer. Duringthe setup process, you will only briefly use the kit while installing the FTDI drivers for JTAG.
Follow the detailed instructions listed in the “QCA4020 Onboard without Cloud Mode” Project to complete the following steps:
- Setup the development environment.
- Import sample “Onboard_demo” application.
- Build the application.
- Flash the Application on the QCA4020 development board using JTAG and Eclipse.
- Install the mobile application.
Once you have finished the above steps from the “Onboard demo without cloud mode” project, you will additionally have to follow the below steps to run the demo in cloud mode.
- Build with AWS IoT SDK (Section 3.9.1 on page 37 of the dev kit User’s Guide)
- Prerequisites to build onboard AWS demo (Section 5.1 on page 49 of the dev kit User’s Guide)
Usage Instructions
Run the application on the development board
You can use the autoboot mode to run the application on the development board. The Autoboot mode refers to the mode where the system boots up on a power cycle and no JTAG connectivity is required. Follow the below steps to run the application in Autoboot mode on both the development boards.
- Remove the jumper on J31.This was connected to flash the image on the board.
- Power cycle the system.
- The device starts in BLE peripheral mode and starts advertising.
Launch the Smartphone App
- This first step is not required if you are onboarding for the first time.
The application has the provision to save a list of previously onboarded ZigBee coordinators, so if you have used the application before, it is required to delete the previously onboarded device.- Click on the “Settings” icon on top right corner of qca_onboarding mobile application. By selecting the Coordinator List, you will find the list of saved Zigbee Coordinator devices.
- Click on the “Delete” icon and choose “YES” to remove the device from saved list of Zigbee Coordinators.
- In case of Zigbee onboarding, the QCA402x device runs as Zigbee end device connecting to the Zigbee coordinator QCA4020 device.
- In case of Thread onboarding, the QCA402x device runs as Thread joiner connecting to the Thread joiner router QCA4020 device. On the mobile app main screen, select the QCA402x device and onboard the device by using default password “123456” via BLE connection or passphrase “123456789” via Wi-Fi connection.
Congratulations! You set up the development environment, imported, built and flashed a project on the QCA402x development board using the Eclipse IDE. On your smartphone, you can now read the sensor values that are sent from the development board.
Troubleshoot using the Console connection
QCLI command interface is provided for debugging purposes. If the high-speed UART is connected and a serial console is open, a CLI menu appears. Use the reset command to reset the onboarding information save on the CDB to allow it to be onboarded again from the mobile app. More details regarding this can be found in section 5.4 “Console for onboarding demo” in the dev kit User’s Guide.
Sign up for the Developer Newsletter.
Get software and hardware tool resources to help optimize your development delivered to your inbox weekly.
