I'm using an ESP32 Azure IoT Kit. I want to send temperature and humidity along as telemetry to my IoT hub.
I cannot find almost any information on how to do this. I came across one post here where someone refers to using uint8_t temprature_sens_read() (note that the word temperature is misspelled) and much to my surprise that worked. I've searched the code base in esp-idf and can't find a single file that defines that function. There is no include file, you just "extern" it in your .c file.
I still need to get humidity. I haven't found any documentation or samples about that.
Am I reading temperature the right way? How do I get humidity?
Thanks,
David
P.S. I'm surprised the temperature reading is in F. I'd think C would be a better worldwide standard, and I'm curious about the decision to report in F.
Reading temperature and humidity
Re: Reading temperature and humidity
I found this sample, which uses a very different approach than the function I found for temperature earlier.
Is this what is recommended?
https://github.com/espressif/esp-iot-so ... ain/main.c
Thanks,
David
Is this what is recommended?
https://github.com/espressif/esp-iot-so ... ain/main.c
Thanks,
David
Re: Reading temperature and humidity
temprature_sens_read is not what you want. It is for reading esp32 internal temperature.
Re: Reading temperature and humidity
To convert to decimal
Re: Reading temperature and humidity
Are you using the HTS221 temp/humid sensor ?
if so: https://github.com/espressif/esp-iot-so ... /README.md
if so: https://github.com/espressif/esp-iot-so ... /README.md
IT Professional, Maker
Santiago, Dominican Republic
Santiago, Dominican Republic
Re: Reading temperature and humidity
I didn't realize I am, but I am. I took a second look at the spec sheet to confirm. I'm new to MCUs and honestly don't know many things, but I'm learning.tommeyers wrote: ↑Sat Nov 09, 2019 1:42 pmAre you using the HTS221 temp/humid sensor ?
if so: https://github.com/espressif/esp-iot-so ... /README.md
I got a solution working yesterday, but the instructions didn't work. I resorted to copying the relevant components to my project component directory, and it finally built.
Re: Reading temperature and humidity
Post what you need.
Post what you have tried.
we'll help where we can.
Tom
Post what you have tried.
we'll help where we can.
Tom
IT Professional, Maker
Santiago, Dominican Republic
Santiago, Dominican Republic
Who is online
Users browsing this forum: No registered users and 87 guests