Hi,
I'm using the internal temperature sensor on ESP32-S2 as part of the overall system health monitoring. After initialization (temp_sensor_set_config() and temp_sensor_start()) there is a cyclic call to temp_sensor_read_celsius(). This is not a big deal and works as expected.
Additionally I needed to put the WiFi part into operation with station mode. Having this done and calling esp_wifi_start() I observed a weird behavior of the whole system suddenly printing task watchdog timeouts within different tasks, not reacting fluently any more, etc. pp.
Analyzing the root cause brought me to insight that the call to temp_sensor_read_celsius() never returns anymore after starting WiFi. Instead it enters an endless busy-wait loop within temp_sensor_read_raw() polling for HW register bit SENS_SAR_TSENS_CTRL_REG.SENS_TSENS_READY to become 1, which never happens anymore. Comparing the whole register value against the one when it was working showed that, as soon as WiFi gets enable, the temperature sensor HW is obvoisly powered off as the bits SENS_TSENS_POWER_UP and SENS_TSENS_POWER_UP_FORCE drop to 0 (although they were 1 prior to starting WiFi).
I could reproduce this behaviour using the simple wifi station example from IDF (using release/v4.4 branch as well as master), only adding the cyclic temperature sensor readout. The according source file is attached (refer to [1]).
From ESP32-S2 technical reference manual I could not see any dependency between temperature sensor and WiFi HW. The only thing I found was the hint to the mutual usage exclusion between WiFi and ADC2.
So is this temperature sensor issue a known one or even a technical limitation? Or does it require a different approach to read out the local temperature while still having a working WiFi station?
I'd appreciate any hints.
Regards
André
--
[1]
How to reproduce:
- optionally create a copy of the "simple_station" WiFi example of IDF
- replace the file station_example_main.c by the one attached
- configure WiFi SSID and WiFi Password within Example Configuration in menuconfig
- run the application
- the example will intially print a few temperature values prior to connecting to the AP
- before connecting, the readout is paused
- when connection has finished the readout is resumed after some seconds: Device is now reachable via network (ping)
- if resumed one can see Task watchdog prints and the device will probably not reachable anymore via WiFi (ping to IP address times out)
WiFi station breaks internal temperature sensor readout on ESP32-S2
WiFi station breaks internal temperature sensor readout on ESP32-S2
- Attachments
-
- station_example_main.c
- (7.12 KiB) Downloaded 382 times
-
- Posts: 9727
- Joined: Thu Nov 26, 2015 4:08 am
Re: WiFi station breaks internal temperature sensor readout on ESP32-S2
Just FYI, you may have more luck filing an issue on the ESP-IDF github repo, as this is clearly a function that does not work as expected.
Re: WiFi station breaks internal temperature sensor readout on ESP32-S2
Thanks for pointing this out. I actually found an already present issue targeting this "bug" (https://github.com/espressif/esp-idf/issues/8088). So I'm crossing fingers for having more success there.
Regards
André
Regards
André
Re: WiFi station breaks internal temperature sensor readout on ESP32-S2
Hi arex-ebee!
Have you found a workaround for this? I've followed the github issue you posted but it seems it has not been fixed.
Thanks
Have you found a workaround for this? I've followed the github issue you posted but it seems it has not been fixed.
Thanks
Re: WiFi station breaks internal temperature sensor readout on ESP32-S2
Hi AlSantana,
you're damn right, the issue actually seems orphaned . In my project the SoC temperature is just a small peace of the overall health monitoring and not that mandatory - for now I went without it. So I'm sorry to say that I don't have any workaround yet.
Regards
André
Who is online
Users browsing this forum: No registered users and 105 guests