esphome / issues

Issue Tracker for ESPHome
https://esphome.io/
285 stars 34 forks source link

A02YYUW ultrasonic sensor - too many messages and stuck #5763

Closed bigboban closed 2 weeks ago

bigboban commented 2 weeks ago

The problem

I have A02YYUW connected to ESP32. Everything works good, measurement is ok. BUT. Sensor component generates hundreds of messages and also measurements and changes. It generates tens of message per second!

After few minutes log start to show many messages "ERROR: Too many messages queued" and measurement stops working and i need to restart ESP to fix it for few minutes again. A think ESP is somehow overloaded with that large number of messages/measurements. Component A02YYUW has no option to limit update rate (measurement count per second).

I have this sensor (UART AUTOMATIC): https://vi.aliexpress.com/item/1005005543253128.html

Which version of ESPHome has the issue?

2024.4.0

What type of installation are you using?

Home Assistant Add-on

Which version of Home Assistant has the issue?

No response

What platform are you using?

ESP32

Board

Wroom-32

Component causing the issue

A02YYUW

Example YAML snippet

sensor:
  - platform: "a02yyuw"
    name: "Distance"

uart:
  tx_pin: GPIO14
  rx_pin: GPIO27
  baud_rate: 9600

Anything in the logs that might be useful for us?

11:13:48    [D] [sensor:094]    
'Distance': Sending state 2005.00000 mm with 0 decimals of accuracy
11:13:48    [D] [sensor:094]    
'Distance': Sending state 2005.00000 mm with 0 decimals of accuracy
11:13:48    [D] [sensor:094]    
'Distance': Sending state 2005.00000 mm with 0 decimals of accuracy
11:13:48    [D] [sensor:094]    
'Distance': Sending state 2005.00000 mm with 0 decimals of accuracy
11:13:48    [D] [sensor:094]    
'Distance': Sending state 2003.00000 mm with 0 decimals of accuracy
11:13:48    [D] [sensor:094]    
'Distance': Sending state 2003.00000 mm with 0 decimals of accuracy
11:13:48    [D] [sensor:094]    
'Distance': Sending state 2005.00000 mm with 0 decimals of accuracy
11:13:48    [D] [sensor:094]    
'Distance': Sending state 2005.00000 mm with 0 decimals of accuracy
11:13:48    [D] [sensor:094]    
'Distance': Sending state 2005.00000 mm with 0 decimals of accuracy
11:13:48    [D] [sensor:094]    
'Distance': Sending state 2005.00000 mm with 0 decimals of accuracy
11:13:49    [D] [sensor:094]    
'Distance': Sending state 2005.00000 mm with 0 decimals of accuracy
11:13:49    [D] [sensor:094]    
'Distance': Sending state 2005.00000 mm with 0 decimals of accuracy
11:13:49    [D] [sensor:094]    
'Distance': Sending state 2005.00000 mm with 0 decimals of accuracy
11:13:49    [D] [sensor:094]    
'Distance': Sending state 2005.00000 mm with 0 decimals of accuracy
11:13:49    [D] [sensor:094]    
'Distance': Sending state 2005.00000 mm with 0 decimals of accuracy
11:13:49    [D] [sensor:094]    
'Distance': Sending state 2005.00000 mm with 0 decimals of accuracy
11:13:49    [D] [sensor:094]    
'Distance': Sending state 2005.00000 mm with 0 decimals of accuracy
11:13:49    [D] [sensor:094]    
'Distance': Sending state 2005.00000 mm with 0 decimals of accuracy
11:13:49    [D] [sensor:094]    
'Distance': Sending state 2005.00000 mm with 0 decimals of accuracy
11:13:49    [D] [sensor:094]    
'Distance': Sending state 2005.00000 mm with 0 decimals of accuracy
11:13:49    [D] [sensor:094]    
'Distance': Sending state 2005.00000 mm with 0 decimals of accuracy
11:13:49    [D] [sensor:094]    
'Distance': Sending state 2005.00000 mm with 0 decimals of accuracy
11:13:49    [D] [sensor:094]    
'Distance': Sending state 2005.00000 mm with 0 decimals of accuracy
11:13:49    [D] [sensor:094]    
'Distance': Sending state 2005.00000 mm with 0 decimals of accuracy
11:14:29    [D] [sensor:094]    
'Distance': Sending state 2005.00000 mm with 0 decimals of accuracy
11:14:29    [D] [sensor:094]    
'Distance': Sending state 2005.00000 mm with 0 decimals of accuracy
11:14:29    [D] [sensor:094]    
'Distance': Sending state 2005.00000 mm with 0 decimals of accuracy
11:14:29    [D] [sensor:094]    
'Distance': Sending state 2005.00000 mm with 0 decimals of accuracy
11:14:29    [D] [sensor:094]    
'Distance': Sending state 2005.00000 mm with 0 decimals of accuracy
11:14:29    [D] [sensor:094]    
'Distance': Sending state 2005.00000 mm with 0 decimals of accuracy
11:14:29    [D] [sensor:094]    
'Distance': Sending state 2005.00000 mm with 0 decimals of accuracy
11:14:29    [D] [sensor:094]    
'Distance': Sending state 2005.00000 mm with 0 decimals of accuracy
11:14:29    [D] [sensor:094]    
'Distance': Sending state 2005.00000 mm with 0 decimals of accuracy
11:14:29    [D] [sensor:094]    
'Distance': Sending state 2005.00000 mm with 0 decimals of accuracy

