Commit 82f62e8b authored by Yongjia Niu's avatar Yongjia Niu
Browse files

Doc: README: Add a QSG guide

parent a43326c6
# Avnet IoTConnect Demo on Cypress PSoC 6 WiFi-BT Pioneer Kit (CY8CKIT-062-WiFi-BT)
# Avnet IoTConnect Demo on Cypress PSoC 6 WiFi-BT Pioneer Kit
This is a demo to show Avnet IoTConnect.
[TOC]
## Demo Features
- Hardware: Cypress PSoC 6 WiFi-BT Pioneer Kit - CY8CKIT-062-WiFi-BT
- Symmetric Key based Authentication
- Device to Cloud Messages
- Publish the on-board gyroscope data(x, y, z) to cloud periodically every 10s. The data would be changing when moving the board
- The live data could be showing on avnet.iotconnect.io
- Cloud to Device Messages
- Users could send command to control the on-board RGB LED color
## Quick Start
### Setup mbed Development Environment
Please refer to [IoTConnect mbed C/C++ SDK](https://xterra2.avnet.com/embest/iotconnect/mbed/mbed-iot-connect)
### Setup the CY8CKIT-062-WIFI-BT Kit
#### Update on-board Prog firmware
> If you skip this, it may not support the hex files that mbed compiled
1. Use the USB lead to connect your Mbed to a PC. The status light will come on, indicating it has power.
2. Check if kit is in CMSIS-DAP mode (LED2 and LED4 as shown in the image below). ![](assets/2_led_modified.png)
3. Download the fw-loader from [Cypress Semiconductor Github](https://github.com/cypresssemiconductorco/Firmware-loader).
4. Execute the following command in command line, `fw-loader.exe --update-kp3 `. If the connected kit is not detected after executing this command, please enter into bootloader mode by holding down the "Mode Select" button (SW3) before plugging in the board. Then run the fw-loader.exe again.
5. After command is executed successfully please press the Custom App button and release (located below LED4).
6. Kit should now be connected in DAPLink mode as shown in the image below. ![](assets/1_led_modified.png)
More info refer to https://github.com/cypresssemiconductorco/Firmware-loader
### Get the demo code
```bash
git clone https://xterra2.avnet.com/embest/iotconnect/mbed/mbed-psoc6-iotconnect-demo.git demo
cd demo
mbed config root .
```
### Deploy - Fetch the dependence libs
```
mbed deploy
```
### Configuration
#### Wi-Fi settings
In mbed_app.json, change Wi-Fi settings.
```json
{
"target_overrides": {
"*": {
"nsapi.default-wifi-security": "WPA_WPA2",
"nsapi.default-wifi-ssid": "\"YOUR-WIFI-SSID\"",
"nsapi.default-wifi-password": "\"YOUR-WIFI-PWD\"",
},
}
}
```
### Compile
```bash
mbed target CY8CKIT_062_WIFI_BT
mbed toolchain GCC_ARM
mbed compile
# ./BUILD/CY8CKIT_062_WIFI_BT/GCC_ARM/demo.hex will be generated
```
### Load the .Hex
#### Connect the board to a PC
Use the USB lead to connect your Mbed to a PC. The status light will come on, indicating it has power. After a few seconds of activity, the PC will recognise the Mbed Microcontroller as a standard USB drive.
![/media/uploads/maclobdell/generic_win.png](assets/generic_win.png)
#### Using Serial Terminal applications to communicate between the Host PC and the Board
Some terminal programs (e.g. TeraTerm) list the available serial ports by name. However, if you do need to know the identity of the serial port so that you can attach a terminal or an application to it:
| | Windows | | Mac | | Linux | |
| ---- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | ---- |
| | Find the identity of the COM port by opening ''Device Manager''. To do this navigate ''Start -> Control Panel -> System -> Hardware -> Device Manager''. | | To find the device name under Mac OS X, use the command ''ls /dev/tty.usbmodem*'' | | To find the device name under Linux, use the command ''ls /dev/ttyACM*'' | |
| | [![windows](assets/windows_device_manager.jpg)](https://os.mbed.com/media/uploads/sam_grove/windows_device_manager.jpg) | | [![mac](assets/mac_tty.png)](https://os.mbed.com/media/uploads/sam_grove/mac_tty.png) | | [![linux](assets/linux_acm.jpg)](https://os.mbed.com/media/uploads/sam_grove/linux_acm.jpg) | |
#### Save a program hex (.hex) to the Platform
Save the program hex file to your Mbed Microcontroller Disk, just like you would with a normal USB disk. The **Status LED** will flash as the PC writes the file to the disk. The file is now consumed.
#### Press the Reset Button
When the Reset Button in pressed, the microcontroller will be reset and the last programmed application will begin to run.
## Demo Show
### Show on iotconnect.io
### Login iotconnect.io
On a PC, open a web browser, login: http://avnet.iotconnect.io/
> I've send a register invitation to you with the provided email address. You should set the correct timezone in the **Profile** page.
### Telemetry / Live Data Showing
#### Devices List Pages
Please found the device: **psoc6kit-infineon-demo**, you could see if it's online. Click it and enter the device page.
![image-20200919120225020](assets/image-20200919120225020.png)
### Device Page
The device page will show the device name and the online / offline status. Click **Live Data** to show the telemetry.
![image-20200919120447553](assets/image-20200919120447553.png)
### Live Data
#### Telemetry View
![image-20200919120652689](assets/image-20200919120652689.png)
#### Graph View
![image-20200919120748606](assets/image-20200919120748606.png)
#### Tabular View
![image-20200919120827082](assets/image-20200919120827082.png)
### Command
Click **Command** on the device page, to enter the command page. I add some predefined commands to control the on-board RGB LED color. Once command sent, you could see if the LED color change.
![image-20200919121057260](assets/image-20200919121057260.png)
#### Select the command to execute
| Command | Parameter | Description |
| --------- | ------------------------------------------------------------ | ----------- |
| LED OFF | no parameter | Off |
| LED RED | no parameter | RED |
| LED BLUE | no parameter | BLUE |
| LED GREEN | no parameter | GREEN |
| LED COLOR | parameter could be red, green, blue, magenta, cyan, yellow, white, black | Set a color |
![image-20200919121755268](assets/image-20200919121755268.png)
![image-20200919121907127](assets/image-20200919121907127.png)
## Trouble Shooting
### Use the Serial COM to check the log
- Baud: 115200
### A RED LED Blinky show the program is running normal
If the RED LED stop blinky, it may run to error. You need reset the board and check the log.
### Make Sure Your Wi-Fi Settings is correct
Before build the demo, you should set your WLAN first.
More Refer to: http://iotconnect.io/
\ No newline at end of file
https://xterra2.avnet.com/embest/iotconnect/mbed/mbed-iot-connect.git/#1044810a49a58b899b05d511e4474ee81c63a633
https://xterra2.avnet.com/embest/iotconnect/mbed/mbed-iot-connect.git/#50a4db10dfb43fe0940b4e2b5385093dcd4025f1
{
"macros": [
"MBEDTLS_SHA1_C",
"MQTTCLIENT_QOS0",
"MBEDTLS_USER_CONFIG_FILE=\"mbedtls_azure_config.h\"",
"MBEDTLS_DEBUG_C",
"MBED_CONF_TLS_SOCKET_DEBUG_LEVEL=0"
],
"target_overrides": {
"*": {
"rtos.main-thread-stack-size": 8192,
"nsapi.default-wifi-security": "WPA_WPA2",
"nsapi.default-wifi-ssid": "\"NETGEAR86\"",
"nsapi.default-wifi-password": "\"raspberry\"",
"nsapi.default-wifi-ssid": "\"SSID\"",
"nsapi.default-wifi-password": "\"PWD\"",
"mbed-trace.enable": 1,
"mbed-trace.max-level": "TRACE_LEVEL_DEBUG",
"mbed-mqtt.max-connections": "5",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment