-->
Page 1 of 2

Fast communication between two ESPs

PostPosted: Sat Jul 02, 2016 1:01 pm
by vanjo9800
Hello,
I am trying to make two ESP8266 communicate in a network hosted on one of them. I need the one that does not host the network to send around 300bits of information each second to the second ESP8266. I found three major ways to do this, but each of them has its own problem.
1) UDP - almost works, but some requests are omitted
2) TCP - completely does not work (works only for the first three to ten requests and then the server says that there is no client
3) HTTP requests - works, but not fast enough

Am I doing something wrong and are there other alternatives for this communication?

Thank you in advance!!!

Re: Fast communication between two ESPs

PostPosted: Sat Jul 02, 2016 2:14 pm
by awinterstale33
Hi, have you looked at ESP-NOW? I've been working on it today trying to get two ESP8266-12F's to talk to each other. It seems like a more direct, peer-to-peer kind of set up. I came across it in this book, Kolban's Book on the ESP8266 and ESP32, by Neil Kolban, which is actually extremely useful.

Its free($0 - $10) but requires an account here: https://leanpub.com/ESP8266_ESP32
I ended up going back and paying $10 for it because it was so helpful. ESP-NOW is on pg. 118

I just noticed that the max bytes is 256 though. Might not work for you.

Re: Fast communication between two ESPs

PostPosted: Sun Jul 03, 2016 6:52 am
by vanjo9800
Thank you awinterstale33!!!

ESP-NOW seems as a very good solution to the problem. It is secure and developed for ESP8266 in particular. I will give it a try.

However, it seems that I cannot manage to run it with Arduino IDE because it does not recognize the espnow library.

This code: https://github.com/cho45/esp8266-esp-no ... c/main.cpp

Gives the following errors: undefined reference to `esp_now_init' and so on about all other elements from espnow.h.

Do you know how I can fix that?

Re: Fast communication between two ESPs

PostPosted: Sun Jul 03, 2016 7:46 am
by vanjo9800
Found the answer here: viewtopic.php?f=28&t=7713.