esphome / issues

Issue Tracker for ESPHome
https://esphome.io/
290 stars 36 forks source link

st7789v does not work together with esp32_ble_tracker #1336

Open obodnikov opened 4 years ago

obodnikov commented 4 years ago

Operating environment/Installation (Hass.io/Docker/pip/etc.):

pip3 under Ubuntu 20.04 and pip3 under MacOS

ESP (ESP32/ESP8266, Board/Sonoff):

TTGO T-Display module

ESPHome version (latest production, beta, dev branch)

ESPHome v1.15.0-dev

Affected component:

https://next.esphome.io/components/display/st7789v.html https://next.esphome.io/components/text_sensor/ble_scanner.html

Description of problem:

Display st7789v do not work together with ble scanner. If I comment it in YAML file program work just fine. I tried to delete everything except these two components but failed. Only deleting ble scanner make it possible to work display. Also possible to completely remove WiFi then ble will work together with display

Also I tried to use different arduino_version - also with the same result

Problem-relevant YAML-configuration entries:

PASTE YAML FILE HERE

substitutions:
  prefix_topic: "/sqowe"
  device_name: "ble2mqtt4disp02"
  soil_sensor01: "80:EA:CA:89:5F:41"
  soil_sensor01_name: "MiFlora 01"

esphome:
  name: ${device_name}
  platform: ESP32
  board: featheresp32
  arduino_version: latest

# WiFi configuration
#<<: !include ../includes/wifi_korosbanya.yaml
wifi:
  ssid: ""
  password: ""
  manual_ip:
    static_ip: 192.168.20.9
    gateway: 192.168.20.1
    subnet: 255.255.255.0
    dns1: 192.168.20.1

# Time configuration
<<: !include ../includes/time.yaml

#esp32_ble_tracker:
#
#binary_sensor:
# - platform: ble_presence
#    mac_address: ${soil_sensor01}
#   id: soil_sensor01
#    name: ${soil_sensor01_name}
#    state_topic: ${prefix_topic}/${device_name}/${soil_sensor01}/LWT
#    retain: true

#sensor:
#  - platform: xiaomi_hhccjcy01
#    mac_address: ${soil_sensor01}
#    temperature:
#      name: ${soil_sensor01_name} Temperature
#      state_topic: ${prefix_topic}/${device_name}/${soil_sensor01}/temp
#      retain: false
#    moisture:
#      name: ${soil_sensor01_name} Moisture
#      state_topic: ${prefix_topic}/${device_name}/${soil_sensor01}/moisture
#      retain: false
#    illuminance:
#      name: ${soil_sensor01_name} Illuminance
#      state_topic: ${prefix_topic}/${device_name}/${soil_sensor01}/illuminance
#      retain: false
#    conductivity:
#      name: ${soil_sensor01_name} Conductivity
#      state_topic: ${prefix_topic}/${device_name}/${soil_sensor01}/conductivity
#      retain: false
#    battery_level:
#      name:  ${soil_sensor01_name} Battery Level
#      state_topic: ${prefix_topic}/${device_name}/${soil_sensor01}/battery
#      retain: false

text_sensor:
  - platform: mqtt_subscribe
    name: "Local temp"
    id: LocalTempInternet
    topic: /sqowe/korosbanya/localCurrentTemperature
  - platform: mqtt_subscribe
    name: "Condition for today"
    id: LocalForecastInternet
    topic: /sqowe/korosbanya/localDailyForecastTodayCondition

#include Fonts
font:
  - file: '../fonts/truetype/freefont/FreeSerifBold.ttf'
    id: font_FreeSerif24
    size: 24

spi:
  clk_pin: GPIO18
  mosi_pin: GPIO19

color:
  - id: my_red
    red: 100%
    green: 0%
    blue: 0%
  - id: my_yellow
    red: 100%
    green: 100%
    blue: 0%
  - id: my_green
    red: 0%
    green: 100%
    blue: 0%
  - id: my_blue
    red: 0%
    green: 0%
    blue: 100%
  - id: my_gray
    red: 50%
    green: 50%
    blue: 50%

display:
  - platform: st7789v
    backlight_pin: GPIO4
    cs_pin: GPIO5
    dc_pin: GPIO16
    reset_pin: GPIO23
    rotation: 270
    lambda: |-
      it.strftime(128, 50, id(font_FreeSerif24), id(my_blue), TextAlign::TOP_RIGHT, "%H:%M", id(sntp_time).now());

# Common logger/OTA settings
<<: !include ../includes/add_korosbanya.yaml

# Common MQTT settings
<<: !include ../includes/mqtt/mqtt_korosbanya.yaml

Logs (if applicable):

PASTE DEBUG LOG HERE

