{"id":975,"date":"2023-10-06T05:52:46","date_gmt":"2023-10-06T05:52:46","guid":{"rendered":"https:\/\/iotmanager.org\/?page_id=975"},"modified":"2023-10-06T12:32:20","modified_gmt":"2023-10-06T12:32:20","slug":"createmodule","status":"publish","type":"page","link":"https:\/\/iotmanager.org\/en\/instructions\/createmodule\/","title":{"rendered":"Creating your own module"},"content":{"rendered":"<p>Instructions for creating your own and unique module for IoTmanager from Mitchel<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">General rules<\/h2>\n\n\n\n<p>The modules are located in the path IoTmanager \\ src\\modules\\, namely:<\/p>\n\n\n\n<ul>\n<li>in the sensor folder \u2013 Sensors<\/li>\n\n\n\n<li>\u0432 \u043f\u0430\u043f\u043a\u0435 exec &#8212; \u0418\u0441\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430<\/li>\n\n\n\n<li>\u0432 \u043f\u0430\u043f\u043a\u0435 virtual &#8212; \u0412\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b<\/li>\n\n\n\n<li>in the display \u2013 Screens folder<\/li>\n<\/ul>\n\n\n\n<p>In the appropriate directory, create a directory with the module name in a capital letter (for example, AnalogAdc)<br>The module consists of at least two files:<\/p>\n\n\n\n<ul>\n<li>*.cpp executable file (for example AnalogAdc.cpp) named by the module \/ folder name.<\/li>\n\n\n\n<li>Required module description file modinfo. json<\/li>\n<\/ul>\n\n\n\n<p>Third-party libraries are enabled in the modinfo file.json (see below) or placed directly in the module folder.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Executable file<\/h2>\n\n\n\n<p>The module class must be inherited from IoTItem.<br><strong>Working with GPIO<\/strong><br>If you need to work with GPIO, you should connect&nbsp;<strong>extern IoTGpio IoTgpio<\/strong>;<br>To get data from GPIO in the code, call the function&nbsp;<strong>IoTgpio.analogRead(_pin)<\/strong>;<br>To be able to select a GPIO pin from the web, you must define the variable \u201c<strong>pin<\/strong>&#034;in modeinfo.json and read this variable in the class constructor.<br>To get parameters from the web, you need to request the parameter:<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-cpp\" data-lang=\"C++\"><code>_pin = jsonReadInt(parameters, &quot;pin&quot;); \/\/ \u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 pin \u0438 \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e _pin<\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Declaring variables<\/h3>\n\n\n\n<p>In the private section, we describe the variables used during class operation (similar to Arduino variables used in the setup and loop functions).<br>and variables loaded to \/ from the web (<a href=\"https:\/\/old.iotmanager.org\/wiki\/index.php?title=%D0%9A%D0%BE%D0%BD%D1%84%D0%B8%D0%B3%D1%83%D1%80%D0%B0%D1%82%D0%BE%D1%80_ESP_ver4\">Module Configurations<\/a>).<br>For example, unsigned int _pin; can be used to set and get the Pin value set by the user from the web.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Sensor Value<\/h3>\n\n\n\n<p>The module has a basic parameter&nbsp;<strong>Value<\/strong>&nbsp;\u2013 the value displayed in the web interface.<br>To get this value, the program code uses the function&nbsp;<strong>String getValue()<\/strong><br>To change \/ save the main parameter&nbsp;<strong>Value<\/strong>&nbsp;the following functions are used:<\/p>\n\n\n\n<ul>\n<li>setValue(const String&amp; valStr, bool genEvent = true);<\/li>\n\n\n\n<li>regEvent(const String&amp; value, const String&amp; consoleInfo, bool error = false, bool genEvent = true);<\/li>\n\n\n\n<li>regEvent(float value, const String&amp; consoleInfo, bool error = false, bool genEvent = true);<\/li>\n<\/ul>\n\n\n\n<p>Given that the IoTmanager model is event-driven, it will not be possible to process the module values in the script without an event.<br>For an event to occur for changing a parameter in the module, you must call regEvent or setValue at least once with the value GenEvent = true (if GenEvent is not passed to the function, the event will be true by default)<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Main functions of the module&#039;s parent class<\/h3>\n\n\n\n<ul>\n<li>String getID() &#8212; \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f (\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 id)<\/li>\n\n\n\n<li>virtual String getValue\u2013) - retrieves the value of this module (the val parameter)<\/li>\n\n\n\n<li>long getInterval\u2013) - getting the interval for this module (int parameter)<\/li>\n<\/ul>\n\n\n\n<p>They can be called from the parent class IoTItem anywhere in the code execution.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Output to the log<\/h4>\n\n\n\n<p>To display a log on a web page in the window (also duplicated in the serial port)<br><strong>SerialPrint(&#171;i&#187;, F(&#171;ModuleName&#187;), &#171;User set default value: &#187; + val);<\/strong><br>\u041f\u0435\u0440\u0432\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0442\u0438\u043f \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u00abi\u00bb \u2013 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439, \u00abE\u00bb &#8212; \u043e\u0448\u0438\u0431\u043a\u0430 (\u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043e \u043a\u0440\u0430\u0441\u043d\u044b\u043c).<br>The second parameter is the name of the module.<br>The third parameter is the message itself.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Constructor of the module class<\/h4>\n\n\n\n<p>Initializes the user module \/ class and plug-in libraries. Analogous to setup from arduino, for small modules, you can simply try to transfer the code from the setup function when writing a module based on the working code in Arduino.<br>The custom class constructor function must be inherited from IoTItem and accept string parameters, which will accept a string with parameters from the web<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-cpp\" data-lang=\"C++\"><code>ExampleModule(String parameters) : IoTItem(parameters)<\/code><\/pre><\/div>\n\n\n\n<p>To get parameters from the web, you need to request a parameter with a specific name (they must be set in modeinfo. json)<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-cpp\" data-lang=\"C++\"><code>_pin = jsonReadInt(parameters, &quot;pin&quot;); \/\/ \u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 pin \u0438 \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e _pin<\/code><\/pre><\/div>\n\n\n\n<p>All parameters are stored in the variable&nbsp;<strong>parameters<\/strong>, you can read any parameter using the capabilities of the jsonRead function:<\/p>\n\n\n\n<ul>\n<li><strong>jsonReadStr<\/strong>&nbsp;- returns the parameter value as a string,<\/li>\n\n\n\n<li><strong>jsonReadBool<\/strong>&nbsp;&#8212; \u0432\u0435\u0440\u043d\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u0432 \u0432\u0438\u0434\u0435 true|false,<\/li>\n\n\n\n<li><strong>jsonReadInt<\/strong>&nbsp;&#8212; \u0432\u0435\u0440\u043d\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u0432 \u0432\u0438\u0434\u0435 \u0447\u0438\u0441\u043b\u0430.<\/li>\n<\/ul>\n\n\n\n<p>Basic parameters of the module:<\/p>\n\n\n\n<ul>\n<li>polling interval (int)<\/li>\n\n\n\n<li>id (s)<\/li>\n\n\n\n<li>value (val)<\/li>\n<\/ul>\n\n\n\n<p>You don&#039;t need to read them. You can always get IoTItem from the parent class at any point in the code execution with the corresponding functions: &nbsp;<\/p>\n\n\n\n<ul>\n<li><strong>String getID()<\/strong>&nbsp;&#8212; \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0430 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f (\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 id)<\/li>\n\n\n\n<li><strong>virtual String getValue()<\/strong>&nbsp;- getting the value of this module (val parameter)<\/li>\n\n\n\n<li><strong>long getInterval()<\/strong>&nbsp;- getting the interval for this module (int parameter)<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">Periodic execution of the module code<\/h4>\n\n\n\n<p>In these functions, for simple modules, you can try to insert code simply from the loop function based on the working code in Arduino<br><strong>Option 1:<\/strong>&nbsp;function&nbsp;<strong>doByInterval<\/strong><br><br>The main method of implementing periodically repeated actions. This is an analog of loop from arduino, but called every&nbsp;<strong>int<\/strong>&nbsp;seconds set in the settings (the &#034;int&#034; parameter is configurable on the web and described in modeinfo. json).<br>Here you must read your sensor, get data from the sensor. No need to think about delay delays or millis timer checks. The code in this function is executed periodically by calling from the IoTmanager core.<br>To register the sensor data update event, call the function<br><strong>regEvent(value.valD, &#171;exapmleVal&#187;);<\/strong>&nbsp;specifying the variable where the received sensor value is stored and the name of the sensor parameter (described in modeinfo. json)<\/p>\n\n\n\n<p>All variables from the variables section are also available here, and those obtained in setup, if the sensor has several values, then do several&nbsp;<strong>regEvent<\/strong>.<br><strong>\u041d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 delay &#8212; \u043f\u043e\u043c\u043d\u0438\u0442\u0435, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0439 loop \u043e\u0431\u0449\u0438\u0439 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439.<\/strong>&nbsp;If you have a long operation planned, try to break it down into parts and complete it in a few clock cycles<br><\/p>\n\n\n\n<p><strong>Option 2:<\/strong>&nbsp;loop function<br><br>full analog&nbsp;<strong>loop()<\/strong>&nbsp;from arduino. Keep in mind that all modules have equal access to the central server in turn.&nbsp;<strong>loop()<\/strong>, therefore, it is necessary to monitor delays in the algorithm and not create pauses.<br>In addition, this version overloads the parent version, so&nbsp;<strong>doByInterval()<\/strong>&nbsp;disabled. If necessary, you can calculate intervals in loop and provide an explicit call to periodic actions&nbsp;<strong>doByInterval()<\/strong>.<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-cpp\" data-lang=\"C++\"><code> void loop() {\n\n   \/\/\u0437\u0434\u0435\u0441\u044c \u043a\u043e\u0434 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \n\n\/\/\u041d\u0438\u0436\u0435 \u0411\u043b\u043e\u043a \u0432\u044b\u0437\u043e\u0432\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439\n\n       currentMillis = millis();\n\n       difference = currentMillis - prevMillis;\n\n       if (difference &gt;= getInterval()) {\n\n           prevMillis = millis();\n\n           this-&gt;doByInterval();\n\n       }\n\n   }<\/code><\/pre><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">Processing script commands<\/h4>\n\n\n\n<p>To process commands called in the script, you must redefine the function&nbsp;<strong>execute<\/strong>.<br>Inside the function, the command name is checked and parameters are processed if necessary. There can be several parameters.<br>The commands used must be described in the modeinfo file.json (see the corresponding section)<br>In the script, call commands by name (for example, command2(11\u201d &#034; test\u201d);)<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-cpp\" data-lang=\"C++\"><code> IoTValue execute(String command, std::vector&lt;IoTValue&gt; &param){\n        if (param.size() &gt; 0) {\n            if (command == &quot;command1&quot;){\n                if (param.size()){\n                    SerialPrint(&quot;i&quot;, F(&quot;ModuleName&quot;), &quot;User set default value: &quot; + param[0].valS);\n                }\n            }\n            else if (command == &quot; command2&quot;){\n                if (param.size()){\n                    SerialPrint(&quot;i&quot;, F(&quot;ModuleName&quot;), &quot;User set default value: &quot; + param[0].valS + param[1].valS);\n                }\n            }\n        }\n        return {};\n    }<\/code><\/pre><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">Processing buttons from the module configuration<\/h4>\n\n\n\n<p>To add a button to the configuration block on a page in the web interface, you need to register it in the modeinfo.json file&nbsp;<em>see the corresponding section<\/em><br>You also need to redefine the function&nbsp;<strong>onModuleOrder<\/strong>.<br>This function checks the name of the button assigned in modeinfo.json without the &#034;btn-&#034; prefix<br><strong>value<\/strong>&nbsp;\u2013 the value entered in the field next to the button<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-cpp\" data-lang=\"C++\"><code>void onModuleOrder(String &key, String &value){\n        if (key == &quot; Calibration &quot;) \/\/\u0438\u043c\u044f \u043a\u043d\u043e\u043f\u043a\u0438 \u00abbtn-Calibration\u00bb{\n\/\/\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u043a\u043e\u0434 \u043f\u043e \u043d\u0430\u0436\u0430\u0442\u0438\u044e \u043a\u043d\u043e\u043f\u043a\u0438\n        }\n    }\n<\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Class destructor<\/h3>\n\n\n\n<p>The module destructor function, called when a module is removed from the configuration<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-cpp\" data-lang=\"C++\"><code> ~ExapmleModule(){};<\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Module creation function<\/h3>\n\n\n\n<p>The function of a custom module for its processing in the IoTmanager kernel is required for initializing the module from the kernel.<br>This function directly creates module objects by their name (subtype) described in the modeinfo.json file<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-cpp\" data-lang=\"C++\"><code>void* ExapmleModule(String subtype, String param) {\n\n   if (subtype == F(&quot;ExapmleModule &quot;)) {\n\n       return new ExapmleModule(param);\n\n   } else {\n\n       return nullptr;\n\n   }\n\n}<\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Module description file<\/h2>\n\n\n\n<p>Based on the description of the modeinfo file.json help is also generated on the site iotmanager.org<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Module Type Block<\/h3>\n\n\n\n<p>\u0412 \u0431\u043b\u043e\u043a\u0435 &#171;menuSection&#187; \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u0438\u043f \u043c\u043e\u0434\u0443\u043b\u044f, \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c &#171;\u0421\u0435\u043d\u0441\u043e\u0440\u044b&#187;, &#171;\u0418\u0441\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430&#187;, &#171;\u042d\u043a\u0440\u0430\u043d\u044b&#187;, &#171;\u0412\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b&#187;<br><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Block of module elements<\/h3>\n\n\n\n<p>\u0411\u043b\u043e\u043a &#171;<strong>configItem<\/strong>&#187; \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f, \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043c. \u043f. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u043e\u0434\u0443\u043b\u0435\u0439<br>Each element can contain the following standard parameters that will be displayed on the web during configuration, on the right is the parameter name, on the left is the default value.<br>You can also add your own custom parameters so that they can be configured on the web page<\/p>\n\n\n\n<p>&#171;global&#187;: 0, &#8212; \u0411\u0443\u0434\u0435\u0442 \u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432\u0438\u0434\u0435\u043d \u0432 \u0441\u0435\u0442\u0438 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u042e\u043d\u0438\u0442\u0430\u043c\u0438 (\u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438 IotManager) (1 \u2013 \u0432\u0438\u0434\u0435\u043d \u0432\u0441\u0435\u043c IoTManager \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u043c, 0 \u2013 \u043d\u0435 \u0432\u0438\u0434\u0435\u043d \u043d\u0438\u043a\u043e\u043c\u0443)<br>&#171;name&#187;: &#171;BME280 \u0422\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0430&#187;, &#8212; \u041d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043c\u043e\u0434\u0443\u043b\u044f, \u043e\u0431\u044b\u0447\u043d\u043e \u043d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0430\u0442\u0447\u0438\u043a\u0430 \u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u0434\u0430\u0442\u0447\u0438\u043a\u0430 \u0435\u0441\u043b\u0438 \u0438\u0445 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0430, \u0434\u0430\u0432\u043b\u0435\u043d\u0438\u0435, \u0432\u043b\u0430\u0436\u043d\u043e\u0441\u0442\u044c \u0438 \u0442.\u0434.)<br>&#171;type&#187;: &#171;Reading&#187;, &#8212; \u0422\u0438\u043f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 (\u0423\u0422\u041e\u0427\u041d\u0418\u0422\u042c)<br>&#171;subtype&#187;: &#171;Bme280t&#187;, &#8212; \u041a\u0440\u0430\u0442\u043a\u043e\u0435 \u043d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 (\u043f\u043e\u0434\u0442\u0438\u043f), \u043e\u0431\u044b\u0447\u043d\u043e \u043d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0430\u0442\u0447\u0438\u043a\u0430 \u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u0434\u0430\u0442\u0447\u0438\u043a\u0430 \u0435\u0441\u043b\u0438 \u0438\u0445 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0430, \u0434\u0430\u0432\u043b\u0435\u043d\u0438\u0435, \u0432\u043b\u0430\u0436\u043d\u043e\u0441\u0442\u044c \u0438 \u0442.\u0434.)<br>&#171;id&#187;: &#171;Tmp&#187;, &#8212; \u0418\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043c\u043e\u0434\u0443\u043b\u044f (\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0432 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f\u0445). \u0417\u0434\u0435\u0441\u044c \u0437\u0430\u0434\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0435\u0444\u0438\u043a\u0441, \u044f\u0434\u0440\u043e\u043c IoTManager \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043e \u0432 \u043a\u043e\u043d\u0435\u0446 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e. \u041f\u0440\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439<br>&#171;widget&#187;: &#171;anydataTmp&#187;, &#8212; \u0422\u0438\u043f \u0432\u0438\u0434\u0436\u0435\u0442\u0430 \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432 \u0432\u0435\u0431\u0435 \u0438\u043b\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u0432\u0438\u0434\u0436\u0435\u0442\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b \u0432 \u0444\u0430\u0439\u043b\u0435 data_svetle\/widgets.json. \u0422\u0430\u043c \u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0432\u043e\u0438 \u0432\u0438\u0434\u0436\u0435\u0442\u044b<br>&#171;page&#187;: &#171;\u0421\u0435\u043d\u0441\u043e\u0440\u044b&#187;, &#8212; \u0418\u043c\u044f \u0431\u043b\u043e\u043a\u0430 \u043d\u0430 \u0432\u0435\u0431 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u0438\u043b\u0438 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438. \u0421\u043b\u0443\u0436\u0438\u0442 \u0434\u043b\u044f \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435<br>&#171;descr&#187;: &#171;\u0422\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0430&#187;, &#8212; \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043c\u043e\u0434\u0443\u043b\u044f<br>&#171;int&#187;: 15, &#8212; \u0418\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 doByInterval<br>&#171;round&#187;: 1, \u2013 \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u043c\u044b\u0445 \u0437\u043d\u0430\u043a\u043e\u0432 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u044f\u0442\u043e\u0439 (\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b 0,1,2,3 \u2013 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0437\u043d\u0430\u043a\u043e\u0432 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u044f\u0442\u043e\u0439)<br>&#171;needSave&#187;: 0, &#8212; \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u0432 \u044d\u043d\u0435\u0440\u0433\u043e\u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u0443\u044e \u043f\u0430\u043c\u044f\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 Value \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043c\u043e\u0434\u0443\u043b\u044f, 1- \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c. 0- \u043d\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c<br>&#171;map&#187;: &#171;1,1024,1,100&#187;, &#8212; \u041f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c (\u043f\u0440\u043e\u043c\u0430\u043f\u0438\u0442\u044c) \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 Value \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0439 \u043e\u0442 1 \u0434\u043e 1024, \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043e\u0442 1 \u0434\u043e 100<br>&#171;plus&#187;: 0, &#8212; \u0421\u043c\u0435\u0449\u0435\u043d\u0438\u0435. \u041f\u0440\u0438\u0431\u0430\u0432\u0438\u0442\u044c \u043a \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e Value \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e (\u0447\u0438\u0441\u043b\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c)<br>&#171;multiply&#187;: 1, &#8212; \u041c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u044c. \u0423\u043c\u043d\u043e\u0436\u0438\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e Value \u043d\u0430 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0415\u0441\u043b\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c, \u0442\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0447\u0438\u0441\u043b\u043e \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0435. \u0422.\u0435. \u0434\u043b\u044f \u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043d\u0430 100, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u044c 0.01.<br>&#171;btn-defvalue&#187;: 0, &#8212; \u041a\u043d\u043e\u043f\u043a\u0430 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u043c\u0430\u044f \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043c\u043e\u0434\u0443\u043b\u044f \u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u0434\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438, \u0443\u043a\u0430\u0437\u0430\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e. \u041f\u043e\u0441\u043b\u0435 \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u0430 \u00abbtn-\u00bb \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0435 \u0438\u043c\u044f (\u0441\u043c. \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043a\u043d\u043e\u043f\u043e\u043a)<br>&#171;btn-reset&#187;: &#171;nil&#187; &#8212; \u041a\u043d\u043e\u043f\u043a\u0430 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u043c\u0430\u044f \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043c\u043e\u0434\u0443\u043b\u044f \u0431\u0435\u0437 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439. \u041f\u043e\u0441\u043b\u0435 \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u0430 \u00abbtn-\u00bb \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0435 \u0438\u043c\u044f (\u0441\u043c. \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043a\u043d\u043e\u043f\u043e\u043a)<br><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Module Description Block<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">General Description<\/h4>\n\n\n\n<p>&nbsp; &#171;defActive&#187;: false, &#8212; \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u0432\u0445\u043e\u0434\u0438\u0442 \u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0432 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0443 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e (\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 myProfile.json)<br><br>\u0411\u043b\u043e\u043a &nbsp; &#171;about&#187; \u2013 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-json\" data-lang=\"JSON\"><code>&quot;about&quot;: {\n    &quot;authorName&quot;: &quot;NAME&quot;, - \u0418\u043c\u044f \u0430\u0432\u0442\u043e\u0440\u0430\n    &quot;authorContact&quot;: &quot;https:\/\/t.me\/@NAME&quot;, - \u041a\u043e\u043d\u0442\u0430\u043a\u0442 \u0430\u0432\u0442\u043e\u0440\u0430\n    &quot;authorGit&quot;: &quot;https:\/\/github.com\/NAME&quot;, - \u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 GitHub \u0430\u0432\u0442\u043e\u0440\u0430\n    &quot;specialThanks&quot;: &quot;NAME&quot;, - \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0435 \u0441\u043f\u0430\u0441\u0438\u0431\u043e \u0434\u0440\u0443\u0433\u0438\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c\n    &quot;moduleName&quot;: &quot; MyModule &quot;,\n    &quot;moduleVersion&quot;: &quot;0.1&quot;, - \u0412\u0435\u0440\u0441\u0438\u044f \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f\n    &quot;usedRam&quot;: { - \u041f\u0430\u043c\u044f\u0442\u044c \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u043c\u0430\u044f \u0434\u0430\u043d\u043d\u044b\u043c \u043c\u043e\u0434\u0443\u043b\u0435\u043c \u0432 \u043f\u043b\u0430\u0442\u0430\u0445 (\u0443\u0437\u043d\u0430\u0435\u0442\u0441\u044f \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u043c)\n    &quot;esp32_4mb&quot;: 15,\n    &quot;esp8266_4mb&quot;: 15\n    },\n    &quot;title&quot;: &quot;\u0417\u0410\u0413\u041e\u041b\u041e\u0412\u041e\u041a&quot;, - \u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u041c\u043e\u0434\u0443\u043b\u044f\n    &quot;moduleDesc&quot;: &quot;\u041e\u041f\u0418\u0421\u0410\u041d\u0418\u0415&quot;, - \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f.\n    &quot;retInfo&quot;: &quot;\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0418\u041d\u0424\u041e\u0420\u041c\u0410\u0426\u0418\u042f&quot;, - \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043f\u043e \u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u043c\u043e\u0434\u0443\u043b\u044e<\/code><\/pre><\/div>\n\n\n\n<p>Element Description Block<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-json\" data-lang=\"JSON\"><code>&quot;propInfo&quot; - \u0411\u043b\u043e\u043a \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0432\u0441\u0435\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f. \u0417\u0434\u0435\u0441\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0432 \u0432 \u0431\u043b\u043e\u043a\u0435 configItem\n&quot;propInfo&quot;: {\n   &quot;pin&quot;: &quot;\u0423\u043a\u0430\u0436\u0438\u0442\u0435 GPIO \u043d\u043e\u043c\u0435\u0440 \u043f\u0438\u043d\u0430 \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u043e\u0439 \u043a\u043d\u043e\u043f\u043a\u0438&quot;,\n}<\/code><\/pre><\/div>\n\n\n\n<p>User Function Description block<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-json\" data-lang=\"JSON\"><code>&quot;funcInfo&quot; \u2013 \u0411\u043b\u043e\u043a \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0445 \u0432 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438\n    &quot;funcInfo&quot;: [\n      {\n        &quot;name&quot;: &quot;get&quot;, - \u041d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0432\u044b\u0437\u043e\u0432 \u0432 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 get(\u201chttp\u2026\u201d)\n        &quot;descr&quot;: &quot;\u041e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c http \u0437\u0430\u043f\u0440\u043e\u0441 \u043c\u0435\u0442\u043e\u0434\u043e\u043c GET.&quot;, - \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438\n        &quot;params&quot;: [ - \u041d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e\n          &quot;URL&quot;\n        ]\n      },\n      {\n        &quot;name&quot;: &quot;post&quot;, - \u041d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0432\u044b\u0437\u043e\u0432 \u0432 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 post (\u201chttp\u2026\u201d, \u201cok\u201d)\n        &quot;descr&quot;: &quot;\u041e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c http \u0437\u0430\u043f\u0440\u043e\u0441 \u043c\u0435\u0442\u043e\u0434\u043e\u043c POST.&quot;, - \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438\n        &quot;params&quot;: [ - \u041d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e\n          &quot;URL&quot;,&quot;message&quot;\n        ]\n      }\n    ]\n  },<\/code><\/pre><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">Block for connecting external libraries<\/h4>\n\n\n\n<p>usedLibs &#8212; \u0411\u043b\u043e\u043a \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u044b\u0445 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a. \u041f\u0440\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u043e\u0447\u0435\u043d\u044c \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0435\u0451 \u0432\u0435\u0440\u0441\u0438\u044e, \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u0440\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0438 PlatformIO \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0438 \u043d\u0435 \u0444\u0430\u043a\u0442, \u0447\u0442\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0442\u0430\u043c \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043f\u0435\u0440\u0435\u0434\u0435\u043b\u0430\u043b\u0438.<br>When connecting multiple libraries to a module, they are separated by commas.<br>It also indicates for which boards this module has been tested and works. If the fee is not specified, the module will not participate in this assembly even if you select it in the project settings MyProfile. json<br>Example if THERE are NO third-party libraries<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-json\" data-lang=\"JSON\"><code>  &quot;usedLibs&quot;: {\n    &quot;esp32_4mb&quot;: [],\n    &quot;esp8266_4mb&quot;: [],\n    &quot;esp8266_1mb&quot;: [],\n    &quot;esp8266_1mb_ota&quot;: [],\n    &quot;esp8285_1mb&quot;: [],\n    &quot;esp8285_1mb_ota&quot;: [],\n    &quot;esp8266_2mb&quot;: [],\n    &quot;esp8266_2mb_ota&quot;: []\n  }\n}<\/code><\/pre><\/div>\n\n\n\n<p>Example if libraries registered in PlatformIO are used<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-json\" data-lang=\"JSON\"><code>   &quot;usedLibs&quot;: {\n        &quot;esp32_4mb&quot;: [\n            &quot;openenergymonitor\/EmonLib@1.1.0&quot;\n        ],\n        &quot;esp8266_4mb&quot;: [\n            &quot;openenergymonitor\/EmonLib@1.1.0&quot;\n        ]\n    }<\/code><\/pre><\/div>\n\n\n\n<p>Example if the c GitHub libraries are used<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-json\" data-lang=\"JSON\"><code>    &quot;usedLibs&quot;: {\n        &quot;esp32_4mb&quot;: [\n            &quot;https:\/\/github.com\/JonasGMorsch\/GY-21.git&quot;\n        ],\n        &quot;esp8266_4mb&quot;: [\n            &quot;https:\/\/github.com\/JonasGMorsch\/GY-21.git&quot;\n        ]\n    }<\/code><\/pre><\/div>\n\n\n\n<p>Example of enabling multiple libraries<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-json\" data-lang=\"JSON\"><code>    &quot;usedLibs&quot;: {\n        &quot;esp32_4mb&quot;: [\n            &quot;https:\/\/github.com\/robotclass\/RobotClass_LiquidCrystal_I2C&quot;,\n            &quot;marcoschwartz\/LiquidCrystal_I2C@^1.1.4&quot;\n        ]\n}<\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Features of implementing modules<\/h2>\n\n\n\n<p><br>IoTmanager is a modular system, so when developing modules, you must follow the following rules.<br>If the sensor has several parameters, for example, it can output separately or together temperature, humidity, etc. , then you need to create a separate module element for each sensor parameter,<br>namely, several blocks&nbsp;<strong>configItem<\/strong>&nbsp;and for each sensor element, you need to describe your class in the executable file.<br>As an example, a sensor&nbsp;<strong>Bme280<\/strong><br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Library usage method<\/h2>\n\n\n\n<p><br>Since the request to the same library (when connecting a third-party one) comes from different module classes (a class for the temperature element, a class for the humidity element, etc.),<br>then, to implement the use of the library and its single connection and initialization, we suggest using the following::<\/p>\n\n\n\n<p>1. Define a global pointer to the library, for example<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-cpp\" data-lang=\"C++\"><code>SensirionI2CScd4x *scd4x = nullptr; \/\/ create an object of the CSD40 class<\/code><\/pre><\/div>\n\n\n\n<p>2. Define a global library initialization function<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-cpp\" data-lang=\"C++\"><code>\/\/ \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u0447\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443\nSensirionI2CScd4x *Scd4x_instance()\n{\n   if (!scd4x)\n   { \/\/ \u0415\u0441\u043b\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0440\u0430\u043d\u0435\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b\u0430\u0441\u044c, \u0442 \u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u0435\u0440\u043d\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c\n       \/\/ \u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443\n\/\/\u0417\u0434\u0435\u0441\u044c \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0432\u0441\u0451, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0434\u043b\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438\n\/\/ \u043e\u0431\u044b\u0447\u043d\u043e \u0447\u0442\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 Setup() \u0432 Arduino\n       scd4x = new SensirionI2CScd4x();\n       Wire.begin();\n       scd4x-&gt;begin(Wire);\n   }\n   return scd4x;\n}<\/code><\/pre><\/div>\n\n\n\n<p>3. You can use this function in the code of any module element without thinking about whether there is another element in the configuration and who was the first to call the library and initialize it<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-cpp\" data-lang=\"C++\"><code>\/\/\u0417\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \n\n       int valT = Scd4x_instance()-&gt;getTemp ();<\/code><\/pre><\/div>\n\n\n\n<p>4. Since the above function and pointer are defined as global (before any classes, after defining the #include plug-ins), their names must be specified as unique (by the module name) to avoid conflicts with other modules.<br>If you use several identical sensors that use the same library and are separated by addresses (for example, i2c), you can use map to store multiple instances of libraries.<br>See the example in the bme280, bmp280, and Pzem modules.<\/p>","protected":false},"excerpt":{"rendered":"<p>\u0418\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u043f\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0438 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f \u0434\u043b\u044f IoTManager \u043e\u0442 Mitchel \u041e\u0431\u0449\u0438\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u041c\u043e\u0434\u0443\u043b\u0438 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u043f\u043e \u043f\u0443\u0442\u0438 IoTManager\\src\\modules\\, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e: \u0412 \u043d\u0443\u0436\u043d\u043e\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f \u0441 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c \u043c\u043e\u0434\u0443\u043b\u044f \u0441 \u0437\u0430\u0433\u043b\u0430\u0432\u043d\u043e\u0439 \u0431\u0443\u043a\u0432\u044b (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, AnalogAdc)\u041c\u043e\u0434\u0443\u043b\u044c \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u0438\u0437 \u0434\u0432\u0443\u0445 \u0444\u0430\u0439\u043b\u043e\u0432: \u0421\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u044e\u0442\u0441\u044f \u0432 \u0444\u0430\u0439\u043b\u0435 modinfo.json (\u0441\u043c. \u043d\u0438\u0436\u0435) \u0438\u043b\u0438 \u043f\u043e\u043c\u0435\u0449\u0430\u044e\u0442\u0441\u044f \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432 \u043f\u0430\u043f\u043a\u0443 \u043c\u043e\u0434\u0443\u043b\u044f. \u0418\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b &#8230; <a title=\"Creating your own module\" class=\"read-more\" href=\"https:\/\/iotmanager.org\/en\/instructions\/createmodule\/\" aria-label=\"More on \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u0432\u043e\u0435\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f\">Read more<\/a><\/p>","protected":false},"author":1,"featured_media":0,"parent":388,"menu_order":16,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/iotmanager.org\/en\/wp-json\/wp\/v2\/pages\/975"}],"collection":[{"href":"https:\/\/iotmanager.org\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/iotmanager.org\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/iotmanager.org\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/iotmanager.org\/en\/wp-json\/wp\/v2\/comments?post=975"}],"version-history":[{"count":3,"href":"https:\/\/iotmanager.org\/en\/wp-json\/wp\/v2\/pages\/975\/revisions"}],"predecessor-version":[{"id":1013,"href":"https:\/\/iotmanager.org\/en\/wp-json\/wp\/v2\/pages\/975\/revisions\/1013"}],"up":[{"embeddable":true,"href":"https:\/\/iotmanager.org\/en\/wp-json\/wp\/v2\/pages\/388"}],"wp:attachment":[{"href":"https:\/\/iotmanager.org\/en\/wp-json\/wp\/v2\/media?parent=975"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}