README.md 2.27 KB
Newer Older
1
2
3
# mbed-iot-connect

This is the Avnet IoTConnect mbed C/C++ SDK. More info about IoTConnect, Please refer to https://www.iotconnect.io/. The backend of IoTConnect is Microsoft Azure IoT hub, more about Azure IoT hub, please refer to https://docs.microsoft.com/en-us/azure/iot-hub/.
Yongjia Niu's avatar
Yongjia Niu committed
4
5
6
7
8
9
10
11

This mbed SDK, is an IoTConnect MQTT client library, More about mbed, please refer to https://os.mbed.com/

## Features

### Features have been supported

- Authentication
12
13
    - Symmetric Key
    - X.509 certificate
Yongjia Niu's avatar
Yongjia Niu committed
14
15
16
- MQTT - Lowlevel
  - Publish
  - Subscribe
17
18
19
20
21
22
23
24
- Device Attributes (Device to Could Messages)
    - cJSON as the Attribute backend
    - Support String / Int / Object json types
    - Support Muti attributes in a device
    - Set / Update attributes and publish to IoTConnect
- Commands (Cloud to Device Messages)
    - Subscribe MQTT Topic
    - Support register callback of different commands to handler
Yongjia Niu's avatar
Yongjia Niu committed
25

26
## How to
Yongjia Niu's avatar
Yongjia Niu committed
27

28
### Install mbed Development Environment
Yongjia Niu's avatar
Yongjia Niu committed
29
30
31
32
33
34
35
36

This is a mbed library, so you should install the development env first. The Arm Mbed OS ecosystem includes many tools designed to work with Mbed OS and projects:

- [Arm Mbed Studio](https://os.mbed.com/docs/mbed-os/v6.0/build-tools/mbed-studio.html)
- [Arm Mbed CLI](https://os.mbed.com/docs/mbed-os/v6.0/build-tools/mbed-cli.html)
- [Arm Mbed Online Compiler](https://os.mbed.com/docs/mbed-os/v6.0/build-tools/mbed-online-compiler.html)
- [Exporting to third party toolchains page](https://os.mbed.com/docs/mbed-os/v6.0/build-tools/third-party-build-tools.html).

37
#### mbed-cli
Yongjia Niu's avatar
Yongjia Niu committed
38
39
40
41
42
43
44
45

I prefer to use Arm Mbed CLI, refer [this link](https://os.mbed.com/docs/mbed-os/v6.0/build-tools/install-and-set-up.html) to install and set up it.

I will show you how to install mbed cli on Ubuntu Linux.

```bash
sudo apt install python3 python3-pip git mercurial
python3 -m pip install mbed-cli
46
# To verify Mbed CLI installed correctly, run
Yongjia Niu's avatar
Yongjia Niu committed
47
48
49
50
51
52
53
54
55
56
57
58
59
mbed --help
```

#### Install a compiler

Download [GNU Arm Embedded version 9 (9-2019-q4-major)](https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads)

#### Configure compiler location with Mbed CLI

```
mbed config -G GCC_ARM_PATH "/home/build/tools/gcc_arm/gcc-arm-none-eabi-9-2019-q4-major/bin"
```

60
### Add to your mbed project
Yongjia Niu's avatar
Yongjia Niu committed
61
62

```bash
63
$ mbed add https://xterra2.avnet.com/embest/iotconnect/mbed/mbed-iot-connect.git
Yongjia Niu's avatar
Yongjia Niu committed
64
65
66
```