ESP8266: the selected serial port does not exist or your board is not connected

Hello everyone,

I am having issues uploading code to the ESP8266. I have seen crazy amount of support for the ESP8266 NodeMCU but zero support for the this ESP8266 (see picture).
I have a ESP8266 USB adaptor like this one and has a little switch to move from uart to programming mode. The issue I have is that when I try to upload the simple blink example provided by the ESP8266 library I get this message:

"the selected serial port does not exist or your board is not connected"

It reaches all the way to "connecting......._" and after that it displays the error above.

Any thoughts?

Thanks :slight_smile:

EDIT: the error also spits "Timed out waiting for packet header"

Hi @jjfrank,

I also had that problem. Is your Esp8266 connected to any board? Unplug ALL the wires besides for the ground wires and try again, this time it should work. Hope this helps you.

Hi @scooter_arduino613,

Thanks for the reply. No, I have it plugged into a USB adaptor. I took a picture - have a look!

Make sure you are selecting the correct COMM port on your computer or Raspberri pie

@hzrnbgy You can try it, but I think it is a different problem.

Yes, I tripled check and is connected to the right one

Then you just got to wait and hope that @UKHeliBob or someone else on Arduino will help me. Best of luck @jjfrank :slight_smile: .

1 Like

Try this. Put it in UART mode first, start the upload process, and switch over to PROG mode.

I tried it and no luck - it did not work. I set it to UART mode and then press upload, as soon as the process started I swap to PROG mode. I got the same error (the selected serial port...)

It should be in 'Prog-mode' (GPIO 0 pulled LOW) Make sure that the Serial port is not otherwise occupied, close things like putty etc (even the Serial monitor of the IDE, just in case) What are your other board settings ?

The instructions say that you might have to install drivers for the CH340g device. Also it says to unplug the adapter, then switch to program, then plug in again.
Hope this helps.

Is it a CH340G ?

Looks like on the picture in the link.

Board settings are default (i.e., I haven't touch anything)

Not sure. I bought it off Ebay. It definitely isn't from sparkfun.

I tried doing this but I got slight similar issue:

sptool.FatalError: Failed to connect to ESP8266: Timed out waiting for packet header

Are you using the ESP exclusively with the Raspberry Pi? Do you have access to a PC for a quick test?

(I will use /dev/ttyS1 as example, change that to the correct device name)
Set the USB adapter to PROG, plug the ESP on top, and plug the adapter to a USB port.
What is the result if you type something like this: -p /dev/ttyS1 chip_id

Alternatively, you can try opening a terminal to /dev/ttyS1 with baud rate set to 74880. I'm not familiar with the programs available on your Pi, so no specific command suggestion here.
Examine the pinout:

Then carefully short the pins GND and Reset using a piece of wire or fine tweezers. Don't hold, just a quick touch. You should get something similar to this in the terminal:

 ets Jan  8 2013,rst cause:2, boot mode:(1,6)

If you get that, then the communication is fine and you should look for an issue within the IDE.

If you can test on a Windows PC:
Get Termite. The link marked as (program only) is enough.
Plug the adapter to your PC. Install the CH340 driver if needed. Note the COM port assigned to it.
Start Termite. Click on the Settings button.
Change the Port setting to the correct COM.
Type 74880 in the Baud rate field.
Click OK.

Now quickly short the GND and Reset pins. You should get a response like in the example above.

And finally, tell us the results :stuck_out_tongue:

Thanks for the help @rainyshadow. I tried the above in my mac and this is what I got (not good news):

frank@frank ~ % -p /dev/tty.usbserial-110 chip_id v3.0
Serial port /dev/tty.usbserial-110

A fatal error occurred: Failed to connect to Espressif device: Timed out waiting for packet header

I got a pack of four ESP8266 and tried with the four of them. I wonder if the usb adapter is faulty?

You can easily check this.
Remove the ESP from the adapter, then plug one end of a wire into the TX pin and the other end in the RX pin (pins 2 and 7 according to the above picture).
Plug the adapter to your mac, open a terminal to /dev/tty.usbserial-110 and type something.
If each character you type is doubled, then the adapter should be working.

You can also try this command with the ESP attached (and without the wire :stuck_out_tongue: ):

screen /dev/tty.usbserial-110 74880

And quickly short the Reset and GND pins.

The driver for Mac, in case you don't have it installed - CH341SER_MAC.ZIP - Nanjing Qinheng Microelectronics Co., Ltd.
Or this - GitHub - adrianmihalko/ch340g-ch34g-ch34x-mac-os-x-driver: CH340G CH34G CH34X Mac OS X driver
Looking at the instructions on the second page, your device should be named like /dev/cu.wchusbserialXXX with the proper driver.

Other terminal programs listed here - Is there an OS X terminal program that can access serial ports? - Ask Different
No clue which ones support the custom baud rate 74880 though.