-->
Page 1 of 2

Connecting 2 ESP8266 Together

PostPosted: Mon Mar 23, 2015 3:10 am
by guidingstructures
Hello All,

Is it possible to connect two ESP8266 chips together and start communicating with each other without being connected to the internet? I tried doing this and it keeps failing so I am not sure if it's supported or not?

On the Server ESP8266 I issued the commands:
AT+CIPMUX=1
AT+CIPSERVER=1,80
When I do
AT+CIFSR
I get 2 ip address:
the first is 192.168.4.1
the second one is 0.0.0.0 not sure if that's an issue.

On the client ESP8266 I issued the commands:
AT+CWLAP="ESP1 SSID", "ESP1 PWD" //connects successfully
AT+CWLAP? //I get an ip address
AT+CIPSTART=0,"TCP","192.168.4.1",80
but when I do the CIPSTART I get ERROR unlink.
Anyone know what the problem is? Has anyone tried to connect 2 esp8266 together and start communicating over tcp/ip
thanks.

On the client

Re: Connecting 2 ESP8266 Together

PostPosted: Tue Mar 24, 2015 2:40 pm
by LATEEF
unfortunately I have the same problem and i'm tired of it ..
so please give us a solution :cry:

Re: Connecting 2 ESP8266 Together

PostPosted: Wed Mar 25, 2015 9:54 am
by guidingstructures
LATEEF wrote:unfortunately I have the same problem and i'm tired of it ..
so please give us a solution :cry:


Hey LATEEF,

I actually managed to get it work after several days of configuration. I have my arduino acting as the server and my raspberry pi as the client. I successfully was able to communicate with each other through TCP/IP.

I used the following code as the client:
https://github.com/INEXTH/Arduino-ESP82 ... Client.ino

and the following code as the server:
https://github.com/INEXTH/Arduino-ESP82 ... Server.ino

I modified it to be used in my application my pi was running a Java Webs server, so I ported the C++ code to Java. But just look at the flow of it and it should work.

Re: Connecting 2 ESP8266 Together

PostPosted: Wed Mar 25, 2015 12:33 pm
by Vitoa
Hi, better to flash nodemcu firmware instead of using AT commands.
Simply set one module to AP mode and other to station, link them, than create some simple tcp server and client script for each module, here's example:

-- a tcp server
s=net.createServer(net.TCP,30)
s:on("receive",function(s,c) print(c) end)
s:listen(1234)

-- a tcp client
cu=net.createConnection(net.TCP)
cu:on("receive",function(cu,c) print(c) end)
cu:connect(1234,"192.168.1.1")
cu:send("hello")

Or better u can go for coap, a simple protocol to comunication between devices
Makes easier to exchange data between modules
https://github.com/nodemcu/nodemcu-firm ... and-server

Also some examples to see how easy is develop scripts on nodemcu frmware
https://github.com/nodemcu/nodemcu-firmware#start-play

Best regards,Vito