Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Issues with Ethernet connection
#1
I have just received the KC868-M16-V2.1 board with PoE module.

I am able to power the board ok with PoE. however I am unable to get ESPHome to connect via Ethernet.

ESPHome config is

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


I have also added static IP as follows:

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

  manual_ip:
    static_ip: 192.168.85.24
    gateway: 192.168.85.1
    subnet: 255.255.255.0
    dns1: 192.168.85.1


Getting errors about IP when using DHCP
Code:
[16:51:12][I][ethernet:248]: Starting ethernet connection
[16:51:12][W][component:157]: Component ethernet set Warning flag: waiting for IP configuration

When using StaticIP it looks promising
Code:
[16:51:12][I][ethernet:259]: Connected via Ethernet!
[16:51:12][C][ethernet:515]:   IP Address: 192.168.85.24
[16:51:12][C][ethernet:516]:   Hostname: 'energy-monitor'
[16:51:12][C][ethernet:517]:   Subnet: 255.255.255.0
[16:51:12][C][ethernet:518]:   Gateway: 192.168.85.1
[16:51:12][C][ethernet:523]:   DNS1: 192.168.85.1
[16:51:12][C][ethernet:524]:   DNS2: 0.0.0.0
[16:51:12][C][ethernet:536]:   MAC Address: E4:65:B8:6A:91:FC
[16:51:12][C][ethernet:537]:   Is Full Duplex: YES
[16:51:12][C][ethernet:538]:   Link Speed: 100

However it is unable to be seen on the network at all.

I have tried different cables and ports on my network switch.
Reply
#2
you can try to test this yaml file. after downloaded firmware, re power on of board.
Code:
esphome:
  name: m16

esp32:
  board: esp32dev
  framework:
    type: arduino

external_components:
  - source:
      type: git
      url: https://github.com/hzkincony/esphome-zmpt101b
    refresh: 1min

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "D69bY/GXlmjYkovak6WIhgmbOH8vwyqvMxIHBriYoaY="


# Example configuration entry
ethernet:
  type: LAN8720
  mdc_pin: GPIO23
  mdio_pin: GPIO18
  clk_mode: GPIO17_OUT
  phy_addr: 0

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

cd74hc4067:
  - id: cd74hc4067_1
    pin_s0: 32
    pin_s1: 33
    pin_s2: 13
    pin_s3: 16

web_server:
  port: 80

font:

  - file: "gfonts://Roboto"
    id: roboto
    size: 20

display:
  - platform: ssd1306_i2c
    model: "SSD1306 128x64"
    address: 0x3C
    lambda: |-
      it.printf(0, 0, id(roboto), "T: %.1f°C", id(temperature).state);
      it.printf(0, 20, id(roboto), "H: %.1f%%", id(humidity).state);
      it.printf(0, 40, id(roboto), "AC:%.1fV", id(voltage_1).state);

