I have bought an esp8266 to controll, throught an arduino, some relays from LAN...
I send data from pc -> data goes to the router -> esp8266 receive the data on his ip -> esp8266 sends the data to the arduino mega on serial1 -> arduino elaborates the data -> arduino, according to the elaborated data, controlls some relays.
my wiring schema:
[ Arduino mega ------- bidirectional level shifter 5v -> 3.3v ------------ESP8266 ]
Arduino Tx1 -------------------- HV1 -> LV1 ----------------------------------------- Rx
Arduino Rx1 --------- --------- HV2 -> LV2 ----------------------------------------- Tx
Then:
Arduino 3.3v is plugged on ESP vcc, ESP ch_pd and Level Shifter LV side
Arduino GND is plugged on ESP gnd and both LV and HV of the Level Shifter
Arduino 5v is plugged on the Level Shifter HV
So... everything was working well and my esp was answering to AT commands and automatically connecting to the router on startup.
But i had some problems with the realys so i had to remove the esp and work on them... when i re-plugged the esp it stopped working... On startup it doesn't automatically connect to the router and it doesn't answer to AT commands... Is it broken or something else, or i have a possibility to use it yet?
To check if it answers to AT commands i use this trivial sketch:
void setup(){
Serial.begin(9600);
Serial1.begin(115200);
}
void loop(){
if( Serial.available() ){
Serial1.write(Serial.read());
}
if( Serial1.available() ){
Serial.write(Serial1.read());
}
}
At the beggining, if i'm not wrong, when i was writing something on the serial monitor the blue led of the esp was blinking, while now it isn't.
The only way to get some text ( So i guess at least the esp tx and arduino rx are working) is to put the reset pin on gnd for a while, and then realease it, so that i get weird characters that with 4k and something of baurade they become the reset sentence. (On startup and on reset, the blue led blinks something like 2 times)
Someone can help me?
Thank you guys