-->
Page 1 of 2

Multiple Esp8266 wireless communication

PostPosted: Wed Jun 15, 2016 10:18 am
by cybergogo
Hi Everybody,

I'm a noob in electronics and i'm stuck right now.

Ok so, i've made a simple program via arduino IDE and used an Arduino Mega (until recently). The program reads PH from my green house water supply, displays it on a 20*4 lcd screen, and activate some 12v pumps via some relays if the PH isn't correct. Until here, everything is fine.

The thing is, i've tried the ESP8266 in order to make my setup wireless.
The target is to have one ESP in my house, connected to the LCD, receiving data and sending orders to the other ESP¨in my greenhouse (which is connected to the temp sensor and the relay board).

As I told you, I'm a noob... and I only have basic knowledge about code.
Is there someone that could help me or provide me an sample of code for the server side and another for the client side?
All I can find on the internet are tutorials that show how to display values on a webpage, but i can't figure out how the other ESP can retrieve it.
Same thing for the relay part, i can find code that allow me to turn on/off my relays via a webpage, but nothing on how i can turn it on/off from another ESP.

Sorry if everything isn't clear, i'm a beginner AND french...
Please helllllp :cry:

Re: Multiple Esp8266 wireless communication

PostPosted: Sat Jun 18, 2016 2:48 pm
by enronnorne
Hey mate, consider using UDP. Make the esp inside your house a UDP server, and the rest of the esp's can communicate with it, and you would also be able to communicate with it from your computer or an app through udp commands.

Look for UDP server examples, there are a few good ones on this site.

All the ESP's would connect to your wifi, then send a packet to your main UDP server, and the server could also send packets back that would control actions (check temp, turn on or off relay).

I have been working with UDP for a bit and there is much I'm still figuring out, but it is a good starting point.


Another option would be mqtt commands and a free mqtt server like Thingspeak. This would give you a visualization of your data as well. I don't have as much experience with that end, but it is pretty straight forward with a lot of documentation online for this approach.

Re: Multiple Esp8266 wireless communication

PostPosted: Sat Jun 18, 2016 5:28 pm
by Gutty
You need udp server in both uC, so you can send whatever you want from where you want to where you want.

Re: Multiple Esp8266 wireless communication

PostPosted: Mon Jun 20, 2016 11:14 pm
by donald_drake
Have a look at this greenhouse controller - not arduino or esp8266 but may give you some ideas. This uses 433MHz UHF modules.

http://www.mcselec.com/index.php?option ... &Itemid=57

Using s/w platform Blynk is another way making it very easy with a great display but unfortunately relies on a cloud server so is not useful for you but maybe of interest