Multiple DS18B20s with 1-wire

I have several ESP32s with 1, 2 or 3 DS18B20 temperature sensors on one GPIO pin on each ESP32. In June, I updated ESPHome to 2024.6.0 and successfully updated the code for the ESP32s with 1 or 2 DS18B200s attached. I have now dusted-off my ESP32 with 3 DS18B20s and after updating the code to use the 1-wire component I find that it will no longer connect by Wi-Fi, citing Errno113. It worked prior to 2024.6.0 with the old Dallas component. I’ve tried another ESP32. I’ve also tried searching for other references to this issue, without success. Is there a known issue?

Perhaps you could share your code? My ESP runs with 7 18B20 attached, and it did before that 1-wire change aswell as from that point onewards without a problem.

Here it is:

esphome:
  name: esp32-4
  friendly_name: ESP32-4

esp32:
  board: esp32dev
  framework:
    type: arduino

one_wire:
  - platform: gpio
    pin: GPIO32

sensor:
- platform: dallas_temp
  address: 0x466dcbd445a6e128
  name: "Sensor 1"
- platform: dallas_temp
  address: 0x2a4554d446913b28
  name: "Sensor 2"
- platform: dallas_temp
  address: 0x06036cd446e46728
  name: "Sensor 3"

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

ota:
  platform: esphome
  password: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  manual_ip:
    static_ip: 192.168.0.214
    gateway: 192.168.0.1
    subnet: 255.255.255.0

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

captive_portal:

And this is the logfile:

INFO ESPHome 2024.9.1
INFO Reading configuration /config/esphome/esp32-4.yaml...
INFO Starting log output from 192.168.0.214 using esphome API
WARNING Can't connect to ESPHome API for esp32-4 @ 192.168.0.214: Error connecting to [AddrInfo(family=<AddressFamily.AF_INET: 2>, type=<SocketKind.SOCK_STREAM: 1>, proto=6, sockaddr=IPv4Sockaddr(address='192.168.0.214', port=6053))]: [Errno 113] Connect call failed ('192.168.0.214', 6053) (SocketAPIError)
INFO Trying to connect to esp32-4 @ 192.168.0.214 in the background

Dammit, nothing fancy in the code.

Hopefully it’s not soldered, you could try
a) without the sensors if the ESP remains connected to the WIFI.
In case it does you might want to check the power supply?

b) add a line after the logger: line

logger:
  level: debug

and perhaps add:

web_server:
  port: 80

so you could simply open a browserview on 192.168.0.214 to get a live view of the device.

Only difference I got is
there’s a line

  platform: ESP32

inside the “esphome:” section
and my board is simply

  board: nodemcu-32s

since I found out that this works for next to all my ESPs I got.

and finally my “wifi:” section got a line

 dns1: xxx.xxx.xxx.xxx <== IP

but that’s likely because of the gateway doesn’t the DHCP server but my pihole does.

Thanks. I tried some of those before concluding that it’s an IP routing issue. It works with the USB power lead connected to a PC, avoiding WiFi. My TPLink Deco WiFi hubs also have a DHCP facility, which is disabled but I’ve had issues in the past where they can they can decide to allocate an IP address, regardless. It’s a PITA. This will take some time to re-research and sort out. A short-cut may be to crack-open a fresh ESP32 :wink: