Search code examples
sendesp8266arduino-esp8266

Send data from one Wemos to another


I have 2 Wemos d1(retired) boards. I just simply need to send some data or a letter from one to the other. I searched the web deeply and found some complicated NodeMCU stuff and so on. Even though I could send data when I flashed NodeMCU to my Wemos, it was useless because my project is about arduino. I need to work with Arduino IDE. There is also a way to create a WebServer on one of the wemos and then deal with html files. But isn't it so complicated for just sending a couple of bytes? I don't need any webserver or html page. So please help me.


Solution

  • So, just use basic TCP socket communication. Assign one of them as a server. Here are libraries to use for arduino :

    https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266WiFi/src/WiFiServer.cpp https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266WiFi/src/WiFiClient.cpp

    Here is a WiFiClient example :

    https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266WiFi/examples/WiFiClientBasic/WiFiClientBasic.ino

    Here is a WiFiServer example :

    how create TCP server by ESP8266?