SparkFun Forums 

Where electronics enthusiasts find answers.

All things pertaining to wireless and RF links
By shivgatech
I'm using this library ... no_Library alongside a ESP8266 and Teensy. I'd like to make simple HTTP GET requests and print the plain text response to the serial monitor.

Below is the code I have so far. I've confirmed from my server's end that the request is coming through over the web. However, all I get in response from is '13'. You can see a sample of the actual server response at

Any ideas?
Code: Select all
#include <SoftwareSerial.h>
#include <SparkFunESP8266WiFi.h>

const char mySSID[] = "testnetwork";
const char myPSK[] = "password";

String server = "";
String httpHeader = "GET /plain HTTP/1.1\r\nHost:\r\nConnection: close\r\n\r\n";

void setup() 
  int status;
  status = esp8266.begin();
  if (status <= 0)
    Serial.println(F("Unable to communicate with shield. Looping"));
    while(1) ;
  esp8266.setMode(ESP8266_MODE_STA); // Set WiFi mode to station
  if (esp8266.status() <= 0) // If we're not already connected
    if (esp8266.connect(mySSID, myPSK) < 0)
      Serial.println(F("Error connecting"));
      while (1) ;
  Serial.print(F("Station IP address: "));
  Serial.println(F("Press any key to make a request..."));

void loop()
  if (Serial.available())
    while (Serial.available());

void httpGet()
  ESP8266Client client;  
  if (client.connect(server, 80) <= 0)
    Serial.println(F("Failed to connect to"));
  Serial.println(F("Making HTTP GET request to"));


  if (client.connected())