Need help with WiFi ESP-13 from www.doit.am

Hello everybody,
I have a code with the Uno and Ethernet. I would like to exchange the Ethernet shield against an WiFi ESP-13 from www.doit.am.

https://fineshang.gitbooks.io/esp8266-based-serial-wifi-shield-for-arduino-user/content/

The WiFi ESP-13 connects itself through its own program, over my router, with my server.

On the server is a PHP-script, which I would like to read.

Unfortunately, I do not understand what I need to change my code for it to work.

I would be very happy about help. I can not get any further.

Enclosed by the Arduino / Ethernet code:

// *******************************************************************************************************
// Bibliotheken:
// *******************************************************************************************************
#include <SPI.h>
#include <Ethernet.h>
#include <LiquidCrystal.h>

// ******************************************************************************************************
// PIN-Belegung LCD Display:
// ******************************************************************************************************
LiquidCrystal lcd( 8, 9, 4, 5, 6, 7 );

// ******************************************************************************************************
// Netzwerkeinstellungen:
// ******************************************************************************************************
byte mac = {
0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x01
};
IPAddress ip(192, 168, 178, 70);
IPAddress myDns(1, 1, 1, 1);
EthernetClient client;

// *****************************************************************************************************
// Konstanten und Einstellungen:
// *****************************************************************************************************
const unsigned long requestInterval = 15000; // Verzoegerung zwischen den Anfragen
char server = “www.Testserver.de”;

unsigned long lastConnectionTime = 0; // Zeit seit letzter Verbindung mit dem Server (in Millisekunden)
const unsigned long postingInterval = 10L * 1000L; // Zeit zwischen den Uploads (in Millisekunden)
// das “L” ist erforderlich, um lange Typnummern zu verwenden

boolean requested; // Kontrolle, ob seit Verbindung ein entsprechenden Antrag gestellt wurde
unsigned long lastAttemptTime = 0; // Zeit in Millisekunden, seit der letzten Serververbindung

String currentLine = “”; // zu erwartende Zeichenfolge vom Server
String fbcount = “”;
boolean readingFbcount = false; // wenn das Ergebnis gelesen wird

// *****************************************************************************************************

void setup() {
currentLine.reserve(256);
fbcount.reserve(100);
Serial.begin(9600);
while (!Serial) {
;

}
delay(1000);

// *****************************************************************************************************
// Versuche eine DHCP-Verbindung zu oeffnen:
// *****************************************************************************************************
Serial.println(“Es wird versucht, eine IP-Adresse vom DHCP abzurufen:”);
lcd.begin(16, 2);
lcd.print(" IP Adresse");
lcd.setCursor(0,7);
lcd.print(" wird abgerufen");
if (!Ethernet.begin(mac)) {
Serial.println(“Es konnte keine IP-Adresse vom DHCP abgerufen werden, es wird versucht, mit der festen IP-Adresse eine Verbindung aufzubauen”);
Ethernet.begin(mac, ip, myDns);
Serial.print(“Meine IP-Adresse:”);
Serial.println(Ethernet.localIP());
lcd.begin(16, 2);
lcd.print(“IP Adresse:”);
lcd.setCursor(0,7);
lcd.print(Ethernet.localIP());
}
}

// *****************************************************************************************************
// Datenauswertung
// *****************************************************************************************************

void loop()
{
if (client.connected()) {
if (client.available()) {
// Eingangs Bytes lesen:
char inChar = client.read();
Serial.write(inChar);

// *****************************************************************************************************

// fuege eingehende Byte an das Zeilenende an:
currentLine += inChar;

// wenn eine neue Zeile beginnt, deaktivieren die aktive Zeile:
if (inChar == ‘\n’) {
currentLine = “”;
}

if ( currentLine.endsWith("{“fan_count”:")) {

readingFbcount = true; // true
fbcount = “”;
}

if (readingFbcount) {
if (inChar != ‘,’) {
fbcount += inChar;
}
else {
readingFbcount = false;
Serial.println(fbcount);
lcd.begin(16, 2);
lcd.print(" Temperatur");
lcd.setCursor(0,7);
lcd.print(" Grad" + fbcount);

// Schliesst die Verbindung zum Server:
client.stop();
}
}
}
}

else if (millis() - lastConnectionTime > postingInterval) {
httpRequest();
}
}

// *****************************************************************************************************
// Datenabruf vom Server
// *****************************************************************************************************

void httpRequest() {
client.stop();

if (client.connect(server, 80)) {
Serial.println(“Verbindung zum Server…”);
client.println(“GET /Testordner/Testdatei.php HTTP/1.1”);
Serial.println(“Abruf der Informstion…”);
client.println(“Host: www.Testserver.de”);
client.println(“User-Agent: arduino-ethernet”);
client.println(“Connection: close”);
client.println();

lastConnectionTime = millis();
} else {
Serial.println(“Keine Verbindung zum Server”);
lcd.begin(16, 2);
lcd.print(“Keine Verbindung”);
lcd.setCursor(0,7);
lcd.print(“zum Server”);
}
}

// *****************************************************************************************************

On the server is a PHP-script, which I would like to read.

I think that you misspelled execute.

Unfortunately, I do not understand what I need to change my code for it to work.

Well, we don't know what the code you have actually does, or how that differs from what you want, so all we can recommend is some useless random changes. That isn't what you want, is it?

Hello PaulS, I think I have not expressed so happy. I would like to replace the code, the Ethernet shield by the ESP-13. The functions are to be preserved.

client.println(“GET /Testordner/Testdatei.php HTTP/1.1”);
Serial.println(“Abruf der Informstion…”);
client.println(“Host: www.Testserver.de”);
client.println(“User-Agent: arduino-ethernet”);

I assume this is the site that must be built differently to allow a query about the wifi ESP-13.

But I do not know how I can create a query on the ESP-13.

Hope to find help here.

Am grateful for any hint.