An easy way to remote control of electrical appliances via the Internet. Ethernet controller for remote control equipment Relay control over the Internet

Hello, dear readers and guests of the site "Electrician Notes".

In the past publishing, I introduced you to and sensory, managed, both in the manual and the control panel.

But today your attention I would like to refer to the relay (switch) Sonoff version of Basic with the ability to control directly from a mobile phone via a Wi-Fi network or the Internet.

The Sonoff Basic relay is a small device of the device (88x38x23 mm), which can be placed without any problems behind the ceiling space, in a construction niche, or a cup of chandeliers or lamp.

Its cost at the time of the release of the article is a little less than 300 rubles. As you understand, this is quite acceptable money, besides, for such a modern device. I purchased it on the all-famous aliexpress trading platform (the reference will be at the end of the article).

In the kit, two protective covers with fastening screws were attached, but the instructions, unfortunately, was not.

The Sonoff relay has the following technical characteristics, part of which is displayed directly on its enclosure:

  • maximum current controlled load 10 (a)
  • supply voltage from 90 (c) to 250 (B)
  • wireless Standard 802.11 B / G / N
  • wPA-PSK / WPA2-PSK Security Protocol
  • operating temperature from 0 ° C to 40 ° C
  • mass of about 50 g

Opportunities Sonoff Basic relay:

  • load control via Wi-Fi
  • load control over the Internet
  • load control on a given timer, both with direct and countdown
  • load control with multiple mobile phones

Here are such features of the Sonoff relay. It can be safely used in the systems of the smart home and for other different needs and needs.

At first I will tell you how to connect Sonoff, and then check all its stated management methods in practice.

So, let's go.

Installing and Connecting Sonoff Relay

To work Sonoff relay, it is necessary to supply voltage 220 (B), which means it can be installed without any problems in a convenient place for you, for example, in a cup of chandeliers or directly under the tensioning ceiling, as well as directly in the distribution box, if there is plenty of space.

To mount the relay to the surface, it has two mounting holes.

Connection diagram Sonoff relay is very simple.

On the terminals (L) and (n) from the side (input-input) connect, respectively, the phase and zero supply voltage 220 (B). Naturally, when connected do not forget about.

Please note that plug-in veins should be a cross section of no more than 1.5 sq. M. But I still tried to connect veins with a cross section of 2.5 sq. Mm. As a result, the hard (single-run) wire can still be connected without any problems, but the flexible (multi-proper) with great difficulty is inserted into the terminal, so it had to do not even flatten it and deform.

For example, I used the PVA supply cable, which just has a section of 2.5 sq.mm. At the other end of the cable there is a plug, which in the future I connect to any socket with a voltage of 220 (B).

On the terminals (L) and (n) on the side (Output-output) connect, respectively, the phase and zero load.

For convenience of connecting the load, I connected the outlet to the relay output.

By the way, terminal covers carry not only the protective function, but also play the role of the clamps of the supply wires or cable.

So it turns out everything is beautiful and neat. Sonoff relay is connected.

As a load, I connected the LED lamp, about in one of my articles.

Here is a simple example of a Sonoff relay circuit for a group of lamps.

By the way, as a load is not necessarily use only a lamp or a lamp group. On the output terminals, you can safely connect any other load not exceeding the rated current 10 (a). And if you still need to control the load that has a current value above 10 (a), it can be connected to the contactor, and with the help of the relay you can already control the coil of this contactor.

In this connection, you can add that when using the contactor can be controlled, at least a single-phase load, even three-phase, alternating current, at least constant.

It will look like this.

Thus, the scope of application of the Sonoff relay is very wide and diverse. They can be controlled, at least one light bulb, at least a powerful single-phase electric heater, at least a three-phase electric motor, etc. It all depends only on your needs and needs.

Now consider all the options for controlling the Sonoff relay more in more detail.

I will not open the relay and watch his device, on this score already provides information on the Internet - see the appropriate electronics resources. And judging by the reviews, the performance of the relay is quite decent. By the way, who is interested to know, the relay is assembled on the basis of the famous Chinese microcontroller ESP8266.

Load control via telephone via Wi-Fi

