WIFIO is a dual Arduino WIFI module (ESP8266+ATMEGA328P) FCC approve-able with transferable licence. Can use the 328P for I/O expansion also...

Moderator: igrr

User avatar
By dimbil
#88565 I am trying to send data from arduino-esp8266 to my webpage but I cannot make it
This is the code:

#include <Arduino.h>

#include <ESP8266WiFi.h>
#include <ESP8266WiFiMulti.h>
#include <ESP8266HTTPClient.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
//
ESP8266WiFiMulti WiFiMulti;
String myURL ="http://alfa8400.000webhostapp.com/index.php?";
//
String first = "alfa";
String second = "vita";
void setup()
{
Serial.begin(115200);
Serial.setDebugOutput(true);

Serial.println();
Serial.println();
Serial.println();

for (uint8_t t = 4; t > 0; t--)
{
Serial.printf("[SETUP] WAIT %d...", t);
Serial.flush();
delay(1000);
}

WiFi.mode(WIFI_STA);
WiFiMulti.addAP("user-name", "pwd ");
}
void loop()
{
// wait for WiFi connection
if ((WiFiMulti.run() == WL_CONNECTED))
{
WiFiClient client;

HTTPClient http;

Serial.print("[HTTP] begin...\n");
if (http.begin(client, myURL+"first="+first+"&second="+second))
{

Serial.print("[HTTP] GET...\n");
http.begin(myURL);
//
int httpCode = http.GET();

if (httpCode > 0)
{
Serial.printf("[HTTP] GET... code: %d", httpCode);

if (httpCode == HTTP_CODE_OK || httpCode == HTTP_CODE_MOVED_PERMANENTLY)
{
String payload = http.getString();
Serial.println(payload);
}
}
else
{
Serial.printf("[HTTP] GET... failed, error: %s", http.errorToString(httpCode).c_str());
}
http.end();
}
else
{
Serial.printf("[HTTP} Unable to connect");
}
}
delay(10000);
}

Is there someone to help me please?
User avatar
By AcmeUK
#88587
It is the same question but I haven't got any solution tomy problem yet

Yes you have!
You said you get this error message:-
It displays the following:
0f000, len 1384, room 16
tail 8
csum 0xef
csum err
ets-main.c

@Bonzo said:-
So that error is something in your code and not a problem connecting to the webserver

What have you done to isolate the problem in your code?