Closed dosipod closed 1 year ago
I made a quick usermod to add that measurement on esp32 and also send it out every second per mqtt https://github.com/lost-hope/WLED/tree/mcu_temp/usermods/mcu_temp havent found a way for the newer ESP32 boards yet
Looks good , cloned your repo but not sure if that is up to date with latest MM as i see connection issues ,with the test unit , i want to try to distribute to multiple units , might setup the timing to 3000ms but will keep some on 1000ms to see if there is impact .
Nice idea - i also have that on my (long) list 👍 Actually i put it aside, as I could not get meaningfull values from temprature_sens_read(). Well that was a year ago, maybe I just had old esp32 modules at the time.
@lost-hope: Did it work for you on the 16MB "WROOM-32E" made by serg74?
Reading the temp sensors of new MCUs seems to be trouble, at least on -S2 there is a framework bug, leading to bad readings when wifi is active.
The main issues with the internal sensors is, that they are really inacurate. i tested it with a twilightlords esp32 (ESP32-WROOM-32E) and it shows 56°C at boot.
i will let is run for a bit to see if the reported value seems logical (it is the temp of the mcu and we can only feel/measure on the tin can, which has no direct contact to the mcu
and regarding the sending interval, i set it at 1s for testing, but i think, that even 10s is too often for temperature, which is normally a pretty slow changing value.
Yeah i setup the interval to 3000 ms and seems the unit is okay and i will add few units to ha to see , one of the guys is saying we will know if the air condition in room is off from temperature difference which is the accuracy that we could work with . Some of the MCUs will not show the correct temperature even with thermal image because of the metal housing . I tested one without that and temperature seems close .
After few hours , room temperature effect on MCU , So yeah a poor man temperature sensor with the right formula
(old news) the ESP32 temperature sensor is not supported any more in "V4" builds with esp-idf 4.x.y / arduino-esp32 v2.0.x
Temperature sensor functionality (together with the LNA) has been removed from the ESP32 TRM as it was considered not working well enough in hardware. There is a temperature sensor driver in IDF now which supports ESP32-S2 and later chips.
This would mean the temp sensor function is only usable in "WLED standard" builds based on esp-idf 3.x.y / arduino-esp32 v1.0.6.
The new temperature API should work on -S3.
correction: I can still make a "V4" build with temprature_sens_read()
.
So it was not removed completely, even when espressif says so.
Graph for 20 hours , It might be worth to note could be a big difference between MCU temperature and board temperature but that is something I could not plot accurately but some of the guys confused both .
@lost-hope just saw that arduino-esp32 has a function for this, that is also availeable on -S3/-s2/-c3. Just that the -s2 version tends to crash randomly...
Looks like the function exists in the old 1.0x core, too.
just updated it in my branch. But in my opinion it should be added to the normal mm code, instead of a usermod. just hide the field for 8266 and S2 (if this function is the cause of the crashes)
Implemented with https://github.com/MoonModules/WLED/pull/51
This is already tested thanks to @lost-hope , It would be nice if the MCU temperature output is available or published via MQTT https://discord.com/channels/473448917040758787/757254961640898622/1105586635195809932 One use case is to switch all our MCUS powers to 3.3v to reduce heat and I do not like to walk around the building to do thermal imagery . In all cases that may be useful to indicate possible hw or wiring issues or even could help to see if MCU is stressed . It is also available with others like Tasmota so could be common to open source .