ESP8266 Server: Communication between 3 ESPs
Posted:
Mon Oct 14, 2019 1:44 pm
by pranavmittal611
Hi guys.
Project details:My projects involves 3 ESPs.
First one is AP (Host). On certain actions (which can be anything like pressing button or voice command), I change the value of a variable. I post this value on a webpage. (
http://192.168.4.1)
I want the other two ESPs (Clients) to connect to this AP and read the value of variable. Based on the value, I want to set their certain pins high or low.
What I need help with: I know how to set up AP and how to connect other ESPs to it.
But how do I make the two clients read the value of the variable from the host AP ESP? Either directly or via a web page.
I also want the host to host another web page (or maybe on the same page from where clients will read value) where I can directly change value of variable after connecting to AP via phone or laptop.
Re: ESP8266 Server: Communication between 3 ESPs
Posted:
Tue Jan 14, 2020 3:13 am
by anshumantech
I have been using two ESP's, one configured as an access point and the other configured as a client connected to the access point formerly created. I am able to send the data successfully but not receiving it on the client side. I have used direct AT commands; from respective PCs without intervening microcontroller; for configuration and sending data. Following are the AT commands I sent in order mentioned at the access point:
AT+CWMODE=2
AT+CIPMUX=1
AT+CIPSERVER=1,2222
AT+CIPSTART=<id>,"UDP","ID of client",2222
AT+CIPSEND=<id>,no: of bytes
Every command gets executed properly as I receive "OK" and no errors and finally get a '>' prompt to type in my data (Using RealTerm software). After I give the data, I get the "SEND OK" reply! So, that's working fine!
On the client side, before I send data from AP, I connect it to the AP and get an IP. Following are the commands I execute in sequence:
AT+CWMODE=1
AT+CIPMUX=1
AT+CWJAP="ssid","password"
AT+CIFSR //to check IP
Both are executing the "AT+PING" command well! Why am I then not getting the sent data on the client side? It should basically start with the "+IPD" string right? I use two ESP's with versions: 0.25.0.0 and 1.3.0.0! I hope that it is not a problem as both support the above used AT command set. And using same AT commands, I added my mobile as another client and I am able to send messages back and forth between two clients, here one ESP and Mobile both are connected to another ESP working as AP. And in mobile I used TCP client App to send and receive messages.
Re: ESP8266 Server: Communication between 3 ESPs
Posted:
Wed Jan 15, 2020 4:04 pm
by btidey
Assuming an Arduino set up then easiest is to use the ESP8266HTTPClient library as the client. This makes it easy to make the url request and retrieve the response.
Check out the BasicHttpClient example in that library. The code in the loop is making a basic GET request and then retrieving the response. You can then simply parse the response and extract the values stored on the webpage.
Re: ESP8266 Server: Communication between 3 ESPs
Posted:
Mon Feb 03, 2020 6:19 am
by anshumantech
In given situation I am constrained to use AT command to communicate in Wifi mode between two ESPs connected tp PCs, with all necessary converting circuits in place. Already such ESP setup talk to mobile easily through AT command. Right now I don't want to use any library of Arduino only wanted to Communicate two ESPs using AT command only.