Ethernet and Wifi in same time not possible?

Hi

I’m flashing that device from Kincony (ARDUINO 8 CHANNEL RELAY MODULE – KC868-A8 | KinCony Smart Home System) that is based on ESP32 and has Ethernet port.

Is it really impossible to use both Wifi and ethernet in same time ? Nothing is indicated in ESPHome documentation but won’t allow compilation if I have both in code.

ESPHome documentation states also that Wifi component is mandatory which is wrong as module is working fine with only Ethernet mode in it.

What about also the automatic reboot of the ESP because it won’t find out any Wifi connection ??

Thanks for your inputs,

Vincèn

substitutions:
  friendly_name: kincony-k868-a8

esphome:
  name: $friendly_name
  platform: ESP32
  board: esp32dev

logger:

web_server:

ota:

#wifi:
#  networks:
#  - ssid: !secret wifi_ssid
#    password: !secret wifi_passwd
#  - ssid: !secret wifi_puppy
#    password: !secret wifi_puppy_passwd
#  - ssid: !secret wifi_cstj
#    password: !secret wifi_cstj_passwd
#  ap:
#    ssid: $friendly_name

#captive_portal:

api:
  reboot_timeout: 120min

sensor:
#  - platform: wifi_signal
#    name: $friendly_name WiFi Signal
#    update_interval: 60s
  - platform: uptime
    name: $friendly_name Uptime
    filters:
      - lambda: return x / 60.0;
    unit_of_measurement: minutes

i2c:
  sda: 4
  scl: 5
  scan: true
  id: bus_a

ethernet:
  type: LAN8720
  mdc_pin: GPIO23
  mdio_pin: GPIO18
  clk_mode: GPIO17_OUT
  phy_addr: 0

pcf8574:
  - id: 'pcf8574_hub_out_1'  # for output channel 1-8
    address: 0x24
  - id: 'pcf8574_hub_in_1'  # for input channel 9-16
    address: 0x22

switch:
  - platform: gpio
    name: "Relais 1"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 0
      mode: OUTPUT
      inverted: true
  - platform: gpio
    name: "Relais 2"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 1
      mode: OUTPUT
      inverted: true
  - platform: gpio
    name: "Relais 3"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 2
      mode: OUTPUT
      inverted: true
  - platform: gpio
    name: "Relais 4"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 3
      mode: OUTPUT
      inverted: true
  - platform: gpio
    name: "Relais 5"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 4
      mode: OUTPUT
      inverted: true
  - platform: gpio
    name: "Relais 6"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 5
      mode: OUTPUT
      inverted: true
  - platform: gpio
    name: "Relais 7"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 6
      mode: OUTPUT
      inverted: true
  - platform: gpio
    name: "Relais 8"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 7
      mode: OUTPUT
      inverted: true
      
binary_sensor:
  - platform: gpio
    name: "Entree 1"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 0
      mode: INPUT
      inverted: true
  - platform: gpio
    name: "Entree 2"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 1
      mode: INPUT
      inverted: true
  - platform: gpio
    name: "Entree 3"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 2
      mode: INPUT
      inverted: true
  - platform: gpio
    name: "Entree 4"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 3
      mode: INPUT
      inverted: true
  - platform: gpio
    name: "Entree 5"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 4
      mode: INPUT
      inverted: true
  - platform: gpio
    name: "Entree 6"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 5
      mode: INPUT
      inverted: true
  - platform: gpio
    name: "Entree 7"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 6
      mode: INPUT
      inverted: true
  - platform: gpio
    name: "Entree 8"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 7
      mode: INPUT
      inverted: true

Yep. I tried it the other day with a Quinled ETH board. One or the other. Not both.

It’s also disconcerting to do a “wireless” OTA update to a board with Ethernet and no wireless. We can submit documentation pull requests to propose fixed to these issues.

Good question. I might write a “Hello World” config that blinks a led a few times on boot and see what happens if I pull the Ethernet plug. If I get time.

I suspect it won’t do anything. The reboot is required to fix a bug in the ESP wireless stack that sometimes prevents it reconnecting when the wifi comes back.

Screenshot 2022-03-25 at 23-00-37 WiFi Component

Or this may apply to the TCP/IP stack and be required for an Ethernet connection too. I don’t know.

I can confirm now that IP stack issue is only with Wifi. My module running in Ethernet mode has passed already more than one hour without any reboot:

2022-03-25 13.24.32 n6i71nveptxx72q10614vld17u87jnhh.ui.nabu.casa 8a18cf3d6547

yep would be a good idea but not really time for that right now on my side :frowning:

1 Like

Really? Opening your thread and ask others to spend time to help you is for sure more time consuming than just quickly editing some docs on the esphome site.

Every site can be easily edited, just scroll to the bottom and hit the “edit on github” (or smthng like that) link.

Open source is all about sharing, you take and you give! That’s the idea :bulb:

1 Like

I know :wink: but my near inexising knowledge on proper use of code repository made me give up in past on that or ask more competent person to do it for me !
Gave it a try as documentation is easier to update, and if it succeed will do some others :wink:

1 Like

I know that! I even gave up on esphome the first time I tried it years ago. Luckily I came back and just started despite only understood a fraction how things are glued together. With a little time I came familiar with almost the whole system (only the yaml part - no lambda for me :laughing:). I’m no programmer at all but contributing to the esphome docs is something probably anybody can do who is able to use esphome :rocket:

I made two pull requests in project to update the Wifi and Ethernet components description and limitations :wink: will see how it goes :smiley:

1 Like

Thanks! I think I’m starting to understand how that update process works. Your example inspired me; one of these days I’ll get brave and try my own update.

One very minor point: The “Wi” in “WiFi” stands for “Wireless.” Instead of saying you can’t have them both “wired,” maybe just say you can’t use both the wireless and wired Ethernet adapters at the same time, even if you have both installed.

If you have a comment on @vincen 's PR, comment on github.

Yep you should, lot easier than contribute code where review process is quite complex (well I mean when never used repository/github…) but for documentation it’s quite easy and quick :wink: thanks @orange-assistant for pushing me :+1:

[quote=“CaptTom, post:8, topic:405358, full:true”]One very minor point: The “Wi” in “WiFi” stands for “Wireless.” Instead of saying you can’t have them both “wired,” maybe just say you can’t use both the wireless and wired Ethernet adapters at the same time, even if you have both installed.
[/quote]
As stated by @nickrout would be to be posted in the PR on github :wink: I use that wording on purpose as “installed” can be confusing ! does it mean some software installed ? hw installed ?..

on wled i use to had both wifi and lan but wifi only in backup situation, because throughput on wired is incomparable better, on esphome i couldn’t activate wifi as backup, ok, but having at least esp32-AP mode for remote control and having safe mode functions would be handy and i think it isn’t same as “working” client mode, but as i don’t know much whay wifi can’t work while ETH PHY is connected… is there lack of MAC or something… ?

Nope as far as I know it’s only a restriction of ESPHome !