I was looking for some easy tutorial on bidirectional communication via ESP8266 connected to Arduino UNO. I want to send and receive strings from and to JQuery based website.
However, I couldn't find any answers on this because most of them are about working directly with ESP. It's probably easy thing to setup but I'm totally new in working with network communication ;(
At this moment I know how to set AT for ESP as client and receive messages with pin number to toggle:
AT+RST
AT+CWMODE=1
AT+CIPMUX=1
AT+CWJAP="user","pswd"
AT+CIPSERVER=1,80
AT+CIPSTO=10
And JQuery for buttons (data is their ID) form one of tutorials:
$(".led").click(function(){
var p = $(this).attr('id');
$.get("http://192.168.1.14:80/", {pin:p});
});
Problem with this is whenever I send something the ESP gets the value and prints info but then it disconnects after 10 seconds (defined time) and when I hit the button again it reconnects and I can't do more (for example: send another value) during the time when it's connected.
Is it normal behavior? How to make it possible to send many messages when it's still connected to the port without waiting to reconnect? Can I make it in more "streaming" way? And how to make this bidirectional? Any advice on configuring the device will be helpful.