Thanks @nishyanthkumar
but i m using Wifi instead of bluetooth ... Here is the sample blocks which i want to use please ignore the cross marks as this is just an example. What i want to do is there is a button on my app which is getTemp when i press that button it sends new client request to esp8266 and whatever output in the form of text i get on serial monitor of arduino should get updated on the text box (temp) located just above the button.
ill also provide sample arduino code here i have given constant temp example but it is a variable in my case and its changing
#include <ESP8266WiFi.h>
const char* ssid = "JioFi2_C4FFC1";
const char* password = "######";
WiFiServer server(80);
void setup() {
Serial.begin(38400);
Serial.print("Connecting to ");
Serial.println(ssid);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(100); //500
Serial.print(".");
}
Serial.println("");
Serial.println("Wifi Connected");
Serial.println("Server started ");
Serial.println(WiFi.localIP());
server.begin();
}
void loop() {
string temp=38*c
WiFiClient client = server.available();
if (!client){
return;
}
Serial.println("new client");
while(!client.available())
{
delay(1);
}
String req = client.readStringUntil('\r');
Serial.println(req);
if (req.indexOf("/getTemp")!=-1)
{
client.println(temp);
Serial.println(temp);
}
String web = "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n";
client.print(web);
client.flush();
}