Before you tell about the control of the relay through Wi-Fi, I will say that they can be controlled and in manual. To do this, there is a small recessed black button on its housing. So, with one short-term pressed, the relay turns on, and when repeatedly pressing, respectively, it turns off. And for this it is not necessary that the relay is connected to a Wi-Fi network - the control will be carried out in offline mode.

But in addition to this, the button carries in itself and another functionality, which I will tell just below.

To implement the possibility of loading the load through Wi-Fi and the Internet, you must install the ewelink mobile application on the phone. This application can be found for both Android devices and iOS. To facilitate the search for applications, you can use the necessary QR codes on the package.

For Android devices, the Ewelink application can be downloaded for free from Google Play and install yourself on your phone. The program interface supports Russian.

For iOS devices, this application is available in the App Store. I did not try to download and install this application on the iPhone or iPad, so who has tried this application on devices with iOS, please write down in the comments on the results.

After installing the EWELINK application, you will need to register immediately, pointing to the country and your email address. In this case, the phone must be connected to the Internet.

After that, the mail will receive a check code (valid 30 minutes), which must be entered in the corresponding line "Email code". On the same page it is necessary to enter a password to enter your future account (at least 8 characters).

By the way, on mail services Mail.Ru and Mail.yandex.ru (Yandex-Mail) letters reach without problems. But as far as I am aware, then the letter-to-mail service of Gmail.ru (Google-mail) does not always reach the check code, so you do not care.

Then you need to pair the relay and the router by prolonged retention (for 5 seconds) of the same button on the switch housing, after which the green LED flashes on the relay. We put a tick on the first connection mode and click "Next".

Now you need to choose from the list of our Wi-Fi network and enter a password from it. To do not enter the password every time, you can check the "Remember Password". Click "Next", after which the search for our device and its registration will begin (by time it took me no more than 2-3 minutes).

After successful pairing, the relay automatically transmits data to the Chinese cloud (Amazon AWS or Coolkit), which makes it possible to manage it via the Internet. But I will come back a little later.

As you can see, our relay is now displayed in the list of all devices (as long as it is the only thing in the list, but others will also appear in the near future).

When the relay is in online (on the network), the green LED is always lit on its package. As soon as the LED begins to blink, it means that the connection with the router or the Internet is lost. Just on this indicator and conveniently determined, there is a relay on the network (Online) or not (offline).

While I tested this device, I did not notice problems with the loss of the network. The device is always on the network and reacts consistently to the control commands.

Now you can try to turn on the relay through the phone. To do this, click on the "relay 1". Immediately a red inscription appeared that it is necessary to update the Ewelink application, although the update is not displayed on Google Play.

We go into the device setting (three points in the right corner) and see that the application has the current version 1.5.2, and a newer version is available 1.5.5. Click on the "Download" icon and the application update begins. After upgrading, the red inscription disappears, and in the settings we can see the new current version 1.5.5.

Remember !!! The main condition of the relay is the availability of Internet access.

If the Internet suddenly disappears, the green LED will flash on the relay housing, and the Offline (Offline) mode is displayed on its tab, i.e. Not available for control.

So, to include our "relay 1", you need to enter it and click on the round virtual button in the center of the screen. Moreover, you can manage the relay from the general list of all devices by clicking on the corresponding small button (left). In general, who will like it.

When the relay position is disconnected, the button has white color with a fill around her gray background. When the relay position is on, the button changes its color to green, and the background around it becomes blue.

In addition to the banal control principles, you can set the time for switching on or disconnecting the timer relay by setting up the appropriate date and time of its control.

Moreover, it was surprised that the relay was triggered by a given timer even when it is outside the network (offline), which means all the specified timer programs are stored directly in the relay memory.

Click on the "Add Timer" button and go to the Timer Settings page. Each timer is configured, or on the switch on the relay or on shutdown. All have two timer settings:

  • one-time (one-time triggering for a given date and time)
  • repeated (periodic responses on a given date and time, including indicating specific days of the week)

In addition to the direct countdown timer, there is a countdown timer. Very necessary functionality for certain purposes. It is configured in analogous to the direct timer, only with the possibility of a single response.

