Go Down

Topic: Get request using AT commands ESP8266  (Read 103 times) previous topic - next topic

jefvdd

Jan 17, 2019, 04:53 pm Last Edit: Jan 17, 2019, 05:32 pm by jefvdd
I succesfully can upload data to thingspeak using my ESP8266 and AT commands. Now i want to read data from thingspeak.

This is the GET command using the Thingspeak API https://api.thingspeak.com/channels/677109/fields/3/last
(it's public)

this is my code snippet for trying the GET command to read the data.
Code: [Select]

String getRequest = "GET /channels/677109/fields/3/last";
sendCommand("AT+CIPSTART=4,\"TCP\",\""+ HOST +"\","+ PORT,15,"OK");   // this is working
esp8266.println("AT+CIPSEND=4,34");
    delay(1000);
     esp8266.println(getRequest);
     delay(1000);
 
  if (esp8266.available()) {
    Serial.write(esp8266.read());
  }


I always get "A" returned instad of the 0 or 1 I want it to return.
Does anyone know what i'm missing?


pylon

Did you really read the sticky post at the top of the topic? I'm missing the link to the used hardware (a standard ESP8266 cannot be accessed by AT commands, it's just an MCU with a Wifi interface, the firmware makes it a WiFi modem, kind of).

Also you should post complete code. In many (if not most) cases the error is in the part of the code not posted.

Quote
I always get "A" returned instad of the 0 or 1 I want it to return.
It might have echoing enabled and the first character you read is the "A" from "AT+CIPSTART".

Go Up