Has anyone successfully used the the keyestudio 8266 module?

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:

}

Links to the correct board will help. Your link for the schematic is useless. No clue as to what the purple blobs are. More information is needed.

i would blame firefox for that i guess or maybe it's because i am a new user.

here is the link for all the info on the model of the module: https://wiki.keyestudio.com/KS0339_Keyestudio_8266_WIFI_Module_2PCS

image

Look for generic information about that module such as ESP8266 ESP-01

What is presented in your schematic?
Are you trying to upload the code for esp8266 mcu to the Arduino Uno?

More like trying to upload the code to the module through the uno here is a pic hopefully it works this time

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.

1 Like

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

In that case you need a special code in the Uno to transfer esp firmware from the USB Serial port to the pins 2 &3

In reality, with this code you don't need a Uno at all. The code you shown is for single use of ESP8266, without the Uno.

Any sources or code example on how to transfer my current code to the module as firmware?

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)

Ok changed the setup but the ide still returns waiting for packet header error

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.

Pencil & paper is fine; eg,

Please read: 'How to get the best out of this forum' - which includes ' Schematics or circuit diagrams'

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

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.