Arduino Stack Exchange is a question and answer site for developers of open-source hardware and software that is compatible with Arduino. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This is my arduino code for interfacing with an ESP8266:

#include <ESP8266WiFi.h>

int incomingByte;
String value;
char a;
int flag=0;
String valueserial;
int valueint;

const char* ssid     = "NIDHI";
const char* password = "nidhi123";

String data;

void setup() {
  Serial.begin(9600);
  delay(6000);
  data = "";
  valueserial = "";

//
  Serial.println();
  Serial.println();
  Serial.print("Connecting to ");
  Serial.println(ssid);
 //
  WiFi.begin(ssid, password);

  while (WiFi.status() != WL_CONNECTED) {
    delay(500);

    Serial.print(".");

  }
  //
  Serial.println("");
  Serial.println("WiFi connected");  
  Serial.println("IP address: ");
  Serial.println(WiFi.localIP());
//
}


void loop() {
  flag = 0;
  delay(5000);
  valueserial = "";
  // Use WiFiClient class to create TCP connections
  WiFiClient client;
String url = "/display.php";

if (Serial.available() > 0){
    while (Serial.available() > 0) {
                // read the incoming byte:
                incomingByte = Serial.read();
                valueserial += char(incomingByte);
              }
    if (incomingByte == '\n') {
      Serial.print("Value:");
      Serial.println(valueserial.toInt());
      Serial.print("String: ");
      Serial.println(valueserial);
      // clear the string for new input:
    }
    //valueint = Serial.parseInt();
    data = "?value=" + String(valueserial.toInt());

    url += data;
    delay(100);
    flag = 1;
}

if (client.connect("www.soil.pixub.com",80) && flag==1) { // REPLACE WITH YOUR SERVER ADDRESS
    client.print(String("GET ") + url + " HTTP/1.1\r\n" +
    "Host: soil.pixub.com\r\n" + 
    "Connection: close\r\n\r\n");
    Serial.println("!!!!DATA POSTED!!!!");
   } 

       //valueserial += '\0';
  //valueserial = Serial.read();
//  
Serial.println(data); 
//
  if (client.connected()) { 
    client.stop();  // DISCONNECT FROM THE SERVER
  }
//  
  Serial.println();
  Serial.println("closing connection");
//
}

And i am getting the following errors

Arduino: 1.6.12 (Windows 10), Board: "Arduino/Genuino Uno"

In file included from C:\Users\Akshay\Documents\Arduino\libraries\ESP8266WiFi\src/ESP8266WiFi.h:33:0,

                 from C:\Users\Akshay\Downloads\esp8266code\esp8266code.ino:3:

C:\Users\Akshay\Documents\Arduino\libraries\ESP8266WiFi\src/ESP8266WiFiType.h:26:19: fatal error: queue.h: No such file or directory

 #include <queue.h>

                   ^

compilation terminated.

exit status 1
Error compiling for board Arduino/Genuino Uno.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
share|improve this question
1  
Please make your post as readable as possible. From what I can read the compiler is telling you there is a header file or library missing. – Mikael Patel Oct 19 '16 at 10:52
    
A comment about personal security. When copying and pasting from a computer, consider scrubbing the information to remove any personal names. – st2000 Oct 19 '16 at 12:45

The ESP8266WiFi library is meant to be used when programming an ESP8266 using the Arduino environment. In Arduino lingo: It's supposed to be used with a ESP8266 Board.

It's -not- meant to be used with a 'Arduino/Genuino Uno' board, which is what you are trying to do. This is why it fails.

What you want to use is the ESP8266wifi library, which is used with a ESP8266 connected to a Arduino, and flashed with AT firmware.

And yes, it's confusing, there are two very similar libraries:

share|improve this answer

The file queue.h is either missing or is not in the expected location (correctly installed). Make sure you have your SDK and Libraries correctly installed and up-to-date. In an extreme case, you might consider reinstalling both to make sure the build environment is correct.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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