Skip to content
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: Wifi logs cannot be configured #16

Closed
bjoernQ opened this issue Apr 7, 2022 · 7 comments · Fixed by #18 or #293
Closed

ESP32: Wifi logs cannot be configured #16

bjoernQ opened this issue Apr 7, 2022 · 7 comments · Fixed by #18 or #293
Labels
help wanted Extra attention is needed

Comments

@bjoernQ
Copy link
Contributor

bjoernQ commented Apr 7, 2022

Calling esp_wifi_internal_set_log_level or esp_wifi_internal_set_log_mod crashes immediately or cause crashes later (depending on when those are called) - so Wifi logs are never enabled on ESP32 (i.e. it works fine on ESP32C3)

Additionally there is a problem with VaList on ESP32 (or Xtensa in general) - that's why it's conditionally compiled only for ESP32C3 in log_writev

@MabezDev
Copy link
Member

MabezDev commented Apr 7, 2022

I've been applying this patch for vaarg support. I've never personally used vaargs, so it's quite possible this patch is buggy, or is missing some other steps?

@bjoernQ
Copy link
Contributor Author

bjoernQ commented Apr 7, 2022

Awesome - will give it a try. Long time since I built the compiler myself the last time 😄

@MabezDev
Copy link
Member

MabezDev commented Apr 7, 2022

Just to be clear, it's already included in the esp-* branch patch set, so it should already be working.

@bjoernQ
Copy link
Contributor Author

bjoernQ commented Apr 11, 2022

The va_list implementation seems to be fine since I can use it with some C code written myself and compiled with GCC. However, the va_list I get from the WiFi driver looks different. For now, I just print the format string on ESP32 which is better than having nothing. Still an interesting and valid issue so keep it open

No idea what I tested back then - here is an issue including a way to reproduce it easily: esp-rs/rust#177

@bjoernQ
Copy link
Contributor Author

bjoernQ commented May 16, 2023

Unfortunately esp-rs/rust#171 doesn't fix this

@bjoernQ
Copy link
Contributor Author

bjoernQ commented May 17, 2023

Alternatively, we could implement syslog, log_write and log_writev in C until a fix is available.

@karlri
Copy link
Contributor

karlri commented Jun 29, 2023

This is an ugly hack but it works. It's not very invasive because it replaces only exactly the function call that bugs out. Not likely woth a PR but if anyone is interested in trying it out, here it is (implemented for esp32 only): 8befe40

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
Archived in project
3 participants