New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ESP32 stops tracking Xiaomi Mijia #317
Comments
I have the same issue with another ESP32 board based on ESP32-WROOM. In my case, I also use the BLE tracker sensor and that also gets stuck. Maybe the whole Bluetooth component gets blocked. My workaround is to use the restart switch in esphome: https://esphome.io/components/switch/restart.html Currently, i just reboot them when I nottice this, but I might try to automate this in the future. |
The most likely cause is probably that the ESP-IDF has a bug somewhere and does not create a Some logs of the final successful scan could help - also some logs after could help. I see you attached logs of the problem occuring, but how long did you let the log window open? Was it more than 5 minutes? |
I opened the log after the problem occurred. I can't open the log and wait for the problem to happen, last time the problem happened after 7 days or so. |
I understand, that's why I also asked the second question about how long you left the logs open in the initial issue logs - if it's more than 5 minutes and no messages are seen that confirms my suspicion |
I left the log open for a couple of minutes, after I discovered my graphs showing a straight line. Indeed there were no messages at all. I hope this gives you insight in the problem. |
I left the log running for ~1h when I detected a failing device (hence the device was already failing when I opened the log page). Short version: nothing appeared in the logs during that hour.
|
@jesusrop Try with latest ESPHome version please - in the 1.13.4 version I cannot replicate this issue. |
Since the last update, I don't face this problem anymore. ESP32 camera does have the problem however... |
No strange behavior since update to 1.13.4. i waited a couple of days to make sure the issue is gone. I don't think that with the previous versions it would have lasted so long without loosing connection. Will try 1.13.5 today. Thanks!! |
With ESPHome 1.13.6 I still have regular disconnect (sensor becoming Please let me know how I can help to solve this issue. Context living_room_plant:
delay_on:
hours: 5
icon_template: >
{% if is_state('binary_sensor.living_room_plant' ,'on') %} mdi:flower
{% else %} mdi:flower-outline
{% endif %}
value_template: >-
{{ states('sensor.living_room_plant_moisture')|float < 20 or states('sensor.living_room_plant_conductivity')|float < 350 }}
|
@Koenkk Ok, interesting - at least I don't see any of these issues with my devices. Please post your ESPHome config (specifically anything related to arduino_version, and scan_interval if set) Also logs from the ESP32 during this happening please. |
@OttoWinter log while this happens: https://pastebin.com/8kg5d5ng Configuration esphome:
name: living_room_plant
platform: ESP32
board: nodemcu-32s
wifi:
ssid: "--"
password: "--"
logger:
api:
password: "--"
ota:
password: "--"
esp32_ble_tracker:
sensor:
- platform: xiaomi_miflora
mac_address: 'C4:7C:8D:6A:3F:E4'
temperature:
name: living_room_plant_temperature
moisture:
name: living_room_plant_moisture
illuminance:
name: living_room_plant_illuminance
conductivity:
name: living_room_plant_conductivity
battery_level:
name: living_room_plant_battery |
Your device drops off the wifi twice, for several minutes each time, in the period covered by your log file. If it's not on the network, that would probably explain why the sensors are showing as unavailable in HA. |
@brandond yes I know, I wonder if this issue has something to do with it. Initially I thought this because this is the only of my +- 15 devices running esphome that has connectivity issues, the others are rock solid. |
Do you have the ability to leave it connected over serial for a while? When you're fighting connectivity issues, being able to pull the logs locally is pretty important; you obviously can't get the logs remotely to figure out what's going on when it drops off the network. |
Here is the log: https://pastebin.com/5zQxZJsf A few observations:
Note: debug logging was activated using logger:
level: debug
debug: |
You wouldn't see logs about wifi errors since you can't connect to it to pull the logs while wifi is down - there's no buffering so you only see what's logged while you're cinnected. That's why I asked about getting logs via local serial output. That said, the wifi and ble stack on these devices use the same phy and are known to be kinda flakey so I wouldn't be surprised if the scans are causing wifi to drop. |
@brandond the log from #317 (comment) is via serial output (see first line: |
@Koenkk If the error is not logged in the ESPHome logs it's because the error occured on the other end (HA) or somewhere in the TCP/IP stack - all that could be logged would be a generic "connection dropped" because more info is not available. Maybe the HA logs contain more info (enable debug logs in logger), but otherwise the error is probably in TCP/IP stack and thus hard to track down. |
@OttoWinter I don't think HA is the issue, as also esphome logs is disconnected, left terminal shows log output via serial, right via wifi: But as this may indeed be hard to solve I currently use the following Home Assistant configuration to workaround it: binary_sensor:
- platform: template
sensors:
living_room_plant:
delay_on:
minutes: 60
value_template: >-
{% if states('sensor.living_room_plant_moisture')|float < 20 or states('sensor.living_room_plant_conductivity')|float < 350 %}
true
{% elif is_state('sensor.living_room_plant_moisture', 'unavailable') or is_state('sensor.living_room_plant_conductivity', 'unavailable') %}
{% if is_state('binary_sensor.living_room_plant', 'on') %}
true
{% else %}
false
{% endif %}
{% else %}
false
{% endif %} |
What are all those three different ip addressees?
El El jue, 11 jul. 2019 a las 17:47, Koen Kanters <notifications@github.com>
escribió:
@OttoWinter <https://github.com/OttoWinter> I don't think HA is the
error, as also esphome logs is disconnected, left terminal shows log output
via serial, right via wifi:
[image: image]
<https://user-images.githubusercontent.com/2892853/61084012-5f3fa180-a42d-11e9-8ee7-f2d10f9b19d7.png>
But as this may indeed be hard to solve I currently use the following Home
Assistant configuration to workaround it:
binary_sensor:
- platform: template
sensors:
living_room_plant:
delay_on:
minutes: 60
value_template: >- {% if states('sensor.living_room_plant_moisture')|float < 20 or states('sensor.living_room_plant_conductivity')|float < 350 %} true {% elif is_state('sensor.living_room_plant_moisture', 'unavailable') or is_state('sensor.living_room_plant_conductivity', 'unavailable') %} {% if is_state('binary_sensor.living_room_plant', 'on') %} true {% else %} false {% endif %} {% else %} false {% endif %}
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#317?email_source=notifications&email_token=AAAXPIQMLXOKSNKPUX67DHDP66L5VA5CNFSM4HNSIIPKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZX53ZI#issuecomment-510647781>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAXPISRONSZF5G2PTECCLTP66L5VANCNFSM4HNSIIPA>
.
--
*GLM*
|
@Koenkk Did you ever resolve this problem? The workaround is not ideal. I am facing the same issues you describe with an ESP-WROOM-32 (ESP32 DEVKIT V1). |
@y0ast no |
Seem to have this problem with the latest 1.14.0-dev version as well. |
Closing/merging into #735 |
Operating environment/Installation (Hass.io/Docker/pip/etc.):
ESP-32S (https://www.ebay.com/itm/ESP-32S-ESP32-NodeMCU-Development-Board-2-4GHz-WIFI-Bluetooth-Dual-Mode/272656534488?ssPageName=STRK%3AMEBIDX%3AIT&_trksid=p2057872.m2749.l2649)
Affected component:
https://esphome.io/components/sensor/xiaomi_mijia.html
Description of problem:
I'm using a Xiaomi Mijia to track temperature and humidity. After a while, sometimes 24 hours, sometimes 72 hours, it stops tracking the temperature and humidity. My graph in Hassio then shows a straight line on the temp and hum that was last measured.
After a manual reboot it starts working again. After one, two or three days it stops tracking the temperature and humidity again.
Problem-relevant YAML-configuration entries:
Traceback (if applicable):
Additional information and things you've tried:
I tried uploading the config again. That results in a reboot, which forces it to track again, temporarily.
I checked the log for error messages when it stalls. I've pasted it above, everything looks normal there.
The text was updated successfully, but these errors were encountered: