Commit 651fa5a3 authored by Yongjia Niu's avatar Yongjia Niu
Browse files

README: Add a getting start guide

parent 796dcba9
compile_commands.json
\ No newline at end of file
compile_commands.json
.ccls-cache/
# Avnet IoTConnect Demo on STM32L4 / STM32L4+ Boards
This is a demo to show Avnet IoTConnect mbed C/C++ SDK on ST STM32L4 / STM32L4+ boards.
Support STM32 Boards:
[TOC]
[ST - B-L475E-IOT01A](https://www.st.com/en/evaluation-tools/b-l475e-iot01a.html)
## Demo Features
- Support Hardware Boards
- [ST - B-L475E-IOT01A](https://www.st.com/en/evaluation-tools/b-l475e-iot01a.html)
- [ST - B-L4S5I-IOT01A](https://www.st.com/en/evaluation-tools/b-l4s5i-iot01a.html)
- 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 blinky on / off of the on-board LED
## Quick Start
### Setup mbed Development Environment
Please refer to [IoTConnect mbed C/C++ SDK](https://xterra2.avnet.com/embest/iotconnect/mbed/mbed-iot-connect)
### Get the demo code
```bash
$ mbed compile -m DISCO_L475VG_IOT01A
git clone https://xterra2.avnet.com/embest/iotconnect/mbed/stm32l4-iotconnect-demo.git demo
cd demo
mbed config root .
```
### Deploy - Fetch the dependence libs
```
mbed deploy
```
[ST - B-L4S5I-IOT01A](https://www.st.com/en/evaluation-tools/b-l4s5i-iot01a.html)
### 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 compile -m B_L4S5I_IOT01A
```
\ No newline at end of file
mbed toolchain GCC_ARM
```
If you are going to use [ST - B-L475E-IOT01A](https://www.st.com/en/evaluation-tools/b-l475e-iot01a.html)
```
mbed compile -m DISCO_L475VG_IOT01A
```
or [ST - B-L4S5I-IOT01A](https://www.st.com/en/evaluation-tools/b-l4s5i-iot01a.html)
```
mbed compile -m B_L4S5I_IOT01A
```
A .bin file will be generated if compile successful.
### Load the .Hex / .Bin
#### 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 recognize 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
### Login avnet.iotconnect.io
On a PC, open a web browser, login: http://avnet.iotconnect.io/
### Telemetry / Live Data Showing
#### Devices List Pages
Please found the device: **[B-L4S5I-IOT01A-DBG1](https://avnet.iotconnect.io/device/1/B-L4S5I-IOT01A-DBG1)**, you could see if it's online. Click it and enter the device page.
![image-20201009151349332](assets/image-20201009151349332.png)
### Device Page
The device page will show the device name and the online / offline status. Click **Live Data** to show the telemetry.
![image-20201009151513212](assets/image-20201009151513212.png)
### Live Data
#### Telemetry View
![image-20201009151558437](assets/image-20201009151558437.png)
#### Graph View
![image-20201009151729105](assets/image-20201009151729105.png)
#### Tabular View
![image-20201009151814094](assets/image-20201009151814094.png)
### Command
Click **Command** on the device page, to enter the command page. I add some predefined commands to control to on / off the on-board LED blinky . Once command sent, you could see if the LED is blinky or not.
![image-20201009152008145](assets/image-20201009152008145.png)
#### Select the command to execute
| Command | Parameter | Description |
| ---------- | ------------ | ----------- |
| BLinky Off | no parameter | Off |
| BLinky On | no parameter | On |
## Trouble Shooting
### Use the Serial COM to check the log
- Baud: 115200
### Make Sure Your Wi-Fi Settings is correct
Before build the demo, you should set your WLAN first.
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