ESP8266 Arduino code from a commit earlier today that /was/ working now compiles fine but fails before usb serial upload with this 255 Error. Since it was working perhaps I have messed up the installation by installing esptool.py via pip or some other operation?
removing upload_flags = --auth=password1234 fixes the problem. Problem exists with dev release and stable.
I had not been testing the code with USB serial upload until now I realise. When I have the upload_flags auth set, USB upload no longer works until the upload_flags are removed from the ini.
pio run -e server_d1 -v -t uploadwith upload_flags specified:
Use manually specified: /dev/cu.wchusbserial1d20
esptool -vv -cd nodemcu -cb 230400 -cp "/dev/cu.wchusbserial1d20" --auth=password123 -cf .pioenvs/server_d1/firmware.bin
esptool v0.4.9 - (c) 2014 Ch. Klippel <ck@atelier-klippel.de>
setting board to nodemcu
setting baudrate from 115200 to 230400
setting port from /dev/tty.usbserial to /dev/cu.wchusbserial1d20
*** [upload] Error 255
Looks like it could maybe be as a result of me running sudo pip install esptool or it always happened before and I just didn’t test it with USB Serial upload until after I started specifying the OTA password in upload_flags.
pio run -e server_d1 -v -t uploadwithout upload_flags specified:
MethodWrapper(["upload"], [".pioenvs/server_d1/firmware.bin"])
Use manually specified: /dev/cu.wchusbserial1d20
esptool -vv -cd nodemcu -cb 230400 -cp "/dev/cu.wchusbserial1d20" -cf .pioenvs/server_d1/firmware.bin
esptool v0.4.9 - (c) 2014 Ch. Klippel <ck@atelier-klippel.de>
setting board to nodemcu
setting baudrate from 115200 to 230400
setting port from /dev/tty.usbserial to /dev/cu.wchusbserial1d20
espcomm_upload_file
espcomm_upload_mem
opening port /dev/cu.wchusbserial1d20 at 230400
tcgetattr
tcsetattr
serial open
opening bootloader
resetting board
trying to connect
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
trying to connect
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
espcomm_send_command: receiving 2 bytes of data
espcomm_send_command: receiving 2 bytes of data
espcomm_send_command: receiving 2 bytes of data
espcomm_send_command: receiving 2 bytes of data
espcomm_send_command: receiving 2 bytes of data
espcomm_send_command: receiving 2 bytes of data
espcomm_send_command: receiving 2 bytes of data
espcomm_send_command: receiving 2 bytes of data
Uploading 309008 bytes from .pioenvs/server_d1/firmware.bin to flash at 0x00000000
erasing flash
size: 04b710 address: 000000
first_sector_index: 0
total_sector_count: 76
head_sector_count: 16
adjusted_sector_count: 60
erase_size: 03c000
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
setting timeout 15000
setting timeout 100
espcomm_send_command: receiving 2 bytes of data
writing flash
................................................................................ [ 26% ]
................................................................................ [ 52% ]
................................................................................ [ 79% ]
.............................................................. [ 100% ]
starting app without reboot
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
espcomm_send_command: receiving 2 bytes of data
closing bootloader
No worries, glad I know what caused my head scratching. It’s a shame that you can alternate between USB and OTA easily via command line when OTA Auth isn’t used. Only for the functionality to break if OTA Auth is used.