In addition to direct and reverse timers, in the "Settings" tab (three points in the right corner) there is a cycled timer.

In this tab, you can configure various options for switching cycles. I will not tell about it in detail, because Everything is simple and intuitive here.

The total number of configured timers, including a cycled timer, may be no more than 8. And be careful, because When you put on each other time of various timers, none of them can work !!!

Also in the settings you can specify, in which position the relay will remain if you suddenly be disabled with the power 220 (B). There are three options here. By installing the appropriate checkboxes, you can choose that when you repeatedly appear 220 (c) the relay can, or turn on, or disconnect, or remain in the initial state.

By the way, this is a very convenient feature. Here, even remember the nuance, which when disappeared and reappears 220 (B) power, for some reason always turns on, even by being in a disconnected source state. And imagine that you are not at home, slightly "blinking" the voltage in the network and the controller independently turned on the chandelier. This incident will not happen here, because In this case, everything can be customized to your needs.

In addition to the above, all devices connected to you in the Ewelink application can be grouped together and combine various scenarios.

Is it possible to manage the relay immediately from several phones?

Can! Naturally, at the same time, the EWELINK application must be installed on each phone.

There are two options here. The first option is to enter the Ewelink application under the same name and password from different phones and manage the relay.

True, here, if on one phone log in to the application, and then at the same time enter the application under the same login and password, but already on another phone, then an error will arise on the first phone and an automatic output occurs. At the same time, the second phone remains in the application and you can control devices using it.

At the same time I would like to note that when controlling the relay from one phone, its status is displayed almost instantly immediately on all phones that are connected to it.

Load control over the Internet

In addition to the management of the relay through the phone via Wi-Fi, they can also be controlled via the Internet from any point of your location, i.e. Absolutely from anywhere in the world where there is access to the Internet.

So, to control the switch via the Internet, you need to enter the same Ewelink application under your name and password that you specified during registration. And then everything is analogy. This is the application, the same settings, the same control buttons, etc., the only difference is that you are not at home in the area of \u200b\u200byour Wi-Fi network, but at a distance hundreds and thousands of kilometers from home.

A little about the cloud.

But still without the Internet you will not be able to manage the relay, because Management is not through the local network, but through the Internet, i.e. The most Chinese cloud about which I mentioned above. And it does not matter, management goes through Wi-Fi or via the Internet, control when control always goes through the cloud, and access to the cloud is needed.

In this regard, various craftsmen have already invented how to untie the device from the Chinese cloud or make control only through the local home network. To whom it is interesting, this information can be found on certain resources.

By the way, if you need a similar device, but with the additional function of radio control from the console, you can order the Sonoff version of the RF version.

If you want to control the load where there is no Internet, you can use the Sonoff version of the G1 version (GSM / GPRS with SIM-card support). Also, this manufacturer has a relay with the temperature sensors and humidity Sonoff TN10 / TN16 and two-channel (for controlling two independent loads) Sonoff Dual relay.

In general, the manufacturer Sonoff has many different devices, about some of the most interesting and meaningful, I will tell you on the pages of your site, so subscribe to the newsletter so as not to miss interesting issues.

Buy Sonoff relay here:

  1. Sonoff Basic: https://goo.gl/jxynm3
  2. Sonoff RF (with radio control): https://goo.gl/trpqn6
  3. Sonoff G1 (GSM / GPRS with SIM-Card Support): https://gooo.gl/ekptdp
  4. Sonoff TN10 / TN16 (temperature and humidity sensor): https://goo.gl/mwal5p
  5. Sonoff Dual (two-channel): https://gooo.gl/a7rv56

And already traditionally, video based on the article, where you can more clearly see the SONOFF relay setting:


I continue to talk about the simplest and most affordable ways to control electrical devices via the Internet using cloud services. First of all, such devices are relevant to country house owners, in order to be able to remotely turn on the heating and prevent the home freeze. Wireless Wi-Fi Relays in DIY format from Itead is primarily attractive to its price. The device is ready for operation. In fact, at the cost of the components that are used in it. Is the joke of whether the simplest relay costs less than 5 dollars?

