Come on you guys, be nice. I understand giving someone a chance to figure the problem out on their own but there's such thing as going too far.
There's a simple bug in your sketch. First let's get clear on how things are working here. Serial is connected to the USB jack on the Arduino as well as the rx0 and tx0 pins(Arduino pins 0 and 1). This is the way you communicate with the Serial Monitor. Serial1 is connected to rx1 and tx1, this is how you communicate with the ESP8266.
This part of your sketch is ok:
vanarre:
if(Serial1.available()){
byte b = Serial1.read();
Serial.write(b);
}
You are reading from the ESP8266 and then writing what you read to the Serial Monitor, that's correct.
But you made a mistake here:
vanarre:
if(Serial.available()){
byte c = Serial.read();
Serial.write(c);
}
}
Here you are reading from Serial but then you are writing what you read right back to Serial. That's why:
vanarre:
in both cases if i write a command to the serial monitor it outputs back the same thing i wrote.
You need to change that part of your sketch to:
if(Serial.available()){
byte c = Serial.read();
Serial1.write(c);
}
Now you're reading from the input from the Serial Monitor and writing it to the ESP8266, connected on Serial1.
vanarre:
Serial1.begin(9600);
The default setting on the ESP8266 is 115200 baud. So unless you have configured it to run at 9600 you should change this to:
Serial1.begin(115200);
chucktodd:
Since it is expecting 0..5V and the ESP8266 a 3.3V device (0..3.3V) you need to amplify the EPS8266's TX output.
Are you sure? Many many people, including myself have used the 3.3v output from the ESP8266 to communicate with a 5V Arduino. I think you're making this way more complicated than it needs to be. Now the level shifter on the 5V output from the Arduino I do think is a good idea, though supposedly the CEO of Espressif has stated the ESP8266 is 5V tolerant:Teo Swee Ann but I'm not going to trust that until I hear it announced more formally.
chucktodd:
If the AtMega chip is installed in the board it is driving pin 1, and the ESP8266 would not be able to override it. You would not see any data back on the SerialMonitor screen.
The ESP8266 is connected to Serial1, not Serial:
vanarre:
arduino RX1 -> level converter -> ESP TX
arduino TX1 -> level converter -> ESP RX
Now here I do see an electrical issue:
vanarre:
arduino 3.3 -> ESP Vcc and ESP CH_PD
A standard Arduino 3.3V output can't provide the current necessary to reliably run an ESP8266. These things can take over 500mA so you need to provide a power supply that can handle that.