0 votes
in WeatherStationClassic by (150 points)

Using Arduino on iMac, board selected is Node MCU 1.0 (ESP-12E Module) and usbserial connects OK. Sketch compiles OK but upload fails with esptool errors. See red below.

Terminal output from a cold boot then a button reset, the output is garbage and ends with newline and the word "ready". If I change the terminal baud rate to 74880 and press reset then text is legible but ends in a newline and garbage - which I assume should read "ready" See blue text below.

   ets Jan  8 2013,rst cause:2, boot mode:(3,7)

load 0x40100000, len 2408, room 16 

tail 8

chksum 0xe5

load 0x3ffe8000, len 776, room 0 

tail 8

chksum 0x84

load 0x3ffe8310, len 632, room 0 

tail 8

chksum 0xd8

csum 0xd8

2nd boot version : 1.6

  SPI Speed      : 40MHz

  SPI Mode       : QIO

  SPI Flash Size & Map: 32Mbit(512KB+512KB)

jump to run user1 @ 1000

rf cal sector: 1017

rf[112] : 00

rf[113] : 00

rf[114] : 01

SDK ver: 2.0.0(5a875ba) compiled @ Aug  9 2016 15:12:27

phy ver: 1055, pp ver: 10.2

⸮ԪTWT

NB. The Arduino toolbar Tools>Upload speed = 115200 and there is no 74880 option.

The error output from a failed upload is below in red.

Executable segment sizes:

IROM   : 234644          - code in flash         (default or ICACHE_FLASH_ATTR) 

IRAM   : 27680   / 32768 - code in IRAM          (ICACHE_RAM_ATTR, ISRs...) 

DATA   : 1260  )         - initialized variables (global, static) in RAM/HEAP 

RODATA : 820   ) / 81920 - constants             (global, static) in RAM/HEAP 

BSS    : 25376 )         - zeroed variables      (global, static) in RAM/HEAP 

Using library Wire at version 1.0 in folder: /Users/nessmo/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/libraries/Wire 

/Users/nessmo/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/xtensa-lx106-elf-size -A /var/folders/2y/vqhy_8xj2qv_p94pzmjfw2hm0000gn/T/arduino_build_467013/I2C_Test.ino.elf

Sketch uses 264404 bytes (25%) of program storage space. Maximum is 1044464 bytes.

Global variables use 27456 bytes (33%) of dynamic memory, leaving 54464 bytes for local variables. Maximum is 81920 bytes.

esptool.py v2.8

Serial port /dev/cu.SLAB_USBtoUART

Connecting....

Chip is ESP8266EX

Features: WiFi

Crystal is 26MHz

MAC: 98:f4:ab:dc:cb:de

Uploading stub...

Traceback (most recent call last):

  File "/Users/nessmo/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/upload.py", line 65, in <module>

    esptool.main(cmdline)

  File "/Users/nessmo/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/esptool/esptool.py", line 2909, in main

    esp = esp.run_stub()

  File "/Users/nessmo/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/esptool/esptool.py", line 633, in run_stub

    self.mem_block(stub[field][from_offs:to_offs], seq)

  File "/Users/nessmo/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/esptool/esptool.py", line 538, in mem_block

    self.checksum(data))

  File "/Users/nessmo/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/esptool/esptool.py", line 369, in check_command

    val, data = self.command(op, data, chk, timeout=timeout)

  File "/Users/nessmo/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/esptool/esptool.py", line 347, in command

    p = self.read()

  File "/Users/nessmo/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/esptool/esptool.py", line 292, in read

    return next(self._slip_reader)

  File "/Users/nessmo/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/esptool/esptool.py", line 2045, in slip_reader

    raise FatalError("Timed out waiting for packet %s" % waiting_for)

esptool.FatalError: Timed out waiting for packet header

esptool.FatalError: Timed out waiting for packet header

Would appreciate some guidance as to what I am doing wrong?

BTW I am using parts ordered elsewhere whilst I wait for the kit I have ordered from you. 

by (150 points)
Fix was to connect NodeMCU board direct to iMAC USB port rather than through a USB Hub.

1 Answer

0 votes
by (19.9k points)
selected by
 
Best answer

"Timed out waiting for packet header" is not an uncommon issue with a plethora of root causes. In my experience it's usually a hardware issue (power supply, cold solder joints, bad flash chips) or a combination of driver + esptool version + OS. Examples: https://github.com/espressif/esptool/issues/120https://github.com/espressif/esptool/issues/407

To rule out some of the possible causes you can compile the sketch in the Arduino IDE, take note of the folder the .ino.elf files is reported in, navigate to that folder (e.g. Finder or terminal) and locate the .bin file. Then you download our standalone App Fairy flasher from https://github.com/ThingPulse/app-fairy and try to upload that binary outside the Arduino IDE.

As for the baud rates, 74880 is what the Espressif firmware bootloader uses. Hence, at that rate you can decipher its messages but see everything else as gibberish. The apps on top of the Espressif SDK (e.g. your Arduino sketch) talks at 115200. That's why you see the bootloader messages as gibberish at that rate. It's either or...

The upload speed is unrelated to that. You can go as high as your driver + OS combination allows. Unfortunately that's trial & error.

by (150 points)
That seems to work OK.  Here is the output of the binary upload using AppFairy (I assume the .h is a binary as I do not see any .bin files using finder or with terminal. I notice AppFairy uses esptool 2.6 which is what Arduino is also calling but with version 2.8. I also notice that there is an error flag in the Arduino error message prior to the line that mentions the esptool error and I wonder if this is the root cause of Ardiuno not playing nicely? The call is to upload.py
The error is this ....
"/Users/nessmo/Library/Arduino15/packages/esp8266/hardware/esp8266/2.6.3/tools/upload.py", line 65, in <module>
  esptool.main(cmdline)
See above in the first post for the error message continuation.

Welcome to ThingPulse Q&A, where you can ask questions and receive answers from other members of the community.

https://thingpulse.com

...