# Example configuration entry
sensor:
  - platform: zmpt101b
    name: "m16--AI zmpt 34"
    adc_pin: 34
    id: voltage_1
    unit_of_measurement: V
    accuracy_decimals: 1
    state_class: "measurement"
  - platform: zmpt101b
    name: "m16--AI zmpt 36"
    adc_pin: 36
    id: voltage_2
    unit_of_measurement: V
    accuracy_decimals: 1
    state_class: "measurement"
  - platform: zmpt101b
    name: "m16--AI zmpt 39"
    adc_pin: 39
    id: voltage_3
    unit_of_measurement: V
    accuracy_decimals: 1
    state_class: "measurement"
   

  - platform: sht3xd
    temperature:
      name: "sht Temperature"
      id: temperature
    humidity:
      name: "sht Humidity"
      id: humidity
    address: 0x44
    update_interval: 5s

  - platform: adc
    pin: 35
    id: adc35
    update_interval: never
    attenuation: 11db

  # - platform: adc
  #   name: "m16--AI-1"
  #   pin: 36
  #   id: adc36
  #   update_interval: 60s
  #   attenuation: 11db

  # - platform: adc
  #   pin: 34
  #   name: "m16--AI-2"
  #   id: adc34
  #   update_interval: 60s
  #   attenuation: 11db

  # - platform: adc
  #   pin: 39
  #   name: "m16--AI-3"
  #   id: adc39
  #   update_interval: 60s
  #   attenuation: 11db




  - platform: cd74hc4067
    id: ai1
    number: 0
    sensor: adc35
    update_interval: 60s

  - platform: cd74hc4067
    id: ai2
    number: 1
    sensor: adc35
    update_interval: 60s

  - platform: cd74hc4067
    id: ai3
    number: 2
    sensor: adc35
    update_interval: 60s

  - platform: cd74hc4067
    id: ai4
    number: 3
    sensor: adc35
    update_interval: 60s

  - platform: cd74hc4067
    id: ai5
    number: 4
    sensor: adc35
    update_interval: 60s

  - platform: cd74hc4067
    id: ai6
    number: 5
    sensor: adc35
    update_interval: 60s

  - platform: cd74hc4067
    id: ai7
    number: 6
    sensor: adc35
    update_interval: 60s

  - platform: cd74hc4067
    id: ai8
    number: 7
    sensor: adc35
    update_interval: 60s

  - platform: cd74hc4067
    id: ai9
    number: 8
    sensor: adc35
    update_interval: 60s

  - platform: cd74hc4067
    id: ai10
    number: 9
    sensor: adc35
    update_interval: 60s

  - platform: cd74hc4067
    id: ai11
    number: 10
    sensor: adc35
    update_interval: 60s

  - platform: cd74hc4067
    id: ai12
    number: 11
    sensor: adc35
    update_interval: 60s

  - platform: cd74hc4067
    id: ai13
    number: 12
    sensor: adc35
    update_interval: 60s

  - platform: cd74hc4067
    id: ai14
    number: 13
    sensor: adc35
    update_interval: 60s

  - platform: cd74hc4067
    id: ai15
    number: 14
    sensor: adc35
    update_interval: 60s

  - platform: cd74hc4067
    id: ai16
    number: 15
    sensor: adc35
    update_interval: 60s


  - platform: ct_clamp
    sensor: ai1
    id: Measured_Current_1
    name: "Measured Current-1"
    update_interval: 5s
    filters:
      - calibrate_linear:
          # Measured value of 0 maps to 0A
          - 0.0034 -> 0
          # Known load: 4.0A
          # Value shown in logs: 0.1333A
          - 0.31749 -> 8.95608

  - platform: template
    id: power1
    name: "power1"
    lambda: return id(Measured_Current_1).state * id(voltage_1).state;
    device_class: power
    unit_of_measurement: 'W'
    update_interval: 60s

  - platform: total_daily_energy
    name: "Total Daily Energy1"
    power_id: power1
    filters:
        - multiply: 0.001
    unit_of_measurement: kWh
    accuracy_decimals: 3
    icon: mdi:clock-alert
    device_class: energy


  - platform: ct_clamp
    sensor: ai2
    name: "Measured Current-2"
    update_interval: 60s
    filters:
      - calibrate_linear:
          # Measured value of 0 maps to 0A
          - 0 -> 0
          # Known load: 4.0A
          # Value shown in logs: 0.1333A
          - 0.31749 -> 8.95608

  - platform: ct_clamp
    sensor: ai3
    name: "Measured Current-3"
    update_interval: 60s
    filters:
      - calibrate_linear:
          # Measured value of 0 maps to 0A
          - 0 -> 0
          # Known load: 4.0A
          # Value shown in logs: 0.1333A
          - 0.31749 -> 8.95608

  - platform: ct_clamp
    sensor: ai4
    name: "Measured Current-4"
    update_interval: 60s
    filters:
      - calibrate_linear:
          # Measured value of 0 maps to 0A
          - 0 -> 0
          # Known load: 4.0A
          # Value shown in logs: 0.1333A
          - 0.31749 -> 8.95608

  - platform: ct_clamp
    sensor: ai5
    name: "Measured Current-5"
    update_interval: 60s
    filters:
      - calibrate_linear:
          # Measured value of 0 maps to 0A
          - 0 -> 0
          # Known load: 4.0A
          # Value shown in logs: 0.1333A
          - 0.31749 -> 8.95608

  - platform: ct_clamp
    sensor: ai6
    name: "Measured Current-6"
    update_interval: 60s
    filters:
      - calibrate_linear:
          # Measured value of 0 maps to 0A
          - 0 -> 0
          # Known load: 4.0A
          # Value shown in logs: 0.1333A
          - 0.31749 -> 8.95608

  - platform: ct_clamp
    sensor: ai7
    name: "Measured Current-7"
    update_interval: 60s
    filters:
      - calibrate_linear:
          # Measured value of 0 maps to 0A
          - 0 -> 0
          # Known load: 4.0A
          # Value shown in logs: 0.1333A
          - 0.31749 -> 8.95608

  - platform: ct_clamp
    sensor: ai8
    name: "Measured Current-8"
    update_interval: 60s
    filters:
      - calibrate_linear:
          # Measured value of 0 maps to 0A
          - 0 -> 0
          # Known load: 4.0A
          # Value shown in logs: 0.1333A
          - 0.31749 -> 8.95608

  - platform: ct_clamp
    sensor: ai9
    name: "Measured Current-9"
    update_interval: 60s
    filters:
      - calibrate_linear:
          # Measured value of 0 maps to 0A
          - 0 -> 0
          # Known load: 4.0A
          # Value shown in logs: 0.1333A
          - 0.31749 -> 8.95608

  - platform: ct_clamp
    sensor: ai10
    name: "Measured Current-10"
    update_interval: 60s
    filters:
      - calibrate_linear:
          # Measured value of 0 maps to 0A
          - 0 -> 0
          # Known load: 4.0A
          # Value shown in logs: 0.1333A
          - 0.31749 -> 8.95608

  - platform: ct_clamp
    sensor: ai11
    name: "Measured Current-11"
    update_interval: 60s
    filters:
      - calibrate_linear:
          # Measured value of 0 maps to 0A
          - 0 -> 0
          # Known load: 4.0A
          # Value shown in logs: 0.1333A
          - 0.31749 -> 8.95608

  - platform: ct_clamp
    sensor: ai12
    name: "Measured Current-12"
    update_interval: 60s
    filters:
      - calibrate_linear:
          # Measured value of 0 maps to 0A
          - 0 -> 0
          # Known load: 4.0A
          # Value shown in logs: 0.1333A
          - 0.31749 -> 8.95608

  - platform: ct_clamp
    sensor: ai13
    name: "Measured Current-13"
    update_interval: 60s
    filters:
      - calibrate_linear:
          # Measured value of 0 maps to 0A
          - 0 -> 0
          # Known load: 4.0A
          # Value shown in logs: 0.1333A
          - 0.31749 -> 8.95608

  - platform: ct_clamp
    sensor: ai14
    name: "Measured Current-14"
    update_interval: 60s
    filters:
      - calibrate_linear:
          # Measured value of 0 maps to 0A
          - 0 -> 0
          # Known load: 4.0A
          # Value shown in logs: 0.1333A
          - 0.31749 -> 8.95608

  - platform: ct_clamp
    sensor: ai15
    name: "Measured Current-15"
    update_interval: 60s
    filters:
      - calibrate_linear:
          # Measured value of 0 maps to 0A
          - 0 -> 0
          # Known load: 4.0A
          # Value shown in logs: 0.1333A
          - 0.31749 -> 8.95608

  - platform: ct_clamp
    sensor: ai16
    name: "Measured Current-16"
    update_interval: 60s
    filters:
      - calibrate_linear:
          # Measured value of 0 maps to 0A
          - 0 -> 0
          # Known load: 4.0A
          # Value shown in logs: 0.1333A
          - 0.31749 -> 8.95608

