Nodemcu pierde conexion

Hello everyone. I have a nodemcu connected to a board with 8 relays. Seeing the history of the relays approximately every three minutes is no longer available and I think that affects the automations. What can I check to know what is happening. Thank you very much

English please Pablo.

Sorry. my mistake

1 Like

Thank you.

If it is happening every 3 minutes you should be able to capture what is going on by looking at the log for the device in the ESPHome add-on.

This is what I get from the log.

INFO Reading configuration /config/esphome/meteo.yaml...
WARNING GPIO0 is a Strapping PIN and should be avoided.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See https://esphome.io/guides/faq.html#why-am-i-getting-a-warning-about-strapping-pins
WARNING GPIO2 is a Strapping PIN and should be avoided.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See https://esphome.io/guides/faq.html#why-am-i-getting-a-warning-about-strapping-pins
WARNING GPIO4 is a Strapping PIN and should be avoided.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See https://esphome.io/guides/faq.html#why-am-i-getting-a-warning-about-strapping-pins
INFO Starting log output from 192.168.1.200 using esphome API
INFO Successfully connected to 192.168.1.200
[09:55:35][I][app:102]: ESPHome version 2022.4.0 compiled on Apr 27 2022, 09:54:23
[09:55:35][C][wifi:491]: WiFi:
[09:55:35][C][wifi:353]:   Local MAC: 3C:71:BF:93:89:C0
[09:55:35][C][wifi:354]:   SSID: 'IOT-Home'[redacted]
[09:55:35][C][wifi:355]:   IP Address: 192.168.1.200
[09:55:35][C][wifi:357]:   BSSID: C0:25:2F:6D:5E:2C[redacted]
[09:55:35][C][wifi:358]:   Hostname: 'meteo'
[09:55:35][C][wifi:360]:   Signal strength: -57 dB ▂▄▆█
[09:55:35][C][wifi:364]:   Channel: 1
[09:55:35][C][wifi:365]:   Subnet: 255.255.255.0
[09:55:35][C][wifi:366]:   Gateway: 192.168.1.1
[09:55:35][C][wifi:367]:   DNS1: 0.0.0.0
[09:55:35][C][logger:233]: Logger:
[09:55:35][C][logger:234]:   Level: DEBUG
[09:55:35][C][logger:235]:   Log Baud Rate: 115200
[09:55:35][C][logger:236]:   Hardware UART: UART0
[09:55:36][C][switch.gpio:050]: GPIO Switch 'Relay 1'
[09:55:36][C][switch.gpio:050]:   Inverted: YES
[09:55:36][C][switch.gpio:051]:   Pin: GPIO0
[09:55:36][C][switch.gpio:073]:   Restore Mode: Always OFF
[09:55:36][C][switch.gpio:050]: GPIO Switch 'Relay 2'
[09:55:36][C][switch.gpio:050]:   Inverted: YES
[09:55:36][C][switch.gpio:051]:   Pin: GPIO2
[09:55:36][C][switch.gpio:073]:   Restore Mode: Always OFF
[09:55:36][C][switch.gpio:050]: GPIO Switch 'Relay 3'
[09:55:36][C][switch.gpio:050]:   Inverted: YES
[09:55:36][C][switch.gpio:051]:   Pin: GPIO4
[09:55:36][C][switch.gpio:073]:   Restore Mode: Always OFF
[09:55:36][C][switch.gpio:050]: GPIO Switch 'Relay 4'
[09:55:36][C][switch.gpio:050]:   Inverted: YES
[09:55:36][C][switch.gpio:051]:   Pin: GPIO5
[09:55:36][C][switch.gpio:073]:   Restore Mode: Always OFF
[09:55:36][C][switch.gpio:050]: GPIO Switch 'Relay 5'
[09:55:36][C][switch.gpio:050]:   Inverted: YES
[09:55:36][C][switch.gpio:051]:   Pin: GPIO18
[09:55:36][C][switch.gpio:073]:   Restore Mode: Always OFF
[09:55:36][C][switch.gpio:050]: GPIO Switch 'Relay 6'
[09:55:36][C][switch.gpio:050]:   Inverted: YES
[09:55:36][C][switch.gpio:051]:   Pin: GPIO19
[09:55:36][C][switch.gpio:073]:   Restore Mode: Always OFF
[09:55:36][C][switch.gpio:050]: GPIO Switch 'Relay 7'
[09:55:36][C][switch.gpio:050]:   Inverted: YES
[09:55:36][C][switch.gpio:051]:   Pin: GPIO21
[09:55:36][C][switch.gpio:073]:   Restore Mode: Always OFF
[09:55:36][C][switch.gpio:050]: GPIO Switch 'Relay 8'
[09:55:36][C][switch.gpio:050]:   Inverted: YES
[09:55:36][C][switch.gpio:051]:   Pin: GPIO22
[09:55:36][C][switch.gpio:073]:   Restore Mode: Always OFF
[09:55:36][C][captive_portal:088]: Captive Portal:
[09:55:36][C][mdns:084]: mDNS:
[09:55:36][C][mdns:085]:   Hostname: meteo
[09:55:36][C][ota:085]: Over-The-Air Updates:
[09:55:36][C][ota:086]:   Address: 192.168.1.200:3232
[09:55:36][C][ota:089]:   Using Password.
[09:55:36][C][api:138]: API Server:
[09:55:36][C][api:139]:   Address: 192.168.1.200:6053
[09:55:36][C][api:143]:   Using noise encryption: NO
INFO 192.168.1.200: Ping timed out!
INFO Disconnected from ESPHome API for 192.168.1.200
WARNING Disconnected from API
INFO Successfully connected to 192.168.1.200
INFO 192.168.1.200: Ping timed out!
INFO Disconnected from ESPHome API for 192.168.1.200
WARNING Disconnected from API
INFO Successfully connected to 192.168.1.200
[09:59:15][D][switch:013]: 'Relay 1' Turning ON.
[09:59:15][D][switch:037]: 'Relay 1': Sending state ON
[10:00:00][D][switch:013]: 'Relay 6' Turning ON.
[10:00:00][D][switch:037]: 'Relay 6': Sending state ON
[10:00:14][I][ota:105]: Boot seems successful, resetting boot loop counter.
[10:00:14][D][esp32.preferences:114]: Saving preferences to flash...
[10:00:31][D][switch:017]: 'Relay 1' Turning OFF.
[10:00:31][D][switch:037]: 'Relay 1': Sending state OFF
[10:00:32][D][switch:013]: 'Relay 1' Turning ON.
[10:00:32][D][switch:037]: 'Relay 1': Sending state ON
[10:01:30][W][api.connection:081]: Home Assistant 2022.4.7 (::FFFF:C0A8:104): Connection reset
[10:01:31][D][api:102]: Accepted ::FFFF:C0A8:104
[10:01:31][D][api.connection:827]: Home Assistant 2022.4.7 (::FFFF:C0A8:104): Connected successfully