.....

ERROR: Too many messages queued
ERROR: Too many messages queued
[D][sensor:094]: 'Distance': Sending state 2005.00000 mm with 0 decimals of accuracy
ERROR: Too many messages queued
ERROR: Too many messages queued
[D][sensor:094]: 'Distance': Sending state 2005.00000 mm with 0 decimals of accuracy
ERROR: Too many messages queued
ERROR: Too many messages queued
[D][sensor:094]: 'Distance': Sending state 2005.00000 mm with 0 decimals of accuracy
ERROR: Too many messages queued
ERROR: Too many messages queued
[D][sensor:094]: 'Distance': Sending state 2005.00000 mm with 0 decimals of accuracy
ERROR: Too many messages queued
ERROR: Too many messages queued
[D][sensor:094]: 'Distance': Sending state 1799.00000 mm with 0 decimals of accuracy
ERROR: Too many messages queued
ERROR: Too many messages queued
[D][sensor:094]: 'Distance': Sending state 1795.00000 mm with 0 decimals of accuracy
ERROR: Too many messages queued
ERROR: Too many messages queued
[D][sensor:094]: 'Distance': Sending state 1799.00000 mm with 0 decimals of accuracy
ERROR: Too many messages queued
ERROR: Too many messages queued
[D][sensor:094]: 'Distance': Sending state 1795.00000 mm with 0 decimals of accuracy
ERROR: Too many messages queued
ERROR: Too many messages queued
[D][sensor:094]: 'Distance': Sending state 1799.00000 mm with 0 decimals of accuracy
ERROR: Too many messages queued
ERROR: Too many messages queued
[D][sensor:094]: 'Distance': Sending state 1799.00000 mm with 0 decimals of accuracy
ERROR: Too many messages queued
ERROR: Too many messages queued
[D][sensor:094]: 'Distance': Sending state 2005.00000 mm with 0 decimals of accuracy
ERROR: Too many messages queued
ERROR: Too many messages queued
[D][sensor:094]: 'Distance': Sending state 1799.00000 mm with 0 decimals of accuracy
ERROR: Too many messages queued
ERROR: Too many messages queued
[D][sensor:094]: 'Distance': Sending state 1795.00000 mm with 0 decimals of accuracy
ERROR: Too many messages queued
ERROR: Too many messages queued
[D][sensor:094]: 'Distance': Sending state 1799.00000 mm with 0 decimals of accuracy
ERROR: Too many messages queued

Additional information

No response

ssieb commented 2 weeks ago

Use a filter.