esphome / issues

Issue Tracker for ESPHome
https://esphome.io/
290 stars 34 forks source link

Wemos NodeMCU CH340 not working #3831

Open TheMangrove opened 1 year ago

TheMangrove commented 1 year ago

The problem

I'm trying to flash a Wemos 32M flash NodeMCU V3 340G ESP8266. It appears to flash ok, I get the "success" message, however afterwards there is no serial communication, and the device does not appear connected to WiFi.

This is the board I'm using.

I have tried the following:

Thanks for any help you can provide.

Which version of ESPHome has the issue?

2022.11.2 and 2022.11.3 (upgraded while troubleshooting)

What type of installation are you using?

Home Assistant Add-on

Which version of Home Assistant has the issue?

2022.11.4

What platform are you using?

ESP8266

Board

NodeMCU V3 340G (Wemos)

Component causing the issue

No component connected

Example YAML snippet

esphome:
  name: freezer

esp8266:
  board: nodemcuv2

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "redacted"

ota:
  password: "redacted"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Freezer Fallback Hotspot"
    password: "FuOoim0gni2d"

captive_portal:

Anything in the logs that might be useful for us?

I found something interesting from when it's flashed: nevermind. Some quick googling says that's normal and either way neither of those baud rates gives me an output if I try and read the serial data using IDE.

INFO Successfully compiled program. esptool.py v3.3.1 Serial port /dev/ttyUSB0 Connecting.... Chip is ESP8266EX Features: WiFi Crystal is 26MHz MAC: 30:83:98:92:a0:ea Uploading stub... Running stub... Stub running... Changing baud rate to 460800 Changed. Configuring flash size... Auto-detected Flash size: 4MB Flash will be erased from 0x00000000 to 0x00074fff... Compressed 479088 bytes to 337962... Wrote 479088 bytes (337962 compressed) at 0x00000000 in 9.7 seconds (effective 396.2 kbit/s)... Hash of data verified.

Leaving... Hard resetting via RTS pin... INFO Successfully uploaded program. INFO Starting log output from /dev/ttyUSB0 with baud rate 115200

Additional information

Is it possible that the extra 4MB (32Mbit) External Flash Memory is causing the issue?

Thanks for any help you can provide

EDIT:

Something new. If I use Putty and set the baud rate to 74880 I finally get readable text. The output after reset is as follows.

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

load 0x4010f000, len 3460, room 16
tail 4
chksum 0xef
load 0x00000000, len 0, room 4
tail 0
chksum 0xef
csum 0xef
csum err
ets_main.c

Apparently it has something to do with a 40MHz crystal instead of 26MHz. This is the thread I found which got me this far

https://forum.arduino.cc/t/another-serial-monitor-output-garbage-problem-esp8266-nodemcu-dev-board/500412

TheMangrove commented 1 year ago

So the solution is I had to use the NodeMCU flasher with the following settings:

Baud Rate: 460800 Flash Size: 4MByte Flash Speed: 26.7MHz SPI Mode: DOUT

I suspect the flash speed is the key element. I'm leaving this open since it's not technically solved, just a workaround found but this should be added as an option for NodeMCU boards.

TheMangrove commented 1 year ago

Link for NodeMCU Flasher:

https://github.com/nodemcu/nodemcu-flasher

HAelnino80 commented 1 year ago

So the solution is I had to use the NodeMCU flasher with the following settings:

Baud Rate: 460800 Flash Size: 4MByte Flash Speed: 26.7MHz SPI Mode: DOUT

I suspect the flash speed is the key element. I'm leaving this open since it's not technically solved, just a workaround found but this should be added as an option for NodeMCU boards.

Link for NodeMCU Flasher:

https://github.com/nodemcu/nodemcu-flasher

THANKS !!!!

I had the same issue, I was to put in the garbage :)