I am a beginner in the Arduino world, and I faced problem. I tried in many ways but to no avail !! I need a solution because it is for my graduate project
I have WiFi Module (esp8266-esp 01) I tried to connect it with Arduino Uno and I faced this error
I tried also to downgrade the version of the board but doesn't work.
about the last error, I have checked the ports and try other cables but the same problem..
this is my code to test the connection
#include <SPI.h>
#include <WiFi.h>
char ssid[] = "——"; // your network SSID (name)
char key[] = "— —"; // your network key
int keyIndex = 0; // your network key Index number
int status = WL_IDLE_STATUS; // the Wifi radio's status
void setup() {
//Initialize serial and wait for port to open:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}
// check for the presence of the shield:
if (WiFi.status() == WL_NO_SHIELD) {
Serial.println("WiFi shield not present");
// don't continue:
while (true);
}
// attempt to connect to Wifi network:
while ( status != WL_CONNECTED) {
Serial.print("Attempting to connect to WEP network, SSID: ");
Serial.println(ssid);
status = WiFi.begin(ssid, keyIndex, key);
// wait 10 seconds for connection:
delay(10000);
}
// once you are connected :
Serial.print("You're connected to the network");
}
void loop() {
// check the network status connection once every 10 seconds:
delay(10000);
Serial.println(WiFi.status());
}
I connected it like this:
Arduino Uno:
3.3V > Breadboard
Gnd > Gnd (esp)
Rx > Tx (esp)
Esp:
3V3 > Breadboard
EN > Breadboard
Gnd > Gnd (Arduino)
Tx > RX (Arduino)