1

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:
}
Nick Gammon
38.9k13 gold badges69 silver badges125 bronze badges
asked Aug 19, 2020 at 14:25
7
  • 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. Commented Aug 19, 2020 at 15:02
  • 1
    you have a reset loop Commented Aug 19, 2020 at 15:05
  • 1
    What do you mean @Juraj? Commented 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 3 Commented Aug 19, 2020 at 15:19
  • 1
    You 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? Commented Aug 20, 2020 at 23:09

1 Answer 1

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.

answered Aug 22, 2020 at 2:00

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.