Post topics, source code that relate to the Arduino Platform

User avatar
By charlie
#14148
martinayotte wrote:First, you need to install pySerial library to get the above error fixed.
Second, yes, you need to change COM1 to something like /dev/ttyUSB0 or /dev/ttyUSB1 depending where your FTDI is connected.



Thanks for the tip about pySerial.

After installing python-serial, I get this connection issue.

Code: Select allroot@raspberrypi:/opt/esp/espduino# esp8266/tools/esptool.py -p /dev/ttyUSB0 write_flash 0x00000 esp8266/debug/0x00000.bin 0x40000 esp8266/debug/0x40000.bin
Connecting...
Traceback (most recent call last):
  File "esp8266/tools/esptool.py", line 383, in <module>
    esp.connect()
  File "esp8266/tools/esptool.py", line 151, in connect
    raise Exception('Failed to connect')
Exception: Failed to connect


Wondering if anyone experienced this.
User avatar
By Eric
#14185 I'm running into the exact same problem. When I execute the py script, I get this also:

Code: Select allConnecting...
Traceback (most recent call last):
  File "esp8266/tools/esptool.py", line 383, in <module>
    esp.connect()
  File "esp8266/tools/esptool.py", line 151, in connect
    raise Exception('Failed to connect')
Exception: Failed to connect


The FTDI is connected to a Raspberry Pi, on /dev/ttyUSB0.
User avatar
By abl
#14508 esptool.py will not necessarily put your chip in flash mode.

So what I'd do is fire up miniterm.py, which is part of PySerial, and aim it at your serial port at 77400 (yep, not a typo) baud.

When you reboot the esp8266, you'll see some debugging messages. The magic code here is "boot mode (1,7)" which means it booted cleanly and is ready to receive code over UART.

If you see a boot code like "(3,7)" that means you did not enter flash mode - you're in SPI boot, aka running whatever is currently flashed to the device. Check your GPIOs and try again.

Boot code "(5,7)" means SDIO boot mode, which nobody's using as far as I'm aware.

If the second number is not 7, you're not providing enough power on boot, or something else is going on. I can't find any documentation, but I know that chips booted in to "(1,6)" ignore flash commands.