I'm trying to program a ESP01s on a relay board, but it won't boot when in the relay board?

I’ve gotten one of these very small PCB’s with a 220v relay and an esp01s on it.

According to what I could find, the relay is controlled with GPIO0
So I made a config like this:

substitutions:
  device_name: raclette

esphome:
  name: ${device_name}
  platform: ESP8266
  board: esp01_1m

wifi:
  ssid: !secret wifissid
  password: !secret wifipw
  reboot_timeout: 60min
  manual_ip:
    static_ip: 10.11.13.99
    gateway: 10.11.13.1
    subnet: 255.255.255.0
  fast_connect: true
  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "${device_name} Hotspot"
    password: !secret appw

# Enable Home Assistant API
api:

ota:
  password: !secret otapw

time:
  - platform: homeassistant
    id: homeassistant_time

# Enable logging
#logger:
#  baud_rate: 0 #need this to free up UART pins

web_server:
  port: 80
  auth:
    username: !secret webuser
    password: !secret webpw

uart:
  baud_rate: 115200 # speed to STC15L101EW
  tx_pin: GPIO1
  rx_pin: GPIO3

# Text Sensor with general information
text_sensor:
  - platform: version
    name: '${device_name} ESPHome Version'
  - platform: wifi_info
    ip_address:
      name: '${device_name} ip'
    ssid:
      name: '${device_name} ssid'

sensor:
  - platform: wifi_signal
    name: '${device_name} WiFi Signal'
    update_interval: 60s
    accuracy_decimals: 0
  - platform: uptime
    name: '${device_name} Uptime'
    unit_of_measurement: days
    update_interval: 300s
    accuracy_decimals: 1
    filters:
      - multiply: 0.000011574

switch:
  - platform: gpio
    name: '${device_name}'
    id: relay
    pin: GPIO0
    

When the esp01s is in the programmer it boots up as it should, but as soon as I mount it in the relay, then it won’t boot. Any ideas out there?

It looks like the one from frencks doorbell.

Frenck does not use the tx_pin and rx_pin definition

That’s the one, thanks I’ll try and look through his setup…

I suspect this might be your problem:

switch:
  - platform: gpio
    name: '${device_name}'
    id: relay
    pin: GPIO0

The notes for GPIO 0 state:

GPIO0 pulled up OK connected to FLASH button, boot fails if pulled LOW

Is it pulled Low by the relay board?

I wouldn’t think so, as it’s the one controlling the relay as far as I know, normally I would avoid GPIO0, but I can see on Francks code, that also uses GPIO0.

Just for the hell of it, I bent GPIO0, so it wouldn’t connect, no change.

Ok… so don’t ask me why but I found a while ago information about… there is a very small resistor on the board (relayboard). If you remove it (solder) it will boot…

Think it was this link, not sure my Internet is too slow atm.

1 Like

So two problems.

  • GPIO 0 is shorted to ground and
  • CH_PD is not pulled high.

Wow. What a POS relay board.

wtf, geeeez, they could just have used gpio2, and the problem wouldn’t be there. I’m going to test this out.

POS? (Blond)

Piece of :poop:

Clear! Agree :slight_smile:

I was already thinking, why use this relay in a POS (Point of Sale)

You’ve rumbled my game. Using a wifi relay to turn on a card cloner remotely is my side project. :grimacing:

1 Like

I’ve tried the ‘hack’ as described in the video, it get’s the esp01s online, but it won’t pull the relay, so I’m giving up on that board, and I’m getting some of these instead


They are slightly bigger, but geekreit is usually good quality, they use serial coms to pull the relay instead of a GPIO.

I have a few of these working great, only differences I can see between mine and your code is that I don’t have a UART: section, only the switch on GPIO0 and it is inverted


switch:
  - platform: gpio
    id: relay
    inverted: true
    pin: GPIO0

I remember something elso from this PITA board…

See picture, I had to connect 2 pins (see picture - little small metal on the bottom right of the picture) then it worked… but now I prefer the D1 mini…

I have 2 of them, and they work great with Tasmota. But, although they look identical when seen from above, they differ from the one in the video, the way the man in the picture is holding them, mine have a hole in the right down corner.

I’ve tried both with and without, no change. .-(

How about jumpering GPIO2 to the relay instead of GPIO0 (and adjusting your ESPHome config)?