esphome / issues

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

m5stick cplus - cannot have both wifi and ble tracker at the same time #3664

Open evrardjp opened 1 year ago

evrardjp commented 1 year ago

The problem

If I am adding esp32_ble_tracker on my config (regardless of the scan_parameters), the wifi doesn't connect.

Which version of ESPHome has the issue?

2022.9.2 (running from docker image sha256:791c8f1475d64389332702d50205175ade9b55a6a562ad2e81d)

What type of installation are you using?

Docker

Which version of Home Assistant has the issue?

Not using HA

What platform are you using?

ESP32

Board

m5stick-c

Component causing the issue

unknown. maybe esp32_ble_tracker, maybe wifi, maybe other

Example YAML snippet

See https://github.com/evrardjp/m5stick-cplus-esphome/blob/main/config.yaml .
Removing the comment https://github.com/evrardjp/m5stick-cplus-esphome/blob/8540a472babf256420a08fa184232abc93234d3c/config.yaml#L100 will make it fail.

Anything in the logs that might be useful for us?

In a nutshell:

[12:03:28][W][wifi_esp32:057]: Setting WiFi mode failed!
[12:03:28][E][wifi:301]: wifi_sta_connect_ failed!

See also log here: https://gist.github.com/evrardjp/41102f19964d507c45cd5cec85d2c976 I am curious on why esp-idf is logged here, I never asked for esp-idf, but I am new to all of this :)

Additional information

No response

evrardjp commented 1 year ago

As I am very new to this, and I am very close to John Snow in this topics (I know nothing), I am naturally inclined to say it might be a memory issue (malloc buffer fail, expected to init 16 rx buffer, actual is 0) . If you need extra logs, please feel free to contact me.

evrardjp commented 1 year ago

How can I investigate this further? Any help is welcomed.

arthurkomatsu commented 1 year ago

@evrardjp https://github.com/esphome/issues/issues/2112

evrardjp commented 1 year ago

I had a look (before and after your comment) and I considered the issues different (that's why I created this one). The problem looks the same, but the trace is different. I am new, so maybe it IS the same... any help on how to drill further is welcomed.

kdorff commented 1 year ago

I've discovered that if I use wifi + my ili9341 display it's fine, but I run out of RAM if I also add in the bluetooth_proxy and it boot loops trying to initialize wifi. I wonder if either of you are hitting an out of RAM issue, too.

evrardjp commented 1 year ago

Might be a RAM issue, I don't know, I am lost at the debugging bit ;) Moved to another esp32 board without issues, so I am leaving this open-ed until I can debug this further, but FYI my priorities have changed.

kdorff commented 1 year ago

Might be a RAM issue, I don't know, I am lost at the debugging bit ;) Moved to another esp32 board without issues, so I am leaving this open-ed until I can debug this further, but FYI my priorities have changed.

Should you decide to come back to it, I discovered it was a RAM issue by connecting the device over USB, asking ESPHome for logs over USB, and clicking "Reset Device". This enabled me to the logs right from startup, allowing me to see where it was Wifi initialization was complaining about RAM.

I don't have this RAM issue when I use the much lower resolution 2.42" OLED (128x64) SSD1306/1309 - I can use the bluetooth proxy on those devices that are otherwise doing about the same work (maybe fewer fonts). But the touchscreen and increased resolution of the ili9341 is nice.

github-actions[bot] commented 1 year 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.