-->
Page 1 of 3

How do I use 2x Esp8266 modules to talk to each other?

PostPosted: Sat Feb 13, 2016 11:18 am
by Mai Mariarti
Hi guys,
I was wondering how I can use 2 of these modules to send a single command from one to the other using arduino IDE code.
I have built a hallway bank of LEDs, that turns on, using an IR detector. I would like to light-up another LED bank leading to the basement (30 feet away), that is triggered by the one in the hall way and vs.
In other words, either one of the two, is able to turn on the other.
I have spent one whole day getting the damn thing to work (defective USB cable which burnt the TX p[in on the ESP8266) and another whole day trying to program these to do a p2p connection with no luck.
BTW, I tried a 433 MHz transceiver and 2 pro minis but couldn't get more than 10 feet out of them. This is with 12v on the transmitter and 17.3 cm wire antenna. That was 2 days of wasted time.
Can anyone help me?
Thanks.
~Mai

Re: How do I use 2x Esp8266 modules to talk to each other?

PostPosted: Sat Feb 13, 2016 2:11 pm
by martinayotte
You will need to have one ESP as master in AP or STA+AP mode, and the other one must be in STA mode only, otherwise you will get IP address conflicts.

Re: How do I use 2x Esp8266 modules to talk to each other?

PostPosted: Sat Feb 13, 2016 2:17 pm
by Mai Mariarti
Thanks for the quick reply.
Why can't I use my router as the AP and use these in mode=2?
They get their IP address from the router.
I was hoping some one who has done this procedure to help me with code snippets.
Thanks

Re: How do I use 2x Esp8266 modules to talk to each other?

PostPosted: Sat Feb 13, 2016 3:12 pm
by martinayotte
Of course you can use your network AP.
I've maybe though that you wish the ESPs on their own network.
For code snippets, there so many ways to do what you want.
Do you wish it to be Web based with HTTP requests or simple TCP such as Telnet, or even both ?
I suggest that you take a look at WiFiClient and ESP8266WebServer examples as well as WiFiTelnetToSerial.