INFO Successfully uploaded program.
INFO Starting log output from /dev/cu.SLAB_USBtoUART with baud rate 115200
[16:05:12][I][logger:166]: Log initialized
[16:05:12][C][ota:366]: There have been 0 suspected unsuccessful boot attempts.
[16:05:12][I][app:028]: Running through setup()...
[16:05:12][C][spi:022]: Setting up SPI bus...
[16:05:13][D][esp32_ble_tracker:148]: Starting scan...
[16:05:13][C][st7789v:010]: Setting up SPI ST7789V...
[16:05:13][C][wifi:033]: Setting up WiFi...
[16:05:13][D][wifi:305]: Starting scan...
[16:05:13][E][ESPmDNS.cpp:65] begin(): Failed starting MDNS
[16:05:13][E][ESPmDNS.cpp:148] addService(): Failed adding service http.tcp.
[16:05:13]
[16:05:13][E][ESPmDNS.cpp:167] addServiceTxt(): Failed setting service TXT
[16:05:15][D][wifi:320]: Found networks:
[16:05:15][D][wifi:322]:   No network found!
[16:05:19][D][esp32_ble_tracker:544]: Found device 80:EA:CA:89:5F:41 RSSI=-80
[16:05:19][D][esp32_ble_tracker:565]:   Address Type: PUBLIC
[16:05:19][D][esp32_ble_tracker:567]:   Name: 'Flower care'
[16:05:20][D][wifi:305]: Starting scan...
[16:05:21][D][wifi:320]: Found networks:
[16:05:21][D][wifi:322]:   No network found!
[16:05:23][D][esp32_ble_tracker:544]: Found device 56:06:E5:FA:9A:A6 RSSI=-94
[16:05:23][D][esp32_ble_tracker:565]:   Address Type: RANDOM
[16:05:26][D][wifi:305]: Starting scan...
[16:05:28][D][wifi:320]: Found networks:
[16:05:28][D][wifi:322]:   No network found!
[16:05:33][D][wifi:305]: Starting scan...
[16:05:34][D][wifi:320]: Found networks:
[16:05:34][D][wifi:322]:   No network found!
[16:05:39][D][wifi:305]: Starting scan...
[16:05:41][D][wifi:320]: Found networks:
[16:05:41][D][wifi:322]:   No network found!
[16:05:46][D][wifi:305]: Starting scan...
[16:05:47][D][wifi:320]: Found networks:
[16:05:47][D][wifi:322]:   No network found!
[16:05:52][D][wifi:305]: Starting scan...
[16:05:53][D][wifi:320]: Found networks:
[16:05:53][D][wifi:322]:   No network found!
[16:05:53][W][wifi:495]: Restarting WiFi adapter...
[16:05:59][D][wifi:305]: Starting scan...
[16:05:59][D][esp-idf:000]: E (47948) phy_init: failed to allocate memory for RF calibration data
[16:05:59]
[16:05:59]abort() was called at PC 0x400e7c11 on core 0
[16:05:59]
[16:05:59]Backtrace: 0x400923bc:0x3fff71c0 0x400925ed:0x3fff71e0 0x400e7c11:0x3fff7200 0x40106948:0x3fff7230 0x40106a4b:0x3fff7260 0x40106d6a:0x3fff7290 0x4010302e:0x3fff72c0 0x4009550b:0x3fff72e0 0x4008eb05:0x3fff7320
WARNING Found stack trace! Trying to decode it
INFO Need to fetch platformio IDE-data, please stand by
INFO Running:  platformio run -d ble2mqtt4disp02 -t idedata
WARNING Decoded 0x400923bc: invoke_abort at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/panic.c:707
WARNING Decoded 0x400925ed: abort at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/panic.c:707
WARNING Decoded 0x400e7c11: esp_phy_load_cal_and_init at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/phy_init.c:579 (discriminator 2)
WARNING Decoded 0x40106948: wifi_rf_phy_enable
WARNING Decoded 0x40106a4b: wifi_hw_start
WARNING Decoded 0x40106d6a: wifi_start_process
WARNING Decoded 0x4010302e: ieee80211_ioctl_process
WARNING Decoded 0x4009550b: ppTask
WARNING Decoded 0x4008eb05: vPortTaskWrapper at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port.c:355 (discriminator 1)
[16:06:27]
[16:06:27]Rebooting...
[16:06:27]ets Jun  8 2016 00:22:57

Additional information and things you've tried:

OttoWinter commented 4 years ago

Issue is that the ESP32 runs out of memory (and ESP32 BLE stack uses a lot of memory).

Related: https://github.com/esphome/feature-requests/issues/810

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

geiseri commented 3 years ago

This is still an issue with 1.15.3.

alb4tor commented 3 years ago

This is still an issue with 1.15.3.

I can confirm this.

Is there any options to make it less memory hungry ?

met67 commented 3 years ago

I have exactly the same problem 😢 Any hope to somehow solve this?

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

geiseri commented 3 years ago

bump

met67 commented 3 years ago

Seems like the new esp-idf framework solves this issue... I managed do have BLE, Display and Wi-Fi at the same time (still too young to use in production, IMHO, but on the right path) https://esphome.io/changelog/2021.10.0.html#esp-idf