ESP-01S - Unable to get wifi up?

Hi Guys,

I’m having a rough time getting wifi up and running on my ESP-01S (ESP8266).
I’ve spent many hours on this allready but their just seims no way to get wifi to work.

I’ve created several config, compiled them and (succesfully) flashed them (using esphome-flasher) to several ESP-01S chips, but the result is always the same: nothing happens.

I have a Unifi/Ubiquiti wifi network that has no problems what so ever… I’ve got 2 SSID’s,
one hidden and one for general puposes, at first I was connecting to the hidden ssid, I found out that this isnt supported unless you use fast_connect, so I tried fast connect; same result: nothing happens. So I tried my other general (non-hidden) SSIS; but still: nothing happens.

Also tried it with and without quotes and tried static ip: nothing…

I also setup accesspoint mode:
" ap:
ssid: “Test Fallback Hotspot”
password: “EIFvX3jNz1ZP”
"

But this also doesn’t show up, when I scan for wifi networks.

Bottom line… I’m clueless whats going wrong and really hope someone can point me in a good direction :slight_smile:

any help would be appreciated :blush:

Please post the YAML you’re flashing to the device, formatted properly (surround code with three backticks before and after).

I’m using the ‘Frenck doorbell’ code
(https://frenck.dev/diy-smart-doorbell-for-just-2-dollar/)

esphome:
  name: doorbell
  platform: ESP8266
  board: esp01_1m

# WiFi connection, correct these
# with values for your WiFi.
wifi:
  ssid: "SSID"
  password: "SSIDPassword"
  ## use fast_connect of you are connecting to a hidden WiFi network, else comment it out

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

captive_portal:


# Enable logging.
logger:
  level: DEBUG

# Enable Home Assistant API.
api:

# Enable over-the-air updates.
ota:

# Enable Web server.
web_server:
  port: 80

# Sync time with Home Assistant.
time:
  - platform: homeassistant
    id: homeassistant_time

# Text sensors with general information.
text_sensor:
  # Expose ESPHome version as sensor.
  - platform: version
    name: Doorbell ESPHome Version
  # Expose WiFi information as sensors.
  - platform: wifi_info
    ip_address:
      name: Doorbell IP
    ssid:
      name: Doorbell SSID
    bssid:
      name: Doorbell BSSID

# Sensors with general information.
sensor:
  # Uptime sensor.
  - platform: uptime
    name: Doorbell Uptime

  # WiFi Signal sensor.
  - platform: wifi_signal
    name: Doorbell WiFi Signal
    update_interval: 60s

# Global to store the on/off state of the chime
globals:
  - id: chime
    type: bool
    restore_value: true
    initial_value: 'true'

# Exposed switches.
switch:
  # Switch to restart the doorbell.
  - platform: restart
    name: Doorbell Restart

  # Switch to turn on/off the chime.
  - platform: gpio
    id: relay
    inverted: true
    name: Doorbell Chime
    pin: GPIO0

  # Switch to turn on/off chime when
  # doorbell button is pushed.
  #
  # It creates a "virtual" switch based
  # on a global variable.
  - platform: template
    name: Doorbell Chime Active
    id: chime_active
    restore_state: false
    turn_on_action:
      - globals.set:
          id: chime
          value: 'true'
    turn_off_action:
      - globals.set:
          id: chime
          value: 'false'
    lambda: |-
      return id(chime);

# Binary sensor representing the
# Doorbell button push.
binary_sensor:
  - platform: gpio
    id: button
    name: Doorbell Button
    pin:
      # Connected to GPIO on the ESP-01S.
      number: GPIO2
      mode: INPUT_PULLUP
      inverted: true
    filters:
      # Small filter, to debounce the button press.
      - delayed_on: 25ms
      - delayed_off: 25ms
    on_press:
      # Only turn on the chime when it is active.
      then:
        if:
          condition:
            - switch.is_on: chime_active
          then:
            - switch.turn_on: relay
    on_release:
      # On release, turn of the chime.
      - switch.turn_off: relay

Did you bridge 3.3v and EN ?

Edit : ok, in that relay it is not required

I’d suggest stripping it right back to start with: in particular, remove the web_server (warning in docs).

If your installation allows use of the command line, try esphome test.yaml wizard (ref) and flash what that gives you.

Once you have that barebones config sorted and running, you can add the features you need over-the-air.

Hi Troon,

Thanks, I’ll take a look un the command line suggestion.
I actually did make a new (blanc) project with this code (also nothing happend).

esphome:
  name: test
  platform: ESP8266
  board: esp01_1m

wifi:
  ssid: "SSID_NAME"
  password: "SSIS_PASS"

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

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:

You do have 2.4GHz wifi enabled on the Unifi gear, don’t you? ESP8266 devices are 2.4GHz only.

That config should work. You’re saying that after a few minutes, you can’t see the device in the clients page of your Unifi controller (successful connection to wifi) or the test hotspot SSID on a phone (failed to connect)?

Are you getting logs from the flashing process suggesting success?

2.4Ghz in enabled on both SSID’s indeed (also running 10 shelly 1’s)

Indeed I’m checking the client page in my Unifi controller to see if there is a new client, wich isn’t showing any. and the next test is also as you describe, I’m checking if there is being broadcasted a “test fallback hotspot” ssis by lettering my smartphone scan for wifi networks, wich arent showing.

The esphome-flasher gives this as an result:

)Writing at 0x0004c000... (100 %)Wrote 463088 bytes (311838 compressed) at 0x00000000 in 28.5 seconds (effective 130.1 kbit/s)...
Hash of data verified.

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

