Answer the question
In order to leave comments, you need to log in
How to realize the interaction of two wifi modules esp8266 at a long distance?
Hello! I have a question. How can I link two esp8266 modules. I will give a simple example of how this system works.
We have two Wi-Fi modules, for example, one is located in one city, and the second module is in another. I have a task to control a servo through a variable resistor. Accordingly, the resistor (physical) and the servo are located in different cities and each is connected to a wi-fi module. Can this be done? How to create a connection between them? I know that you can manage this whole thing through your phone and through various Blynk applications and the like. But I need as I described above! Thank you!
Answer the question
In order to leave comments, you need to log in
Option one, if there is a white ip at the location of the servo, forward the port on the router to the controller control port. The reverse option is also acceptable, when the white ip is at the other end, you just have to perform a status poll.
The option is universal and expandable - both controllers are connected to the management vps. The resistor controller broadcasts control commands to the server, the servo controller waits for commands, for example through regular polls, long poll or http2 sse
1. Wi-Fi direct range of several hundred meters. if further, then use tyrnetik.
2. you write a firmware that accepts tyrnet packages and controls external devices via gpio.
3. you write applications on your phone that sends control packets to your esp.
plus a bunch of pitfalls.
Here the question is more about networks, not ESP. How can you manage one esp with another if they are connected to the same router or one is an access point and the other is its client? For example, send a get request to an ip address. But it is more difficult to do this via the Internet, since the ip address of the ESP is masked by the nat of the router, and the ip of the router is masked by the nat of the provider. If the provider allows, then he buys a white ip address (we get rid of the provider's nat, the router looks directly into the Internet) and set up port forwarding on the router. Then the second esp will send the same get request to the white ip of the router, the router will send the request to the first esp, and it will execute the command or respond. But if the provider does not give a white ip at any point (mobile ones usually do not), then you need a relay server on the Internet. This server when using blynk is the developer server, but I did not try to make a connection between two esp on it. If it doesn’t work with blynk, then either look for an alternative (for example, iocontrol, or look towards the MQTT protocol and a free borker on the Internet), or raise your own server and configure it from scratch.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question