Flash on another device

Hi everyone,
the raspberry pi running my home assistant and ESPHome instances is located in a very inconvenient area and accessing it is super annoying.
Therefore I have tried to create a new device on ESPHome dashboard, download the .bin file and flash it on my ESP01 from my Ubuntu 20 laptop using Esphomeflasher and two different “flashers” (I don’t know what they are called). I have also tried different ESP01 boards.
Here are the logs of the flashing:

Using '/dev/ttyUSB1' as serial port.
Connecting....
Detecting chip type... ESP8266
Connecting...

Chip Info:
 - Chip Family: ESP8266
 - Chip Model: ESP8266EX
 - Chip ID: 00E3CF8B
 - MAC Address: 8C:CE:4E:E3:CF:8B
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
 - Flash Size: 1MB
 - Flash Mode: dio
 - Flash Frequency: 40MHz
Erasing flash (this may take a while)...
Chip erase completed successfully in 4.0s
WARNING: Suspicious segment 0xee, length 0
WARNING: Suspicious segment 0x0, length 16777216
Warning: Image file at 0x0 is not a valid ESP8266 image, so not changing any flash settings.
Compressed 889072 bytes to 509570...
Writing at 0x0007c000... (100 %)Wrote 889072 bytes (509570 compressed) at 0x00000000 in 12.8 seconds (effective 555.1 kbit/s)...
Hash of data verified.

Leaving...
Hard Resetting...
Done! Flashing is complete!

Showing logs:
Serial port closed!

everything seems to go smoothly however, when I try to power on the ESP-01, it doesn’t connect to the wifi (yes I triple checked the credentials and there is signal).

I feel like I am missing a step or I am doing something conceptually wrong.

PS: I basically followed the instructions in this post Flash on one host, connect with another (ESPHome Dashboard) - #3 by DeadEnd

Have you seen the warning?
Use the recommended flasher. Binaries are available for all major OS:

If you’re MCU has an onboard LED I also recommend to implement a little “heartbeat blink” routine into your ESP YAML file. This immediately tells you whether your code is running, even if it does not connect to WiFi.


# let the onboard LED flash every few seconds
# to show that the MCU is up and running

output:
  - platform: gpio
    pin:
      number: D4
      mode: output
      inverted: True
    id: blueLED

interval:
  - interval: 2000ms
    then:
      - output.turn_on: blueLED
      - delay: 10ms
      - output.turn_off: blueLED

Thank you so much for your answer. I downloaded the esphome-flasher you suggester and tried to add the code to the yaml but I get the following error when I try to install the code:


INFO Reading configuration /config/test01.yaml...
Failed config

output.gpio: [source /config/test01.yaml:27]
  platform: gpio
  pin:  [source /config/test01.yaml:29]
    
    Cannot resolve pin name 'D4' for board esp32dev.
    number: D4 [source /config/test01.yaml:29]
    mode: output
    inverted: True
  id: blueLED

At least I can see the blue LED blinking when flashing the code.

D4 is only available for certain MCU board types. Check the docs and use the real GPIO pin number for your board. It’s all in the ESPHome docs. Look for “pin”.

Sorry for the very noob question, how can I find which GPIO pin number to use? These ESP01 are from I don’t know where, probably some amazon impulsive purchase!

Try to find the MCU model with Google’s image search or with any code or name that is printed on it.


I have one of these

Found it! But there’s no data about pins…
https://www.amazon.it/IZOKEE-Ricetrasmettitore-Wireless-Convertitore-Compatibile/dp/B07D49MSTM

Looks like an ESP01. This is an extremely reduced 8266 board with only 2 exposed GPIO ports plus RX and TX for the UART. Search Google for “esp-01 pinout” to find more information.
I guess the LEDs on the PCB are not connected to any GPIOs at all. You could attach a LED with a 220 Ohm series resistor between one of the GPIOs and GND and change the YAML to use that GPIO.

But maybe you should spend some bucks on a real ESP8266 board like the Wemos D1 mini. This will make your life much easier and they are very cheap.

1 Like