time:
  - platform: sntp
    id: my_time
Reply
#3
Uploaded the code you supplied, output is attached but I filtered the results and can see the same ethernet failures

Code:
Compiling .pioenvs/m16/src/esphome/components/ethernet/esp_eth_phy_jl1101.c.o
Compiling .pioenvs/m16/src/esphome/components/ethernet/ethernet_component.cpp.o
[10:25:36][I][ethernet:248]: Starting ethernet connection
[10:25:36][W][component:157]: Component ethernet set Warning flag: waiting for IP configuration
[10:25:51][W][ethernet:265]: Connecting via ethernet failed! Re-connecting...
[10:26:06][W][ethernet:265]: Connecting via ethernet failed! Re-connecting...
[10:26:21][W][ethernet:265]: Connecting via ethernet failed! Re-connecting...
[10:26:36][W][ethernet:265]: Connecting via ethernet failed! Re-connecting...
[10:26:51][W][ethernet:265]: Connecting via ethernet failed! Re-connecting...
[10:27:06][W][ethernet:265]: Connecting via ethernet failed! Re-connecting...
[10:27:21][W][ethernet:265]: Connecting via ethernet failed! Re-connecting...
[10:27:36][W][ethernet:265]: Connecting via ethernet failed! Re-connecting...
[10:27:51][W][ethernet:265]: Connecting via ethernet failed! Re-connecting...
[10:28:06][W][ethernet:265]: Connecting via ethernet failed! Re-connecting...
[10:28:21][W][ethernet:265]: Connecting via ethernet failed! Re-connecting...
[10:28:36][W][ethernet:265]: Connecting via ethernet failed! Re-connecting...
[10:28:51][W][ethernet:265]: Connecting via ethernet failed! Re-connecting...
[10:29:06][W][ethernet:265]: Connecting via ethernet failed! Re-connecting...
[10:29:21][W][ethernet:265]: Connecting via ethernet failed! Re-connecting...
[10:29:36][W][ethernet:265]: Connecting via ethernet failed! Re-connecting...
[10:29:51][W][ethernet:265]: Connecting via ethernet failed! Re-connecting...
[10:30:06][W][ethernet:265]: Connecting via ethernet failed! Re-connecting...
[10:30:21][W][ethernet:265]: Connecting via ethernet failed! Re-connecting...
[10:30:36][W][ethernet:265]: Connecting via ethernet failed! Re-connecting...
[10:30:51][W][ethernet:265]: Connecting via ethernet failed! Re-connecting...
[10:31:06][W][ethernet:265]: Connecting via ethernet failed! Re-connecting...
[10:31:21][W][ethernet:265]: Connecting via ethernet failed! Re-connecting...
[10:31:36][W][ethernet:265]: Connecting via ethernet failed! Re-connecting...
[10:31:51][W][ethernet:265]: Connecting via ethernet failed! Re-connecting...
[10:32:06][W][ethernet:265]: Connecting via ethernet failed! Re-connecting...


A full reboot of the unit sees the same errors in the logs.


Attached Files
.zip   m16output.txt.zip (Size: 23.3 KB / Downloads: 215)
Reply
#4
do you have re power on of board?
Reply
#5
Sorry what is "re power"

I rebooted the board yes.

I will test now removing the PoE board and use the power adapter to power the board.

Yes same errors with the PoE board removed and using the power brick that came with the unit. After flashing I got the error, powered the unit off and reconnected after 20 seconds and the same error about unable to get IP.

If I put that ethernet cable into my computer it connects to the ethernet and gets an IP ok.
Reply
#6
re power on = power off board -> power on board.
Reply
#7
Yes I did this and same result.
Reply
#8
if really can't work, add whatsapp number: +86-15381188302 tell us your order number, where you buy from. when you bought.
Reply


Forum Jump:


Users browsing this thread:
1 Guest(s)