# Kết nối thiết bị thực với Platform

Hiện tại Innoway hỗ trợ thiết bị giao tiếp qua MQTT. Người dùng cần chuẩn bị những thông tin sau:

* Device Token: là password sử dụng cho bảo mật TLS của MQTT
* Device ID: là mã định danh của thiết bị trên Innoway

## Lấy Device Token

Để lấy Device Token, người dùng cần nhấn vào email ở góc trên cùng bên phải và chọn **Copy device token.**

![Nhấn chọn email, chọn 'Copy device token'](https://80109326-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGESFS5wilGTY4Ko3HThp%2Fuploads%2FWNkUoZIArpwWpXJ828CX%2Fimage.png?alt=media\&token=b48afd85-6f23-4561-9d15-0d58ae4ca108)

![Nhấn 'Sao chép' để lấy Device Token](https://80109326-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGESFS5wilGTY4Ko3HThp%2Fuploads%2F45eA7Q4D8ssz4NIH6PXW%2Fimage.png?alt=media\&token=9740d406-682d-475e-b460-10f35e5b3af9)

## Thiết lập thiết bị gửi bản tin

Sau đó, thiết lập cho thiết bị gửi bản tin MQTT với thông tin sau:

| Thành phần | Nội dung                           | Ghi chú                                                            |
| ---------- | ---------------------------------- | ------------------------------------------------------------------ |
| topic      | messages/{{deviceID}}/{{subTopic}} | subTopic được sử dụng cho Flow Engine theo bài toán của người dùng |
| payload    |                                    | Nội dung nhận Strings/JSON/XML/Characters                          |
| url        | mqtt.innoway.vn                    | IP mặc định của Broker Innoway                                     |
| username   |                                    | Có thể sử dụng bất kỳ Username nào                                 |
| password   | {{device\_token}}                  |                                                                    |

Người dùng có thể gửi bản tin JSON vào subTopic **attribute** để xem ngay ở trên hệ thống.

## Kiểm tra bản tin trên Innoway <a href="#kiem-tra-ban-tin-tren-innoway" id="kiem-tra-ban-tin-tren-innoway"></a>

Người dùng có thể vào trong màn hình **Danh sách thuộc tính** của thiết bị để xem thông tin thiết bị đã gửi với subTopic **attribute** và Payload **JSON**.

![Bản tin giả lập với Payload dạng JSON](https://80109326-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGESFS5wilGTY4Ko3HThp%2Fuploads%2FqykdpUAO2kG3FyT7ppHT%2Fimage.png?alt=media\&token=69fc5b91-6613-42ed-aebd-cb6202879581)

![Tại màn hình Quản lý thiết bị, nhấn chọn Thuộc tính](https://80109326-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGESFS5wilGTY4Ko3HThp%2Fuploads%2FduTnmo5j4e1dht0Pot7x%2Fimage.png?alt=media\&token=5fa8bcb2-2560-466a-8d45-d44a9c3d7643)

![Màn hình thuộc tính của thiết bị với 02 thuộc tính có trong bản tin đã gửi](https://80109326-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGESFS5wilGTY4Ko3HThp%2Fuploads%2FNdYHO0W8TABkr0bTwGF7%2Fimage.png?alt=media\&token=50f3d87a-f887-411b-92a9-d8b2991183b1)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://innoway-viettel.gitbook.io/innoway/bat-dau-su-dung/ket-noi-thiet-bi-thuc-voi-platform.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
