code that worked on esp32 does not work on esp32 c3

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
Alsor1962
Posts: 4
Joined: Sat Jul 03, 2021 5:25 am

code that worked on esp32 does not work on esp32 c3

Post by Alsor1962 » Tue Jan 25, 2022 3:57 pm

code example:

import esp
import esp32

temp_f = round(esp32.raw_temperature(), 2)
temp_c = round(((esp32.raw_temperature()-32)/1.8), 2)
print('Temperature F:', temp_f,' F')
print('Temperature C:', temp_c, ' C')


what is the problem?

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: code that worked on esp32 does not work on esp32 c3

Post by Roberthh » Tue Jan 25, 2022 4:12 pm

There is no temperature sensor in the ESP32 C3, and thus the method esp32.raw_temperature() does not exist.

Alsor1962
Posts: 4
Joined: Sat Jul 03, 2021 5:25 am

Re: code that worked on esp32 does not work on esp32 c3

Post by Alsor1962 » Wed Jan 26, 2022 3:23 am

Roberthh wrote:
Tue Jan 25, 2022 4:12 pm
There is no temperature sensor in the ESP32 C3, and thus the method esp32.raw_temperature() does not exist.
but the dadshit says that there is a temperature sensor.
https://www.espressif.com/sites/default ... eet_en.pdf

thank you for your responses
Alex

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: code that worked on esp32 does not work on esp32 c3

Post by Roberthh » Wed Jan 26, 2022 7:08 am

If the data sheet mentions it, it should be physically present, but the API in the esp32 module is missing. And thus you cannot use it. Anyhow, it would tell you the temperature of the ESP32 chip, which is usually not of interest and hardly related to the outside temperature.

Post Reply