Flashing a NodeMCU device

I have a NodeMCU device with WiFi. I’m not sure what firmware is installed, though I bought them recently. I’ve installed the current version of Hassio on my windows PC, added on the ESPHome addon, and I want to flash the device with ESPHome. I have a serial interface plugged into my USB port. I tried to use the ESPHome mini-app to flash the device, but OTA is the only method it seems to have. Of course, OTA won’t work – the device can’t log into WiFi without being set up to do so…

I need step-by-step instructions or a link to some. HELP!

Have you tried plugging the NodeMCU into your computer with a USB cable then use the flasher?

yes, same result
I think this has to do with the PC, not the device or the serial adapter. I need some driver or other and all I see is references to Linux or Mac…

You could try the tool from the ESPEasy github:

FlashESP8266.exe

I’m still having a hard time. I downloaded esphome-flasher as recommended in the FAQs. It runs on the PC. But the yaml file and compiled binaries are on the Hassio RPi. I’m stick again.

First, you need to get the firmware file to flash. For Hass.io add-on based installs you can use the COMPILE button (click the overflow icon with the three dots) and then press Download Binary.

Do you not see the Download Binary button?

yes, if you can’t get the flash to work from hassio machine then just copy the comiled binary over to the PC and flash it from there.

Hello my HA is running on a Raspberry Pi. If I create something new here in the ESPHome Addon and I would like to upload it to a new device, I proceed in this way. I enter the necessary data and compile the file. Then I connect a NodeMCU via USB cable and start the ESPHome addon completely new. After restarting the upload on the top right appears via USB and I can upload the file … As I said I have a Raspberry Pi, whether this works on the PC so I do not know …

I’m getting somewhere.

  • I moved the serial adapter from the PC to the RPi (duh!!!)

  • I restarted the ESPHOME service. Yay! the serial adapter appeared!

  • I clicked Upload, and got Error 2. (Header packet error)

I feel like I need to push one or more buttons on the device to enable flashing. Do I push the “flash” button, the “reset” button, or both?

I’m getting there!

Idk much about espeasy since I write my own firmware from scratch for my mqtt esp devices (using arduino libraries of course), but I do know regardless what method you use to flash a board on a pc, you will have to have the USB uart drivers for the board installed on the PC (usually ch340 for nodemcu boards). Otherwise your os won’t be able to talk to it (usually only a problem with windows, since linux distros mostly include the usual drivers… ch340, cp2101, and ftdi).

What is your esphome yaml config? You may have chosen the wrong device type?

I only use a USB charging cable with my Wemos D1 and NodeMCU, as is the case with smartphones, I do not need a “flash button” on these boards. On my ESP32 cam boards, I have a “USB to serial TTL adapter cable” in use, here I have to press the “Flash button”.
Maybe your configatoin is wrong, see post from: @nickrout

Here is an example of my ESPHome config …

esphome:
  name: bewegungsmelder_1
  platform: ESP8266
  board: nodemcuv2

wifi:
  ssid: 'bla bla'
  password: 'bla bla'
  manual_ip:
    static_ip: 192.168.178.140
    gateway: 192.168.178.1
    subnet: 255.255.255.0
# Enable logging
logger:

# Enable Home Assistant API
api:

ota:
..........

A charging cable won’t work, they usually don’t have the data connected.

@nickrout
All my smartphone (HTC, LG, Samsung, Nokia, Motorola …) charging cable work, I have no problems. The micro USB to USB cable from Anker also work perfectly …

Try holding down the flash button while uploading.

OK, I got it done…

  • I copied the .bin file down from HASSIO to my PC.
  • I installed and used NODEMCUPYFlasher
  • I had to push the “flash” button and use the serial adapter (I suspect my micro USB adapter is power only, no data) from my PC USB port
  • Once I got it flashed, it logged onto WiFi instantly, and I was able to access it from HASSIO ESPHome no problem.

Thanks for the help!

2 Likes

Final note. After I got a true microUSB DATA cable installed, the USB port on the NodeMCU came to life and began working. I flashed my second NodeMCU board just in case I forget how to do this… Senior moments happen…

3 Likes

Very well!!! :+1:
Luckily, there are also professionals in the forum here @nickrout !!
Maybe I caused more confusion than I helped, sorry for that. Find this forum very well, have received a lot of help here, and have tried to give something back …

this worked too, for hassio running on virtual box running on mac