If you can run esphome config.yaml run from the command line, you should see boot logs from the device that will tell you what’s going on.

I tried, but it only tells me:

"

Hard resetting via RTS pin…
Succesfully uploaded program
Starting log output from COM3 with baud rate 115200"

And than nothing happens anymore…

the fall back AP typically should be showing , hmm what if you do a hotspot on your phone and see if you can connect to it ? , this would help in isolation testing.

Other options would be just to strip out the rest of the code below web_sever and just have the basic options enabled incase they are stuffing something up.

Ah one more option to try to use tasmoto firmware on your chip. ( https://notenoughtech.com/home-automation/tasmotizer/). This hopefully brings up AP and can use web interface to upload the compiled firmware from ESPhome

I think the problem is earlier than the wifi setup. I’ve just flashed a barebones config to a brand new previously-unused Wemos D1 Mini Pro over USB, and got this output from esphome pir_test.yaml run:

INFO Successfully compiled program.
Found multiple options, please choose one:
  [1] /dev/ttyUSB0 (USB Serial)
  [2] /dev/wemos (USB Serial)
  [3] Over The Air (pir_test.local)
(number): 1
INFO Running:  esptool.py --before default_reset --after hard_reset --baud 460800 --chip esp8266 --port /dev/ttyUSB0 write_flash 0x0 pir_test/.pioenvs/pir_test/firmware.bin
esptool.py v2.8
Serial port /dev/ttyUSB0
Connecting....
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: f4:cf:a2:d8:42:6d
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Auto-detected Flash size: 16MB
Compressed 396352 bytes to 274038...
Wrote 396352 bytes (274038 compressed) at 0x00000000 in 6.2 seconds (effective 510.0 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
[16:37:38]\xe0\xe0\xe0\xe0\xe0\xe0\xe0\xe0\xe0\xc4d\xe0|
                                                        \x84
                                                            $\xecc|\x87\x83\xe4\x9br\x9bc\xc4
                                                                                             c\x84\xfb'o\x9el'g\x9c\xe2\xe4cp\x8c\x8flrdrdp\xf2n\xe0
    \x83d
         \x84\x9c
                 cg\xe3|$\xec\x8f#\x8c\xfbo'\xe7$\x8c\x8fl`\x98l`g{\x87\x93\xdb'
                                                                                b\xdcl;\x93\xdb'
                                                                                                #\x9cl\xdc\x8cl$\xecx8c$ \xfc\x83g\x9c[I][logger:156]: Log initialized
[16:37:38][C][ota:364]: There have been 0 suspected unsuccessful boot attempts.
[16:37:38][I][app:028]: Running through setup()...
[16:37:38][C][wifi:033]: Setting up WiFi...
[16:37:38][D][wifi:304]: Starting scan...
[16:37:44][D][wifi:319]: Found networks:

and it goes on from there. If you’re not getting any log output, I wonder if the problem lies with the cable / interface, or board type selection?

It’s “online” :slight_smile:

I had to release the GPIO01 to let it boot up… i had no idea; but i guess that’s a rookie mistake? :blush:

Thanks a lot for helping me out!

1 Like

Yup, a beginners mistake. As long as gpioO is connected to gnd the esp starts in programming ( flash) mode.

I’m also having issues connecting an ESP 01S and I think it has something to do with flash mode.

I followed this guide for the doorbell: https://frenck.dev/diy-smart-doorbell-for-just-2-dollar/

All went successfull and the ESP 01S is flashed. When it’s connected to the FTDI programmer it will connect to my wifi, but when I power on the ESP 01S to the relay it is not connecting.

As I said I think it is because of flash mode but I don’t know how to disconnect gpio01.

I know a LOT of ESP 01’s are made with the wrong capacitor, don’t know the exact value, but it was like 1000000 Ohm instead of 100 Ohm, figure of speach. Noticed that myself by accident. As soon as I touched that capacitor the ESP01 immediately got online, as soon as I released the wifi dropped. I made my doorbell with a D1 mini with a relay hat, works great !