Earlier, I am already talking about compact relays that allow you to remotely control the load. Today I will show new devices. First, this is a device with two independent Sonoff Dual relay, and secondly, Sonoff Th, having an inlet to an external temperature / humidity sensor. Such a relay allows not only to obtain remote monitoring of temperature and humidity, but also automate the process of maintaining these parameters in a given range.

So let's understand!


2. First of all, the relay acquired a new corps. In size, they became about 2 times more than the first generation relay. There was a more distinct labeling and a more convenient button for programming and manual control.

3. Screw terminals are replaced with spring. A very correct solution that allows you to reliably connect the load without the risk of threading the threads on the contacts. Sonoff th is available in two modifications, with a relay designed for a load of 10 or 16 amps. That is, in the second case, you can switch the load with a power up to 3,600 watts through the relay. Modification with a 10 amp relay costs $ 7.5. With a 16 amp relay - $ 8.6 (as much as the Dual 10a Sonoff Dual relay).

4. The relay can work independently, or you can connect external sensors to it. The choice of the temperature probe DS18B20 (in the photo in the center), worth $ 3.5, or a temperature / humidity sensor AM2301 worth $ 4.3 dollars.

5. On the left is a single relay with a connector for external sensors. Right - double relay, without a connector for external sensors.

6. The device is built on the basis of the well-known ESP8266 chip. The entire low-speed part is at the bottom of the board. On the left you can see the connectors that allow you to connect the USB-TTL adapter. Those who do not trust the public cloud service can always pour the modified firmware on the device and adjust it to their needs. On the Internet there are examples how to do it.

7. Collect the simplest scheme to demonstrate the operation of the device. As a load, we have a small LED floodlight. We connect it to the 220 volts network through the Sonoff Th10 relay. To be able to remotely manage the relay, you need to make the "pairing" procedure with your home Wi-Fi network operating in the 2.4 GHz band.

8. The setting is done through the ewelink branded app on your smartphone, available for both IOS and Android.

9. After the initial pairing procedure, you get the ability to control the load both manually (from the button on the relay housing) and remotely (through the application on the smartphone). You can also configure timers to enable and automate management by specifying the working ranges of temperature and humidity.

10. One of the options for applying the Relay of the first version is the control of the scabs next to the bed in the bedroom. The only drawback is that from an extestary point of view, it would be better to relays in the case of a conventional fly switch, because In this form, as now, press the small button on the housing, it is not completely inconvenient to turn on light. The presence of a timer allows you to program the switching on / off of the light, for example, for the period of your vacation, to create an imitation that someone is in the apartment.

11. Options for using the relay are a huge set. In particular, I have a desire to finally automate control using the Dual Sonoff Dual relay (one relay to lower the cable, the other is on the rise). How to do, I will definitely write about it. I also use the relay for the remote switching on the light when I approach the country house in the dark.

There are many applications. You can, for example, make a homemade heat accelerator from a tank with water, programming it for heating at night, on a cheap tariff. You can make storage for potatoes on a heated balcony or a remote opening of the gate in the garage. You can automate the inclusion of the fan in the bathroom when the specified moisture level threshold is exceeded. In general, it all depends on your imagination. For programming and remote control, the relay is needed to have access to the Internet. If they are pre-programmed to work on the timer, they can work autonomously. Order the relay is better on the company's official website, delivery to Russia costs 6 dollars.

All materials about the construction of a country house with their own hands in chronological order can be viewed.

goods - 0 pcs.



1 - 2 pcs:3500.0 rub.
3 - 10 pcs:3250.0 rub.
11 - 25 pcs:3100.0 rub.
26 - 75 pcs:2950.0 rub.
76 - 100 pieces:2550.0 rub.
\u003e 100 pcs:2350.0 rub.

Documentation:


The latest version of "firmware"

Software:


SDK Web Interface


Description:

Module Laurent. (pronounced "Laurent") Designed to control digital and analog devices, sensors and actuating mechanisms via Ethernet (LAN) interface. Laurent has a rich hardware periphery in its composition, including:

  • powerful electromagnetic relays 220 V / 7 A (4 pcs)
  • entrance (6 pcs) and weekends (12 pcs) Discrete lines
  • input for connecting temperature sensor
  • pulse counters (4 pcs)
  • Shim out
  • ADC, two channels
  • rS-232 port


