I bought an Arduino Mega 2650 alongside a couple of ESP8266 chips hoping to make a wireless project take off.

Using the basic serial passthrough code

void setup() {

void loop() {
    if (Serial.available()) {      // If anything comes in Serial (USB),
       Serial1.write(Serial.read());   // read it and send it out Serial1 (pins 0 & 1)

    if (Serial1.available()) {     // If anything comes in Serial1 (pins 0 & 1)
       Serial.write(Serial1.read());   // read it and send it out Serial (USB)

updated to use a 115200 baud rate which it seems my version of the 8266 is programmed to use, I encounter this problem when trying to issue it commands:



Looking around I found that this could be caused by the chip not getting enough power. So I hooked it up to a small power breakout board breakout board with a small 12 power supply I used to have connected to something else. After doing that all it does is spit out question marks even when I dont send anything. Weird part is the TX pin on the arduino thats going crazy? As if I am sending it to myself without a prompt from the ESP board. This only happens when I'm connected to that breakout supply.


Other oddity: If I have all my wires except for VCC/CH_PD connected everything is fine, but the second I connect them to that power supply everything goes crazy and my TX pin starts flashing up a storm (can it be a voltage issue that also transfers to my Arduino board as well?)

  • set Both NL & CR line ending in one of the Serial Monitor comboboxes
    – Juraj
    Commented Aug 4, 2019 at 19:16
  • Many questions are open here: Are you sure the baud rate of the ESP8266 is 115200? Show us the code or firmware running on it please? Where are the voltage divider resistors to protect the ESP8266 receiving 5V from the Arduino Mega's UART TX line? What does is show when you read the ESP8266 serial to 74880, which is the baud rate of the first-stage bootloader? Commented Aug 4, 2019 at 19:23
  • You are also making the mistake of reading from serial at 115200 baud and sending it to the other at a much lower 9600 baud. When the ESP8266 will send a stream of data and you write it byte-wise to the 9600 serial, it takes too much time for writing it, and you will loose incoming data. You must set the serial you're outputting to at least as high or higher than its input. Commented Aug 4, 2019 at 19:25
  • 1
    Was using the wrong commands, please write an answer and I will mark it as correct :)
    – Xander May
    Commented Aug 5, 2019 at 20:24
  • 1
    But you didnt get marked as the answer for that one either, it would be good to have one marked as solved (and without -2 votes)
    – Xander May
    Commented Aug 6, 2019 at 13:38


Browse other questions tagged or ask your own question.