esphome / issues

Issue Tracker for ESPHome
https://esphome.io/
291 stars 34 forks source link

Problems with WireGuard and esp8266 (esp-12f) #5786

Open delthia opened 1 month ago

delthia commented 1 month ago

The problem

When uploading an script with WireGuard, I can ping the board, but the web interface doesn't work. Changing the board and uploading the same script to an esp32 allows me to use the web interface through WireGuard without any issues.

Which version of ESPHome has the issue?

2024.4.1

What type of installation are you using?

pip

Which version of Home Assistant has the issue?

No response

What platform are you using?

ESP8266

Board

4-relay board with esp-12f module

Component causing the issue

Wireguard

Example YAML snippet

esphome:
  name: riego

esp8266:
  board: esp12e

# Enable logging
logger:

# Enable Home Assistant API
api:
  password: ""
  reboot_timeout: 0s

ota:
  password: ""

wifi:
  ssid: ""
  password: ""

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

captive_portal:

light:
  - platform: status_led
    name: "Status"
    pin:
      number: GPIO2
      inverted: true

web_server:
  port: 80

wireguard:
  address: 10.7.0.6
  private_key: =
  peer_endpoint: wg.domain
  peer_public_key: =

  netmask: 255.255.255.255

  peer_port: 51820

  peer_preshared_key: =

  peer_allowed_ips: 10.7.0.1/24

  peer_persistent_keepalive: 25s

  update_interval: 20s

time:
  - platform: sntp
    id: sntp_time
    timezone: Europe/Madrid
    servers:
      - 0.pool.ntp.org
      - 1.pool.ntp.org
      - 2.pool.ntp.org

Anything in the logs that might be useful for us?

No response

Additional information

The logs say that the peer is online, and on the server I can see traffic between the server and the client coming from the keepalive messages. I've tried using the public domain name to access the server, but also directly the local ip to test inside the network. Both things fail but work on the esp32

delthia commented 3 weeks ago

I managed to make it work by removing peer_allowed_ips, but I think that with that it worked on the esp32