Page 1 of 2
2 esp12e's communicating between each other
Posted:
Wed Mar 09, 2016 8:00 pm
by nuesome
Can someone point me in the right direction for information on connecting 2 esp together via WiFi. What I am trying to accomplish is to have esp1 connected to a pir sensor and when sensor sees motion it will signal esp2 to flash led lights or something. I am lost when it comes to these modules. I do have a little bit of arduino tinkering under my belt. Thanks
Re: 2 esp12e's communicating between each other
Posted:
Mon Mar 14, 2016 7:09 am
by eduperez
Considering the amount of documentation available, I would say that the easiest approach is to configure one module as a web server and the other as a web client.
Re: 2 esp12e's communicating between each other
Posted:
Tue May 17, 2016 8:58 pm
by nuesome
OK, I did get this working somehow. I am running esp#1 as webserver using arduino wifiwebserver example. Then, on the other end, I am running esp#2 as a client with pir connected using a modified Wificlientbasic example. When the pir (on esp#2 senses motion, it sends /gpio/0 to esp#1 and turns on the built in led on the esp12e dev board. The problem is that it is a little slow I think because esp#2 keeps connecting and disconecting from the server. My question is, how can I keep client constantly connected to server or am i going about this in the wrong direction. Thanks in advance.
Re: 2 esp12e's communicating between each other
Posted:
Wed May 18, 2016 5:23 am
by eduperez
Two questions:
When you say "it is a little slow", how long does the whole process take? how fast you do need it to be?
When you say "esp#2 keeps connecting and disconnecting from the server", do you mean it is disconnecting from the web server at esp#1, or from the wireless access point?
Unless you have a power constraint on esp#2 (does it run on batteries?), you can program it to be always connected to the wireless access point, all depends on your sketch (perhaps you could post it here). If a simple HTTP request is too slow for you, perhaps you could try to use web sockets or UTP.