This is the historical

Read the three warnings at the start of the log. Can you use alternative GPIOs?

Yes, i can. It can be that? When I get home from work I change it. Thank you

In another device it also seems to be disconnected because it does not show me all the data collection

INFO Reading configuration /config/esphome/enchufe-wifi-reposicion.yaml...
INFO Starting log output from 192.168.1.30 using esphome API
INFO Successfully connected to 192.168.1.30
[10:20:43][I][app:102]: ESPHome version 2022.4.0 compiled on Apr 22 2022, 19:00:29
[10:20:43][C][wifi:491]: WiFi:
[10:20:43][C][wifi:353]:   Local MAC: 5C:CF:7F:3B:4D:70
[10:20:43][C][wifi:354]:   SSID: 'IOT-Home'[redacted]
[10:20:43][C][wifi:355]:   IP Address: 192.168.1.30
[10:20:43][C][wifi:356]:   BSSID: C0:25:2F:6D:5E:2C[redacted]
[10:20:43][C][wifi:358]:   Hostname: 'enchufe-wifi-reposicion'
[10:20:43][C][wifi:360]:   Signal strength: -44 dB ▂▄▆█
[10:20:43][C][wifi:364]:   Channel: 1
[10:20:43][C][wifi:365]:   Subnet: 255.255.255.0
[10:20:43][C][wifi:366]:   Gateway: 192.168.1.1
[10:20:43][C][wifi:367]:   DNS1: 0.0.0.0
[10:20:43][C][wifi:368]:   DNS2: 0.0.0.0
[10:20:43][C][logger:233]: Logger:
[10:20:43][C][logger:234]:   Level: DEBUG
[10:20:43][C][logger:235]:   Log Baud Rate: 115200
[10:20:43][C][logger:236]:   Hardware UART: UART0
[10:20:43][C][switch.gpio:050]: GPIO Switch 'reposicion'
[10:20:43][C][switch.gpio:051]:   Pin: GPIO12
[10:20:43][C][switch.gpio:073]:   Restore Mode: Restore (Defaults to OFF)
[10:20:43][C][gpio.binary_sensor:015]: GPIO Binary Sensor 'reposicion'
[10:20:43][C][gpio.binary_sensor:016]:   Pin: GPIO0
[10:20:43][C][gpio.binary_sensor:015]: GPIO Binary Sensor 'enchufe-reposicion-sensor'
[10:20:43][C][gpio.binary_sensor:016]:   Pin: GPIO3
[10:20:43][C][esp8266_pwm:022]: ESP8266 PWM:
[10:20:43][C][esp8266_pwm:023]:   Pin: GPIO13
[10:20:43][C][esp8266_pwm:024]:   Frequency: 1000.0 Hz
[10:20:43][C][light:104]: Light 'Sensor enchufe resposicion'
[10:20:43][C][light:106]:   Default Transition Length: 1.0s
[10:20:43][C][light:107]:   Gamma Correct: 2.80
[10:20:43][C][dallas.sensor:075]: DallasComponent:
[10:20:43][C][dallas.sensor:076]:   Pin: GPIO3
[10:20:43][C][dallas.sensor:077]:   Update Interval: 60.0s
[10:20:43][D][dallas.sensor:082]:   Found sensors:
[10:20:43][D][dallas.sensor:084]:     0xb2031644035dff28
[10:20:43][C][dallas.sensor:089]:   Device 'Temperatura Reposicion'
[10:20:43][C][dallas.sensor:089]:     Device Class: 'temperature'
[10:20:43][C][dallas.sensor:089]:     State Class: 'measurement'
[10:20:43][C][dallas.sensor:089]:     Unit of Measurement: '°C'
[10:20:43][C][dallas.sensor:089]:     Accuracy Decimals: 1
[10:20:43][C][dallas.sensor:097]:     Address: 0xb2031644035dff28
[10:20:43][C][dallas.sensor:098]:     Resolution: 12
[10:20:43][C][status:034]: Status Binary Sensor 'enchufe-reposicion-estado'
[10:20:43][C][status:034]:   Device Class: 'connectivity'
[10:20:43][C][captive_portal:088]: Captive Portal:
[10:20:43][C][mdns:084]: mDNS:
[10:20:43][C][mdns:085]:   Hostname: enchufe-wifi-reposicion
[10:20:43][C][ota:085]: Over-The-Air Updates:
[10:20:43][C][ota:086]:   Address: 192.168.1.30:8266
[10:20:43][C][ota:089]:   Using Password.
[10:20:43][C][api:138]: API Server:
[10:20:43][C][api:139]:   Address: 192.168.1.30:6053
[10:20:43][C][api:143]:   Using noise encryption: NO
[10:21:07][D][api:102]: Accepted 192.168.1.4
[10:21:07][D][api.connection:827]: Home Assistant 2022.4.7 (192.168.1.4): Connected successfully
INFO 192.168.1.30: Ping timed out!
INFO Disconnected from ESPHome API for 192.168.1.30
WARNING Disconnected from API
INFO Successfully connected to 192.168.1.30
[10:21:13][W][api.connection:081]: Home Assistant 2022.4.7 (192.168.1.4): Connection reset
[10:21:36][D][dallas.sensor:144]: 'Temperatura Reposicion': Got Temperature=23.7°C
[10:21:36][D][sensor:124]: 'Temperatura Reposicion': Sending state 23.68750 °C with 1 decimals of accuracy
[10:22:36][D][dallas.sensor:144]: 'Temperatura Reposicion': Got Temperature=23.7°C
[10:22:36][D][sensor:124]: 'Temperatura Reposicion': Sending state 23.68750 °C with 1 decimals of accuracy
[10:23:36][D][dallas.sensor:144]: 'Temperatura Reposicion': Got Temperature=23.7°C
[10:23:36][D][sensor:124]: 'Temperatura Reposicion': Sending state 23.68750 °C with 1 decimals of accuracy
[10:24:36][D][dallas.sensor:144]: 'Temperatura Reposicion': Got Temperature=23.8°C
[10:24:36][D][sensor:124]: 'Temperatura Reposicion': Sending state 23.75000 °C with 1 decimals of accuracy
INFO 192.168.1.30: Ping timed out!
INFO Disconnected from ESPHome API for 192.168.1.30
WARNING Disconnected from API
INFO Successfully connected to 192.168.1.30
[10:25:36][W][dallas.sensor:137]: 'Temperatura Reposicion' - Scratch pad checksum invalid!
[10:25:36][D][sensor:124]: 'Temperatura Reposicion': Sending state nan °C with 1 decimals of accuracy
[10:26:36][D][dallas.sensor:144]: 'Temperatura Reposicion': Got Temperature=23.8°C
[10:26:36][D][sensor:124]: 'Temperatura Reposicion': Sending state 23.81250 °C with 1 decimals of accuracy
INFO 192.168.1.30: Ping timed out!
INFO Disconnected from ESPHome API for 192.168.1.30
WARNING Disconnected from API
INFO Successfully connected to 192.168.1.30
[10:27:26][W][api.connection:083]: Home Assistant 2022.4.7 (192.168.1.4): Connection closed
[10:27:29][D][api:102]: Accepted 192.168.1.4
[10:27:29][D][api.connection:827]: Home Assistant 2022.4.7 (192.168.1.4): Connected successfully
[10:27:36][D][dallas.sensor:144]: 'Temperatura Reposicion': Got Temperature=23.9°C
[10:27:36][D][sensor:124]: 'Temperatura Reposicion': Sending state 23.87500 °C with 1 decimals of accuracy
[10:28:36][D][dallas.sensor:144]: 'Temperatura Reposicion': Got Temperature=23.9°C
[10:28:36][D][sensor:124]: 'Temperatura Reposicion': Sending state 23.93750 °C with 1 decimals of accuracy
[10:29:36][D][dallas.sensor:144]: 'Temperatura Reposicion': Got Temperature=24.0°C
[10:29:38][D][sensor:124]: 'Temperatura Reposicion': Sending state 24.00000 °C with 1 decimals of accuracy
[10:30:36][D][dallas.sensor:144]: 'Temperatura Reposicion': Got Temperature=24.1°C
[10:30:36][D][sensor:124]: 'Temperatura Reposicion': Sending state 24.06250 °C with 1 decimals of accuracy
[10:30:55][D][api:102]: Accepted 192.168.1.4
[10:30:56][D][api.connection:827]: Home Assistant 2022.4.7 (192.168.1.4): Connected successfully
[10:31:13][W][api.connection:081]: Home Assistant 2022.4.7 (192.168.1.4): Connection reset
[10:31:36][D][dallas.sensor:144]: 'Temperatura Reposicion': Got Temperature=24.1°C
[10:31:36][D][sensor:124]: 'Temperatura Reposicion': Sending state 24.06250 °C with 1 decimals of accuracy
[10:32:36][D][dallas.sensor:144]: 'Temperatura Reposicion': Got Temperature=24.1°C
[10:32:36][D][sensor:124]: 'Temperatura Reposicion': Sending state 24.12500 °C with 1 decimals of accuracy
[10:33:36][D][dallas.sensor:144]: 'Temperatura Reposicion': Got Temperature=24.2°C
[10:33:36][D][sensor:124]: 'Temperatura Reposicion': Sending state 24.18750 °C with 1 decimals of accuracy
[10:34:30][D][api:102]: Accepted 192.168.1.4
[10:34:30][D][api.connection:827]: Home Assistant 2022.4.7 (192.168.1.4): Connected successfully
[10:34:36][W][api.connection:083]: Home Assistant 2022.4.7 (192.168.1.4): Connection closed
[10:34:36][D][dallas.sensor:144]: 'Temperatura Reposicion': Got Temperature=24.2°C
[10:34:36][D][sensor:124]: 'Temperatura Reposicion': Sending state 24.25000 °C with 1 decimals of accuracy
[10:35:36][D][dallas.sensor:144]: 'Temperatura Reposicion': Got Temperature=24.3°C
[10:35:36][D][sensor:124]: 'Temperatura Reposicion': Sending state 24.31250 °C with 1 decimals of accuracy

The light blue one is a esphome device and the other is an original sonoff

It could also be an issue with your wifi if more than one device is doing this. What sort of wifi access point do you have and how many clients are connected to it?

I have a mesh system and each node has no more than 10 devices. One of the nodes is centimeters from the nodemcu. I have no idea if it is the mesh to check or configure so that it does not happen.