This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:iot_homelab_kit:hardware:itt_iot [2017/12/08 10:35] – Somepub | en:iot_homelab_kit:hardware:itt_iot [2020/07/20 09:00] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== ITT IoT framework ====== | ====== ITT IoT framework ====== | ||
| - | TTIoT is an IoT framework for the ESP8266 platform. The purpose of the IoT Framework is to | + | ITT IoT is an IoT framework for the ESP8266 platform. The purpose of the IoT Framework is to |
| greatly simplify the creation of IoT applications for the ESP8266 platform. Data exchange with the server | greatly simplify the creation of IoT applications for the ESP8266 platform. Data exchange with the server | ||
| the widely used MQTT protocol (https:// | the widely used MQTT protocol (https:// | ||
| Line 15: | Line 15: | ||
| * change the settings | * change the settings | ||
| * software update | * software update | ||
| + | |||
| + | |||
| + | To use ITT IoT framework, you need to include the source code of the framework <code c># | ||
| + | |||
| + | ===== Setup mode ===== | ||
| + | |||
| + | This operating mode is required to initialize the device to allow the device to start in normal operation and | ||
| + | create a community WiFi connection and a MQTT server. The easiest way to set up your device is to | ||
| + | use the IoTConfigurator Android application. | ||
| + | In set mode, the device will start the WiFi base station, the network name will be IoT- < | ||
| + | device chip id. In addition, the web server will be launched to load the settings and ArduinoOTA | ||
| + | a service that allows you to download new software in setup mode, if necessary. To download the settings and info, | ||
| + | the device uses JSON format data structures and HTTP GET and POST to exchange data inquiries. | ||
| + | |||
| + | ==== Setup mode HTTP interface ==== | ||
| + | |||
| + | The information in this section is not relevant when used for configuring | ||
| + | IoTConfigurator Android app. However, the following may be important if the device is desired | ||
| + | configure via HTTP queries, automate reset or if you want to create a new one | ||
| + | application for setting up the device. | ||
| + | |||
| + | ==== Device visibility check (ping) ==== | ||
| + | |||
| + | http: // < | ||
| + | extends the setting time by 1 minute. | ||
| + | In case of a successful inquiry, returns: | ||
| + | <code c> | ||
| + | |||
| + | ==== Device Hardware Information Query ==== | ||
| + | |||
| + | http: // < | ||
| + | Returns: | ||
| + | <code c> | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | f_size: 4194304, | ||
| + | f_speed: " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | mac: "5C: CF: 7F: 1F: 03: 55", " | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ==== Download the settings from your device ==== | ||
| + | |||
| + | http: // < | ||
| + | <code c> | ||
| + | { | ||
| + | " | ||
| + | mpass: passwd123 | ||
| + | mport: 1883 | ||
| + | msrv: domain.com | ||
| + | mssl: false | ||
| + | " | ||
| + | " | ||
| + | wpass: mypass | ||
| + | } | ||
| + | |||
| + | </ | ||
| + | |||
| + | ==== Search for WiFi networks ==== | ||
| + | |||
| + | The device searches for and returns for each network found a name, signal strength, security information (* | ||
| + | means a password-protected network). | ||
| + | http: // < | ||
| + | Returns: | ||
| + | <code c> | ||
| + | [ | ||
| + | [ | ||
| + | MyNet | ||
| + | " | ||
| + | " | ||
| + | ], | ||
| + | [ | ||
| + | Home | ||
| + | " | ||
| + | "* | ||
| + | </ | ||
| + | |||
| + | ==== Changing settings to the device ==== | ||
| + | |||
| + | http: // < | ||
| + | The curl utility is used, the settings are located in the conifg.json file | ||
| + | curl -H " | ||
| + | http: // < | ||
| + | Returns: | ||
| + | <code c> | ||
| + | { | ||
| + | " | ||
| + | } | ||
| + | </ | ||
| + | if the JSON validated and the device had enough free space to store data. | ||
| + | |||
| + | ==== Restart your device ==== | ||
| + | |||
| + | restarts the device in normal mode. Rebooting is necessary for new ones | ||
| + | to activate the settings. | ||
| + | Returns before restarting: | ||
| + | <code c> | ||
| + | { | ||
| + | " | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | |||
| + | ===== Normal mode ===== | ||
| + | |||
| + | Normal mode is the mode in which a device executes a user program. A prerequisite for normal operation is the running of WiFi and | ||
| + | MQTT server connection. If the connection can not be made, the device will be started in setup mode. | ||
| + | In this case, you should check the device settings (usernames, passwords, ...) and make sure that | ||
| + | network connection and server are working. | ||
| + | |||
| + | ==== Data exchange with the server==== | ||
| + | |||
| + | The data exchange with the server takes place through the MQTT protocol. The MQTT protocol uses publish- | ||
| + | subscribe pattern (https:// | ||
| + | (data) is organized by theme. The IoT framework has been tested on Mosquitto (http:// | ||
| + | server, but you can use another server or service that follows the MQTT protocol (for example: | ||
| + | Amazon AWS IoT, Azure IoT). | ||
| + | |||
| + | ==== MQTT items ==== | ||
| + | |||
| + | The IoT Framework defines some of the default themes used to track and track the device | ||
| + | remote management. If necessary, the user can create a thread as needed. Subject name | ||
| + | The name of the device is used for compilation. The device name is a unique name assigned by the user, which is | ||
| + | prefix device themes. For example, if the device name is " | ||
| + | "Dev1 / log", "dev1 / cfg", ... To achieve a better logical organization, | ||
| + | sub themes, to add a device to a sub theme, the name of the device must be named as the device containing the name | ||
| + | sub-topic For example, if you want to add " | ||
| + | to name it "itt / devices / dev1" | ||
| + | |||
| + | |||