-1
#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>
#include <StreamString.h>
#include<PubSubClient.h>
const char* ssid = "Lenovo";
const char* password = "94725047";

void setup () {

  Serial.begin(115200);
  WiFi.begin(ssid, password);

  while (WiFi.status() != WL_CONNECTED) {

    delay(1000);
    Serial.println("Connecting..");

  }
 Serial.println(WiFi.localIP());
}

void loop() {

  if (WiFi.status() == WL_CONNECTED) { //Check WiFi connection status

    HTTPClient http;  //Declare an object of class HTTPClient

    http.begin("http://pulkitk1.000webhostapp.com/blink.bin");  //Specify request destination
    int httpCode = http.GET();                                                                  //Send the request

    if (httpCode > 0) { //Check the returning code

      WiFiClient * stream = http.getStreamPtr();   //Get the request response payload
      Serial.println(stream);                     //Print the response payload

    }

    http.end();   //Close connection

  }

  delay(30000);    //Send a request every 30 seconds

}

closed as unclear what you're asking by gre_gor, sempaiscuba, VE7JRO, SDsolar, jose can u c Jun 21 '18 at 20:15

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • What happens with Serial.println(*stream); ? – Dmitry Grigoryev Jun 21 '18 at 6:36
1

There is no method in the Serial object to print WiFiClient instance. WiFiClient class doesn't implement Printable like for example IPAddress class does. No other print or println method is suitable to print WiFiClient instance.

You must copy the bytes from stream to Serial.

edit: You pass a pointer to print and there are versions of print taking pointers but non of them matches exactly so the error messages is "is ambiguous".

Not the answer you're looking for? Browse other questions tagged or ask your own question.