Esp8266 won't connect

First time trying to hook an 8266 up. I manually downloaded the .bin file and flashed the device, since it won’t upload via USB in HA. It uploads and connects to the WIFI but it doesn’t show as connected in HA. What could I be missing?

esphome:
  name: esp8266_test
  platform: ESP8266
  board: nodemcuv2

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:
  password: "bdbc98dadee61a2b746c1912707f2f79"

wifi:
  manual_ip:
    # Set this to the IP of the ESP
    static_ip: 192.168.86.127
    # Set this to the IP address of the router. Often ends with .1
    gateway: 192.168.86.1
    # The subnet of the network. 255.255.255.0 works for most home networks.
    subnet: 255.255.255.0

  ssid: "...searching"
  password: !wifi_secret

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

captive_portal:


status_led:
  pin:
    number: GPIO2
    inverted: yes
    
switch:
  - platform: gpio
    name: "dhust_output"
    pin: 5
    inverted: false
    id: dhust

can HA resolve the name esp8266_test.local?

I’ve seen this issue where mDNS is blocked / disabled (e.g. at the router) and it stops the name being resolved.

I’m not sure if it can resolve esp8266_test.local. Where do I look for that? Also, I haven’t been able to use .local for getting into HA either. I ended up setting up duckdns and used that url instead.

if you can’t use .local for HA then it may be disabled on your network. Worth investigating.

You may still find that the ESPHome entities are created, just that you can’t connect via the ESPHome dashboard (I’ve no idea why btw).

Your router may not support underscores ( _ ) in the mDNS name. Replace them with hyphens (-) in the name (in the ESP config) and filename then re-upload.

See: https://github.com/esphome/issues/issues/2168#issuecomment-865740979

1 Like

You may still find that the ESPHome entities are created, just that you can’t connect via the ESPHome dashboard (I’ve no idea why btw).

I’m not seeing any entities for the esp.

Renamed it to test and it still doesn’t work. The filename is test.bin. The yaml file is esp8266.yaml.

esphome:
    name: test
    platform: ESP8266
    board: nodemcuv2

I think you’re kind of mixing things. What you showed in your picture is the ESPHome-Dashboard. This is not HA. :wink:

Just to explain: the ESPHome-Dashboard is to setup a firmware for your ESP device. It shows the firmware part of things. This has nothing to do with HA and it’s components.

If you want HA to show your ESP components (whatever it is, a light, a switch, something fancy), it should work automagically, if you’ve set the api integration in ESPHome. Sometimes this fails, so you’ve to add the ESP device to HA manually. For that to work you go to Configuration -> Integrations and press the plus sign. There you click on ESPHome and setup the node (IP address, password). After that, the device should show up in HA (developer tools), if you have set something up to show like the switch in your first post.

The other thing to check is the connection to the ESPHome-Dashboard. That is, what is shown with the read header in your pic. This is a totally different connection. Let’s just say, this is the direct connection to your firmware. If you press LOG on the node in ESPHome-Dashboard, it should connect you directly to the node, but only for “firmware things”.

So, what I’d suggest to do is as follows:

  • Start fresh! :slight_smile: Delete the node you already have and setup a new one, preferable with a new fixed IP address in the firmware.
  • Flash the ESP with the new firmware (how do you even flash the ESP, please describe exactly).
  • After flashing the ESP, disconnect it from power and let it start and lookup for an IP.
  • Check in the ESPHome-Dashboard what happens, if you press LOG. It should show some initial data about the node, eg. the assigned IP address, the signal strength and so on.
  • If this shows no connection, then we have to dive deeper. :slight_smile:
  • If all works ok to this point, go to HA and the Integrations page I noted above and see, if the node is shown under the ESP integration.
  • If you can see the node there, check the developer tools page in HA and see, if something shows up.
  • If so, you’re done and have your first working ESP device. Congrats! :slight_smile:

Flash the ESP with the new firmware (how do you even flash the ESP, please describe exactly)

I click on Install and download the .bin file using “Manual download” since “Plug into this computer” doesn’t work. Then I use esphome-flasher to flash the device using the bin file I downloaded.

After flashing the ESP, disconnect it from power and let it start and lookup for an IP.

I’m not seeing the device on my home network.

Check in the ESPHome-Dashboard what happens, if you press LOG. It should show some initial data about the node, eg. the assigned IP address, the signal strength and so on.

I press “LOGS” and it only shows to “Connect Wirelessly” which I cannot do yet.

Now I’m wondering if I have the correct board chosen. I used esptool and ran flash_id and it shows me I have 4MB of flash and it shows DOIT.AM on the 8266 so I believe I have the ESPDuino (ESP-13 Module). I tried using what it showed for the board type: espduino, but it states to use that in the platformio.ini, but I don’t think I need to do that? So I guess I’m not sure what to do there.

Here is the log I get after flashing. And thanks for your continued help. :slight_smile:

[20:49:40][I][logger:170]: Log initialized
[20:49:40][C][ota:366]: There have been 3 suspected unsuccessful boot attempts.
[20:49:40][I][app:029]: Running through setup()…
[20:49:40][C][wifi:037]: Setting up WiFi…
[20:49:40][D][wifi:365]: Starting scan…
[20:49:46][D][wifi:380]: Found networks:
[20:49:46][I][wifi:426]: - ‘…searching’ (44:07:0B:0F:DE:C4) ▂▄▆█
[20:49:46][D][wifi:427]: Channel: 1
[20:49:46][D][wifi:428]: RSSI: -40 dB
[20:49:46][D][wifi:430]: - ‘Cisco62242’ (58:6D:8F:73:60:D4) ▂▄▆█
[20:49:47][D][wifi:430]: - ‘’ (D4:B2:7A:EB:C3:E3) ▂▄▆█
[20:49:47][D][wifi:430]: - ‘ATT7Wpz343’ (D4:B2:7A:EB:C3:E1) ▂▄▆█
[20:49:47][D][wifi:430]: - ‘’ (0A:84:9D:77:A9:C4) ▂▄▆█
[20:49:48][D][wifi:430]: - ‘SpectrumSetup-E9’ (76:69:42:9C:FF:E7) ▂▄▆█
[20:49:48][D][wifi:430]: - ‘MySpectrumWiFib6-2G’ (B8:D9:4D:2E:1D:BC) ▂▄▆█
[20:49:49][D][wifi:430]: - ‘diagonalley’ (14:59:C0:90:39:85) ▂▄▆█
[20:49:49][D][wifi:430]: - ‘DIRECT-6E-HP DeskJet 2600 series’ (C8:D9:D2:76:CB:6F) ▂▄▆█
[20:49:49][D][wifi:430]: - ‘TC8717TC3’ (08:95:2A:E6:DA:C9) ▂▄▆█
[20:49:50][D][wifi:430]: - ‘LAN_Before_Time’ (14:59:C0:87:64:5A) ▂▄▆█
[20:49:50][D][wifi:430]: - ‘’ (F4:17:B8:90:CE:FF) ▂▄▆█
[20:49:50][D][wifi:430]: - ‘’ (F4:17:B8:3F:F6:E1) ▂▄▆█
[20:49:50][I][wifi:235]: WiFi Connecting to ‘…searching’…
[20:49:51][I][wifi:498]: WiFi Connected!
[20:49:51][C][wifi:344]: SSID: ‘…searching’
[20:49:51][C][wifi:345]: IP Address: 192.168.86.100
[20:49:51][C][wifi:347]: BSSID: 44:07:0B:0F:DE:C4
[20:49:51][C][wifi:348]: Hostname: ‘try’
[20:49:52][C][wifi:352]: Signal strength: -46 dB ▂▄▆█
[20:49:52][C][wifi:356]: Channel: 1
[20:49:52][C][wifi:357]: Subnet: 255.255.255.0
[20:49:52][C][wifi:358]: Gateway: 192.168.86.1
[20:49:52][C][wifi:359]: DNS1: (IP unset)
[20:49:52][C][wifi:360]: DNS2: (IP unset)
[20:49:52][D][wifi:507]: Disabling AP…
[20:49:53][C][ota:029]: Over-The-Air Updates:
[20:49:53][C][ota:030]: Address: 192.168.86.100:8266
[20:49:53][C][ota:032]: Using Password.
[20:49:53][W][ota:036]: Last Boot was an unhandled reset, will proceed to safe mode in 7 restarts
[20:49:53][C][api:022]: Setting up Home Assistant API server…
[20:49:54][I][app:059]: setup() finished successfully!
[20:49:54][I][app:105]: ESPHome version 1.19.4 compiled on Jul 6 2021, 20:48:18
[20:49:54][C][wifi:484]: WiFi:
[20:49:54][C][wifi:344]: SSID: ‘…searching’
[20:49:54][C][wifi:345]: IP Address: 192.168.86.100
[20:49:55][C][wifi:347]: BSSID: 44:07:0B:0F:DE:C4
[20:49:55][C][wifi:348]: Hostname: ‘try’
[20:49:55][C][wifi:352]: Signal strength: -46 dB ▂▄▆█
[20:49:55][C][wifi:356]: Channel: 1
[20:49:55][C][wifi:357]: Subnet: 255.255.255.0
[20:49:55][C][wifi:358]: Gateway: 192.168.86.1
[20:49:56][C][wifi:359]: DNS1: (IP unset)
[20:49:56][C][wifi:360]: DNS2: (IP unset)
[20:49:56][C][logger:189]: Logger:
[20:49:56][C][logger:190]: Level: DEBUG
[20:49:56][C][logger:191]: Log Baud Rate: 115200
[20:49:56][C][logger:192]: Hardware UART: UART0
[20:49:57][C][captive_portal:148]: Captive Portal:
[20:49:57][C][ota:029]: Over-The-Air Updates:
[20:49:57][C][ota:030]: Address: 192.168.86.100:8266
[20:49:57][C][ota:032]: Using Password.
[20:49:57][W][ota:036]: Last Boot was an unhandled reset, will proceed to safe mode in 7 restarts
[20:49:57][C][api:095]: API Server:
[20:49:58][C][api:096]: Address: 192.168.86.100:6053
[20:50:45]
Serial port closed!

Where ddid you find this?
My ESP8266 won’t connect as well so I need the FW for the flasher tool.