Answer the question
In order to leave comments, you need to log in
Why won't esp8266 connect to network?
There is a wifi shield for arduino (esp-12). Connected to a laptop via usb-uart, without the arduino itself.
I want to send a get request from it. The code I'm uploading:
#include <ESP8266WiFi.h>
const char* ssid = "xxx";
const char* password = "xxx";
const char* host = "xxx";
void setup()
{
Serial.begin(115200);
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);
delay(1000);
}
void loop()
{
WiFiClient client;
if (client.connect(host, 80)) {
client.print( "GET /index.php?r=test%2Fadd");
client.println( " HTTP/1.1");
client.print( "Host:" );
client.println(host);
client.println( "Connection: close" );
client.println();
client.println();
}
Serial.println("---");
delay(5000);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question