Adafruit Huzzah Upload Error 255 with FDTI cable on Linux

Hi, I couldn’t find an answer to my specific problem and I don’t know if the problem is with PlatformIO or not. If it is not, I am hoping someone could send me to the correct place to ask the question.

First, some details about the environment. I am using Arch Linux x64 with the udev rules installed, and my user is added to the group which has access to the serial port (I don’t know if this is important). I am using PlatformIO 3.1.0.

I tried uploading to the Adafruit HUZZAH which is a breakout board for the ESP8266. I bought a FDTI cable which works when connecting to its virual terminal either via picocom or screen. I can even program it via lua by issuing commands on the terminal, but I cannot get PlatformIO to upload a compiled program to the device. I tried the platform init command with the following board types: huzzah, nodemcu, and esp12e and the same problem occurs when the following command is run pio run -v -t upload:

[Thu Sep 22 20:51:00 2016] Processing huzzah (platform: espressif8266, board: huzzah, framework: arduino)
MethodWrapper(["upload"], [".pioenvs/huzzah/firmware.bin"])
Warning! Please install `99-platformio-udev.rules` and check that your board's PID and VID are listed in the rules.
https://raw.githubusercontent.com/platformio/platformio/develop/scripts/99-platformio-udev.rules
Auto-detected: /dev/ttyUSB0
esptool -vv -cd nodemcu -cb 115200 -cp "/dev/ttyUSB0" -cf .pioenvs/huzzah/firmware.bin
esptool v0.4.9 - (c) 2014 Ch. Klippel <ck@atelier-klippel.de>
setting board to nodemcu
setting baudrate from 115200 to 115200
setting port from /dev/ttyUSB0 to /dev/ttyUSB0
espcomm_upload_file
espcomm_upload_mem
opening port /dev/ttyUSB0 at 115200
tcgetattr
tcsetattr
serial open
opening bootloader
resetting board
trying to connect
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
serialport_receive_C0: 00 instead of C0
trying to connect
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
serialport_receive_C0: 00 instead of C0
trying to connect
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
serialport_receive_C0: 00 instead of C0
resetting board
trying to connect
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
serialport_receive_C0: 00 instead of C0
trying to connect
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
serialport_receive_C0: 00 instead of C0
trying to connect
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
serialport_receive_C0: 00 instead of C0
resetting board
trying to connect
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
serialport_receive_C0: 00 instead of C0
trying to connect
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
serialport_receive_C0: 00 instead of C0
trying to connect
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
serialport_receive_C0: 00 instead of C0
warning: espcomm_sync failed
error: espcomm_open failed
:*** [upload] Error 255
=============================================== [ERROR] Took 3.53 seconds ===============================================

If there is any more information I could provide to help in figuring out this problem, I would be glad to provide it.

Do you have the same problems with Arduino IDE?

I was actually unable to add the board support to Arduino IDE due to the Arch Arduino port being visually broken. I am still trying to see if I can get the Arduino IDE to work at all but I don’t have high hopes.

Just for experiment: try with sudo

sudo pio run pio run -v -t upload

Please DON’T USE SUDO next time.

I followed your command assuming you meant sudo pio run -v -t upload. The results were exactly the same except it reinstalled the libraries (I assume in some root directory this time).

Is this port correct?
What do you see with?

pio device list

Yes, the port is correct and is the same one I use when connecting via picocom. pio device list gives the following:

/dev/ttyUSB0
------------
Hardware ID: USB VID:PID=0403:6001 SER=A105C5AU LOCATION=3-1.2
Description: FT232R USB UART

I remember seeing that getting a high enough current to power the ESP8266 can be problematic. I was wondering if my FTDI cable was providing enough power via my laptop’s USB port (I tried all of them even USB 3 in case one had a higher current than another).

Do you think either of the last two bullet points in this FAQ are relevant to this situation? https://learn.adafruit.com/adafruit-huzzah-esp8266-breakout/faq

Do you have other PC/Mac? Would be good to test this board on another machine.

I am going to test it on a friend’s laptop this weekend. I also have a server which runs FreeBSD. Unfortunately not all of the packages downloaded with pio init supported FreeBSD so I would need to either compile a version for the machine or find a binary that supports it. I will update this thread this weekend with any results.

I found out that I needed to put the board into boatloader mode. I should’ve looked into the tutorials more. It works now.