The module control can be carried out in various ways:

  • through the built-in web page
  • direct HTTP requests
  • a set of text command controls on the Directip protocol (TCP port 2424)
  • tCP-2-COM interface - transparent data exchange between the serial port and TCP port 2525
  • offline hardware management when different events occur (CAT system

The module has a built-in management web page. It is enough to run any browser, enter the IP address of the module (by default 192.168.0.101) and you get a convenient visualized interface to control the various resources of the module and monitor its parameters in real time.



Using the Laurent and CAT system, you can quickly build a server monitoring system over the network and automatically restart it, in case of detection of "hang". Server and Laurent are in the same subnet. Laurent on a periodic basis sends the Ping command to the server by its IP (CAT system). If there is no answer - automatic dumping power through the relay.

Control is made by refer to a specific HTTP page with various parameters that define the action that needs to be performed. For example, if you execute the query as shown below, the relay will be included at number 4:



It is possible to connect multiple modules to one network through the router:

Laurent modules can easily be connected to a wireless Wi-Fi network via Wi-Fi router. This combination of the Laurent module and the Wi-Fi router allows you to control / control the module with almost any device equipped with Wi-Fi Internet at a considerable distance.

Distinctive features:

  • control module with Ethernet (LAN) interface
  • does not require additional circuit elements - immediately ready to work
  • hardware resources are available on terminal connectors
  • 4 x relay (220 V / 7 A)
  • 6 x input discrete optoisolated lines
  • The ability to directly connect the temperature sensor
  • 2 x 10 discharge ADCs to measure external voltage
  • 4 x OptoSolya Pulse Counter
  • 12 x output discrete control lines (up to 50 V, 0.5 and for each line)
  • PWM output for smooth change in power supply to load
  • rS-232 Serial Port
  • tCP-2-COM interface ("transparent" data bridge over the network between RS-232)
  • a set of ready-made high-level control text commands (KE commands) by TCP / IP protocol (open command interface)
  • recommended supply voltage: from 6 to 9 V (recommended power supply PWR-75A.)
  • indicational LEDs of the network activity and module status
  • indication LEDs input discrete lines
  • each module has a unique serial number.
  • support Windows 95, 98, 2000, 2003, XP 32/64 Bit, Vista 32/64 Bit and Windows 7 32/64 Bit
  • support OS Linux
  • built-in WEB server for control and monitoring
  • the ability to connect several modules to one network (you need to change IP / Mac addresses)
  • ability to change network settings of the module (IP, Mac, Default Gateway, Subnet Mask)
  • access to the web page of the management and command interface is password protected
  • the "Watchman" system - the mode of automatic tracking of changes in the state of input discrete lines
  • ability to save and subsequent restoration of the states of hardware resources after power off (relay, output discrete lines, pulse meter, PWM)
  • system Cat. - automatic control of the output resources of the module when events occur on the input lines, by timer, in terms of the temperature sensor threshold and on the Ping remote device command

Contents of delivery:

The package includes only the Laurent module itself. The module is packed in a bubble shock-protective film or a cardboard box with shock-absorbing foam. When sending by mail, the module is packaged in a solid cardboard box and placed the "safety pillow" from paper. Documentation and drivers are available in electronic form.


Guarantee:

The full-time operation of the module is guaranteed for 1 year from the date of sale when complying with the operating conditions and storage rules given in the technical description. In the event of a malfunction, the malfunctioning module is exchanged. The warranty does not apply to modules that have mechanical, electrical and other damage caused by their improper operation.


As practice has shown, household satellite tuners used by cable operators often have to be restarted due to periodic loss of sound or image. It is caused by various factors: an inhomogeneous signal level from a convector, overheating of the receiver or drying of electrolytes. You can keep duty staff for prompt switching, but when it is economically unprofitable to help the described device. In principle, the application of the developed device is not limited to only this area of \u200b\u200bactivity.

Briefly:
Purpose. Allows you to control the inclusion and disconnection of loads connected to the controlled relay.
Device. A fundamentally, the device consists of three modules: an Ethernet module, a microcontroller module, load control module.
The Ethernet module is assembled on a microchip enc28j60 chip and it is advisable to take it ready, for example here: http://www.aliexpress.com/wholesale?SearchText\u003dEnc28j60. As a microcontroller used the ATMEGA32 chip. In the control module, there are transistor keys that include appropriate relays. Each relay includes or turns off the power on the consumer in need of this.
Operating principle. The principle of operation of the device is easy to understand from the Schecon:

For the interactive use of the system, a web interface is provided by entering into which the operator turns on or disables the corresponding port (see Sync). The design and firmware is provided by the use of 20 output ports: PA0 ... PA7, PC0 ... PC7, PD4 ... PD7. However, if you wish, the number of outputs can be increased to 80 pieces - for this it is necessary to use decoders (for example, K155IM3) and rewrite the Yavascript The Webpoves so that MK outputs generate control words (0x0 ... 0xF). This approach will somewhat complicate the device scheme and the need to reboot tuners "in turn" will appear. Much more appropriate to use multiple-described devices under various IP addresses.

Microcontroller firmware. To flash ATMEGA32 I used the "4 Wiring" programmer for the COM port and software. I stitched on an old PC running Windows XP. In modern operations, I have not tried, due to the lack of COM-a. firmware.

You still need to install fubes as in the picture.

Source firmware codes with comments can be downloaded. In the source folder lies the worker makefile. To compile the project, I enjoyed free. To do this, open the command prompt, go to the project folder and type "make". As a result of the compiler, several intermediate lining files will appear in the folder and the HEX firmware file.

To clear the result of the compiler - ibid, on the command line, write "make clean".

If you cut the source code, pay attention to two functions:

Fill_tcp_data_p (BUF, PLEN, PSTR ("Row transmitted to the package")); Char Stroka \u003d "String transmitted to the package"; fill_tcp_data (buf, plin, stroka);

We use the first function where it is clearly necessary to transfer the string (static text). Second Yuzai with string variables.
From file. iP_ARP_UDP_TCP.C.:

Uint16_t fill_tcp_data_p (uint8_t * buf, uint16_t pos, const prog_char * progmem_s) (char c; // Fill in TCP Data at POSITION POS // // With No Options The Data Starts After the Checksum + 2 More Bytes (Urgent PTR) ((Progmem_S ++)) (BUFMEM_S ++))) (BUF \u003d C; POS ++;) Return (POS);) ... uint16_t fill_tcp_data (uint8_t * buf, uint16_t pos, const char * s) (Return (Fill_TCP_DATA_LEN (BUF, POS , (uint8_t *) s, strlen (s)));)

Collected specimens:

Demonstration of work:

The microcontroller firmware provides a change of an IP address (by default 192.168.1.99) and the javascript domain. So, the transition to the address: 192.168.1.99/?i\u003d91 Change the device address to 192.168.1.91 after rebooting (use very neatly and only when acute need is not to lose the device !!! :)). The script domain changes like this: 192.168.1.99/?d\u003dmydomain.com. . Your script will be booked from the address: myDomain.com/eth/script.js.. Please note that the ETH directory should lie on the server.

Open Script.js and change the descriptions of ports to your needs:

VAR NAME \u003d "Port management:"; // Title // below the name of the ports (you can replace something meaningful) var title \u003d ["PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", " PA7 "," PC0 "," PC1 "," PC2 "," PC3 "," PC4 "," PC5 "," PC6 "," PC7 "," PD4 "," PD5 "," PD6 "," PD7 " ];

For example, I have this:

Var name \u003d "" Raduga ", 75 degrees"; // Title // below the names of the ports (you can replace something meaningful) var title \u003d ["Russian Illusion", "24 Techno", "Manor", "Healthy TV", "Retro", "Drive", "Phoenix + Cinema, "Children's", "Hunting and Fishing", "Europa Plus", "Sony Entertaiment", "Sony Sci-Fi", "Multimania", "National Geographic", "NST", "Not Used", " Not used "," not used "," not used "," www server "];

For the power supply, you can use a mobile phone charger (output voltage of about 7 volts). In idle mode of consumption current about 120 mA. When you turn on one relay, the consumption current increases to 180 mA. It must be borne in mind that if it is necessary to activate all relays at the same time (disable all receiver), then the power supply must already be the appropriate power (at least 1.5 A).

The submitted article is just a device demonstration. In the commercial version, the direction of this development is significantly expanded - ports up to 150 pieces, three temperature sensors, etc., it all depends on the order. (Another example of 40 ports :)

Constructively, the device can be placed in the housing of any duration of the switch in the telecommunications resistant 19 ". Since such a switch did not turn out at hand, I ordered such a bundle from the fiber optic input system in the "mobile service" (worth 290 thousand no VAT):

Often the situation occurs when an Ethernet network is laid in a room or even a building and a desire arises with it to send a simple command from one room to another. For example, from the Wahter room by clicking on the open door button in the backyard. Now it is possible to do this without using computers and servers, without writing additional programs, etc. It is enough to connect the command and executive modules Laurent to the network, serve me and make small settings. After that, the modules can communicate directly.

This article discusses the M2M technology (module-to-module) on the example of communication settings between Laurent-2 and KBX-3D.

M2M technology allows modules to communicate with each other text data, for example, KE control commands without the participation of an external server, i.e. offline. For example, you can automatically mode when a certain event occurs, send the control command to another module located on the same network. In this case, external servers or programs are not needed - everything can be done using the CAT + M2M bundle in the module itself.

For example, let's consider this task:

Two modules are connected to the local network: Laurent-2 and KBX-3D. It is necessary that when the 1st input line of the Laurent-2 module, the relay of the KBX-3D module has been pretended. Important is the condition for the absence of an external server. Everyone must perform the module themselves without the "external" help.

Just in case, at the beginning, we consider the procedure for connecting several modules to one network. The subtlety is that all modules by default have the same IP and MAC addresses. For normal operation of network devices, these parameters must be different from devices on the network. Therefore, for our example, let's change the network details of the Laurent-2 module, and the KBX-3D settings will be left unchanged.

We go to the Laurent-2 Web interface (default address: 192.168.0.101). We go into the settings section and change the IP and MAC addresses. Set IP 192.168.0.102 and Mac 0.4.163.0.0.12.

In order to change the module, you should reset the module, for example, through reset power. After that, the module will be available at a new address and will not conflict Mac addresses with the KBX-3D module, the settings of which we left unchanged.

Create a CAT event on the Laurent-2 module. If there is a voltage level on the input line in_1 (for example, the line will be closed by + 5V from the button or any contact sensor) - then as a reaction to this event will be sent to the control command to the IP address of the KBX-3D module.

In the command row, two are immediately indicated - the command to enter the password access to the KBX-3D module ($ KE, PSW, SET) and actually, the command to control the relay ($ Ke, REL). At the end of each command, there must be a symbol ';' - when sending it will be replaced with the carriage return symbols and transition to a new string (CR + LF).

The password command is transmitted because by default, the security system is enabled in the modules, which blocks the execution of the module resource management commands until the access password is entered.

If you disable the security system on the KBX-3D module, then the need to send the first command with the password will not be.

On the Laurent-2 module, it is recommended to enable the contact feeder of the recreation of contacts. If this is not done, then when using a mechanical key or a button connected to the input line, when you press instead of one event, several dozen are formed at once due to the "rat" of the operation of the mechanical connection. Accordingly, an attempt will be made to send tens of times a list of commands for execution, which is not always acceptable.

Now everything is ready. It is enough to submit to the in_1 in_1 input line from the button (high level), the CAT system will work, the KBX-3D module will be sent a set of specified commands and the first KBX-3D module relay will be enabled.

For the convenience of connecting the button to the input line, it is recommended to connect the GND and ISO_GND lines. The fact is that the input lines of the modules are optoisolated. For buttons in this particular need there is no and can be supplied to the input line from the board itself (for example, from the +5 V terminal). For this, the land of the input line and the power supply of the board must be common. What is achieved by connecting GND and ISO_GND.

An example is simple, but opens up wide opportunities for managing your equipment.