I have written a little program which should (at the end) host a little website. This is just my setup. But for some reason, it writes "srl?" endlessly onto the serial monitor. I just connected the ESP8266-01 to my Arduino UNO, using 115200 baud with the nodeMCU board. Using different boards results in an error telling me I should use nodeMCU.
As I have written in the title, I do not understand how it can produce an endless output without a loop with Serial.print/write
in it.
#include <ESP8266WiFi.h>
const char* NAME = "x"; //ssid
const char* PWRT = "x"; //password
WiFiServer server(80);
void setup() {
Serial.begin(115200);
Serial.printf("connect with %s \n", NAME);
WiFi.begin(NAME, PWRT);
while (WiFi.status() != WL_CONNECTED) {
delay(1000);
}
server.begin();
Serial.printf("webserver open, access with %s\n", WiFi.localIP().toString().c_str());
}
void loop() {
// put your main code here, to run repeatedly:
}
-
1"I just connected the ESP8266-01 to my Arduino UNO, using 115200 baud with the nodeMCU board". What NodeMCU board? The ESP8266-01 is not a NodeMCU. How did you connect everything up? If your Arduino uses SoftwareSerial to communicate with the ESP8266-01 at 115200 baud, that will not work reliably. Use 9600 baud.StarCat– StarCat2020年08月19日 15:02:15 +00:00Commented Aug 19, 2020 at 15:02
-
1you have a reset loopJuraj– Juraj ♦2020年08月19日 15:05:39 +00:00Commented Aug 19, 2020 at 15:05
-
1What do you mean @Juraj?Max– Max2020年08月19日 15:15:04 +00:00Commented Aug 19, 2020 at 15:15
-
@StarCat like this virtuino.com/images/arduino_esp8266_connections.png but to RX and TX instead of Pin 2 and 3Max– Max2020年08月19日 15:19:15 +00:00Commented Aug 19, 2020 at 15:19
-
1You need to show the actual output. "Word salad" could be anything. For example, are the words ""connect with" and "webserver open, access with" part of this salad?Nick Gammon– Nick Gammon ♦2020年08月20日 23:09:18 +00:00Commented Aug 20, 2020 at 23:09
1 Answer 1
The ESP8266WiFi.h
is for running on an ESP8266 host, but your are trying to use it on an Arduino Uno. This caused the crash of your sketch on Arduino Uno.
Based on the connection diagram you provided, you are using the ESP-01 as an wifi-shield and the ESP-01 by default is having an AT commands firmware. In order to use the ESP-01 as a wifi shield, you need an library like WiFiEspAT.