Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By thinkingste
#47497 Is this example worked for you? Mine is outputing: fatal error: memory: No such file or directory.
I cannot find memory.h in my mac's arduino include library. Should I copy one from my mac include directory?

bbx10node wrote:I suggest starting with an example such as WiFiClientBasic which just requires adding in your SSID and password. The source is included below but it is available via the Arduino IDE. See File | Examples | ESP8266* for more examples.

Code: Select all/*
 *  This sketch sends a message to a TCP server
 *
 */

#include <ESP8266WiFi.h>
#include <ESP8266WiFiMulti.h>

ESP8266WiFiMulti WiFiMulti;

void setup() {
    Serial.begin(115200);
    delay(10);

    // We start by connecting to a WiFi network
    WiFiMulti.addAP("SSID", "passpasspass");

    Serial.println();
    Serial.println();
    Serial.print("Wait for WiFi... ");

    while(WiFiMulti.run() != WL_CONNECTED) {
        Serial.print(".");
        delay(500);
    }

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

    delay(500);
}


void loop() {
    const uint16_t port = 80;
    const char * host = "192.168.1.1"; // ip or dns

   
   
    Serial.print("connecting to ");
    Serial.println(host);

    // Use WiFiClient class to create TCP connections
    WiFiClient client;

    if (!client.connect(host, port)) {
        Serial.println("connection failed");
        Serial.println("wait 5 sec...");
        delay(5000);
        return;
    }

    // This will send the request to the server
    client.print("Send this data to server");

    //read back one line from server
    String line = client.readStringUntil('\r');
    client.println(line);

    Serial.println("closing connection");
    client.stop();
   
    Serial.println("wait 5 sec...");
    delay(5000);
}
User avatar
By bbx10node
#47524 The code compiles and works fine with Arduino IDE 1.6.8 and ESP8266 board package 2.2.0. Have you tried the installation instructions?

http://esp8266.github.io/Arduino/versio ... lling.html

If it still does not work, try removing the ESP8266 board package then add it back. And be sure to set the board type back to one of the ESP8266 board types that match your hardware.
User avatar
By thinkingste
#47545 Hi BBX10Node,

Thanks for your reply. I have tried the installation process using both board manager and git version.
FYI, I'm trying to use Arduino Uno and ESP1 as the Uno module.
I can see some ESP8266 modules in the tools > board menu after the installation process finished.
The next step that I took is to copy ESP8266WiFi directory from <arduino dir>/hardware/esp8266com/esp8266/libraries into <arduino dir>/libraries.
But when I verify the WiFiClientBasic example, i got this error message:

Arduino: 1.6.9 (Mac OS X), Board: "Arduino/Genuino Uno"

In file included from /Users/Ste-Mac/Documents/Arduino/libraries/ESP8266WiFi/src/ESP8266WiFi.h:33:0,
from /Users/Ste-Mac/Documents/Arduino/sample_programs/WiFiClientBasic/WiFiClientBasic.ino:6:
/Users/Ste-Mac/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.


Is there any additional libraries that needed for this example?