Chat freely about anything...

User avatar
By guidingstructures
#12458 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
User avatar
By guidingstructures
#12607
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.
User avatar
By Vitoa
#12613 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