I'm making this project in which I use an arduino, esp-01 module to connect to the internet, and a 16x2 display to show the result of some requests i make over the net.
I've tested the module esp-01 , it works, i'm making requests and get answers back.
I've tested the display, it works, i can show messages.
The problem is that when i try to combine all 3,i upload my sketch but i'm getting something like
"reset code 3, boot mode (1, 7)", but if i disconnect the display, i can upload it(after resetting the esp01), and it works.
The display was tested using arduino uno board from arduino ide, and the esp with the esp generic module.
Any idea what is happening? and how could i fix an issue like this ?
You probably got a stack trace with that as well.
Install the ESP exception decoder to the Arduino IDE to decode what it says, at times there's useful information to be found there.
A "wdt reset" means the device is stuck - but it being stuck may be both the cause or the result of the error.
Reset cause 4 is a wdt reset. So something in your program is stuck.
Most likely there's an error in your ESP code - and it's almost certainly in the parts you didn't post.
Here is a test sketch for an ESP8266 and Uno to illustrate software serial between the 2 and display the data sent by the ESP to the Uno on a LCD. Tested and prints the data from ESP to LCD connected to Uno. Not perfect but should work for testing the hardware and as a basis for future code. NOTE: change the LCD constructor and software serial pins as necessary.
wvmarle:
Reset cause 4 is a wdt reset. So something in your program is stuck.
Most likely there's an error in your ESP code - and it's almost certainly in the parts you didn't post.
I removed my code, and only left this inside and it still doesn't work. Running on esp8266 generic board. It's the same error as above
Juraj:
you combined an Arduino sketch with an esp sketch?
Can't i do that ?
wvmarle:
You probably got a stack trace with that as well.
Install the ESP exception decoder to the Arduino IDE to decode what it says, at times there's useful information to be found there.
A "wdt reset" means the device is stuck - but it being stuck may be both the cause or the result of the error.
groundFungus:
Here is a test sketch for an ESP8266 and Uno to illustrate software serial between the 2 and display the data sent by the ESP to the Uno on a LCD. Tested and prints the data from ESP to LCD connected to Uno. Not perfect but should work for testing the hardware and as a basis for future code. NOTE: change the LCD constructor and software serial pins as necessary.
void loop()
{
static unsigned long timer = 0;
unsigned long interval = 1000;
static unsigned int index = 0;
if (millis() - timer >= interval)
{
timer = millis();
Serial.print("The index ");
Serial.println(index);
index++;
}
}
The circuit:

Tell me if i what i think is right.
So i take the esp code, i upload it while the esp is on, after that i disconnect the esp, i upload the code of the display on the arduino, then i connect the esp back ?
That is how I did it and that's what you will need to do unless you set up a software serial port on the ESP to talk to the Uno and upload via Serial. But does the ESP8266-01 have enough pins? I have an FTDI connected to the ESP. Vcc, ground, RX and TX of the FTDi to the ESP. Upload the code to the ESP. Disconnect the FTDI TX and RX. Use just the FTDI Vcc and ground to power the ESP. Connect the Uno software serial RX and TX to the TX and RX of the ESP with Uno TX through the voltage divider to ESP RX.
I removed my code, and only left this inside and it still doesn't work. Running on esp8266 generic board. It's the same error as above
Is that code (which again is a snippet - it misses not only essential includes and variable contrast is not declared) running on the Arduino or on the ESP8266? If the latter, what is that lcd code doing there? If on the Arduino, where's the offending code?
wvmarle:
Is that code (which again is a snippet - it misses not only essential includes and variable contrast is not declared) running on the Arduino or on the ESP8266? If the latter, what is that lcd code doing there? If on the Arduino, where's the offending code?
Please read the first posts of tis thread. Above i just completed what i said earlier. And about the esp and display, i thought the esp sends the data to the arduino, and the arduino will display it. I didn't think that the esp module it's something on it's own. But i understand now thanks to groundFungus. I guess.
I will try to do it that way , maybe I will succeed. I will come back with an answer in a couples of hours.
I read them all and that's where the confusion comes from.
You talk about a crashing ESP01, with the LCD connected to the Arduino. Now when we ask for the offending code you only provide partial code, claiming it runs on the ESP01 but it has LCD code in it, while you say the LCD is not connected to the ESP01 but to the Arduino!
Maybe the problem is indeed in the connections, hope you can get it work. But I also hope you understand the confusion you cause by posting contradicting information (and of course incomplete code is useless), and that this wastes our time.