For more context i connected that module to my arduino elegoo uno R3 and i am trying to use the 8266.h library to connect to my wifi router for testing it actually does that.
Using the generic 8266 board, i just get this error: A fatal esptool.py error occurred: Failed to connect to ESP8266: Timed out waiting for packet header.
I googled everywhere but i have not encountered a solution or someone talking about this specific model.
I am also a total noob on wiring, since this is a project for my career that i was assigned to do (even tho i am a software programmer) but based on the schematics published by keyestudio.com, i setted it up like this:
this is my code which for all intents and purposes it should work:
#include <ESP8266WiFi.h>
const char* SSID = "1342 Masse WiFI";
const char* pswd = "sushi202022";
void setup() {
// put your setup code here, to run once:
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, LOW);
Serial.begin(115200); // Start the Serial communication to send messages to the computer
delay(250);
Serial.println("before\n");
WiFi.begin(SSID, pswd); // Connect to the network
Serial.print("Connecting to ");
Serial.print(SSID); Serial.println("111");
int i = 0;
while (WiFi.status() != WL_CONNECTED) { // Wait for the Wi-Fi to connect
delay(1000);
Serial.print(++i); Serial.print(' ');
}
Serial.println('\n');
Serial.println("Connection established!");
Serial.print("IP address:\t");
Serial.println(WiFi.localIP()); // Send the IP address of the ESP8266 to the computer
}
void loop() {
// put your main code here, to run repeatedly:
}
That circuit could damage the ESP-01. The signal from pin 3 of the Uno is 5V and the ESP is a 3.3V device. You should use a voltage divider to reduce the 5V signal down to 3.3V, such as 22K and a 10K resistor.
I guess that means Rx and tx will go to the breadboard altho I have no idea how to set it up with resistors. Actually no idea if they go to the positive or the negative either
It may be possible to use the Uno as a USB-serial adapter without any special code. You would need to short the RST and GND pins of the Uno together with a Dupont wire. This would hold the Uno's main chip in reset state. You could then use the TX & RX pins on the Uno to connect to the RX & TX pins on the ESP-01.
(You would still need that voltage divider. Google for how to set your resistors up as a voltage divider)
It's not connected correctly. I can't really get how everything is connected from your spaghetti wiring, you need to post a schematic. But I can see that nothing is connected to the point where your two resistors are connected together, so you have not understood how to wire a voltage divider yet.
again i am a software engieneer, so idk how to quickly draw one or make it correctly and i really don't have time since i need to do my part. but basically:
TX (orange) is connected to positive.
TX of module (green) is connected to negative.
22k resistor connected in column i of the breadboard and in column j i put a dupont wire comming from positive
On Column H i put the 10k resistor just beside the end of the first res, that is how the tutorial i watched set them up.
finally i put on column j the wire that connects to negative.
From what i understand what it should happen is:
UNO tx signal goes to breadboard as positive -> is transported to the resistors -> it exists to the module with 3.3v by the negative.
I had a link to a decent tutorial, but since then the same tutorial has been modified, and i do not support it anymore. (so now i'll end up typing out again, mind you there are still decent tuts out there probably
Basically if you have an Uno just like me and you want to upload a code to an ESP-01.
Upload an Empty sketch onto the Uno (or blink or something, nothing that uses the UART)
This will leave the USB to TTL converter to be used by us. If it a genuine UNO the USB to TTL should be a 16U2, but it may be a clone i guess. In that case the 3.3v regulator may or may not provide enough power to connect to WiFi but that is a different matter.
Connect as follows
UNO ESP
3.3v Vcc
3.3v CH_PD
3.3v RST
GND GND
TX TX (we are using the converter, not communicating with the 328P)
RX -> 1K -> RX ->1K -> 1K -> GND (this is the voltage divider, it belongs to the 3.3v device)
Now if you connect GPIO 0 to GND and reboot the ESP, it will go into upload-boot mode,
Now you can upload using the UNO as a USB to TTL converter.
The messages that the ESP sketch is producing should be visible in the serial monitor