This is an old revision of the document!


ITT IoT framework

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 the widely used MQTT protocol (https://en.wikipedia.org/wiki/MQTT) is used in the IoT field. The IoT framework includes:

  • To initialize the mode (network / server parameter setting)
  • Managing a WiFi network / MQTT server connection
  • sending / receiving messages from the server
  • save / change settings on the device
  • remote management of the device
  • tracking the status
  • periodic statistics
  • change the settings
  • software update

To use ITT IoT framework, you need to include the source code of the framework

#include <ittiot.h>

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- <ESP_ID>, where ESP_ID is 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: <ipaddr> / ping query allows you to check the device's visibility from the network. Every successful query extends the setting time by 1 minute. In case of a successful inquiry, returns: <code c>{“success”: “true”}<code> ==== Device Hardware Information Query ==== http: <ipaddr> / get / info query provides a quick overview of the device. Returns:

{
"cpu_freq": "80",
"f_free": "2797568",
f_size: 4194304
f_speed: "40000000"
"fw_build": "May 27 2017 17:25:08", "
"fw_size": "344528",
"id": "1f0355",
mac: "5C: CF: 7F: 1F: 03: 55", "sdk_version": "1.5.3 (aec24ac9)"
}

Download the settings from your device

http: <ipaddr> / get / config query loads the device settings (if any). <code c> { “dname”: “itt / esp / dev1” mpass: passwd123 mport: 1883 msrv: domain.com mssl: false “muser”: user123 “wname”: MyNet wpass: mypass } </code> ==== 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: <ipaddr> / get / networks Returns:

[
[
MyNet
"-89",
"*"
],
[
Home
"-66",
"*

Changing settings to the device

http: <ipaddr> / set / config POST request to the device in the JSON format setup. In the example The curl utility is used, the settings are located in the conifg.json file curl -H “Content-Type: application / json” -X POST -data @ config.json http: <ipaddr> / set / config Returns:

{
"success": "true"
}

if the JSON validated and the device had enough free space to store data.

Restart your device

http: <ipaddr> / restart p restarts the device in normal mode. Rebooting is necessary for new ones to activate the settings. Returns before restarting: <code c> { “success”: “true” } </code>

en/iot_homelab_kit/hardware/itt_iot.1512730084.txt.gz · Last modified: 2020/07/20 09:00 (external edit)
CC Attribution-Share Alike 4.0 International
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0