Difference: SolutionsToTheNopI2CBusAndTheSHT30TemperatureAndHumiditySensor (2 vs. 3)

Revision 32020-05-18 - UliRaich

Line: 1 to 1
 
META TOPICPARENT name="Solutions"

Solutions to Exercise 4: The I2C Bus and the SHT30 Temperature and Humidity Sensor

Exercise 2:

Changed:
<
<
This is an extremely relevant exercise because it shows typical work that must be done during an IoT project. Often code from other authors can be found on the Internet (e.g. github) but often you find problems with this. Maybe it is
>
>
This is an extremely relevant exercise because it shows typical work that must be done during an IoT project. Often code from other authors can be found on the Internet (e.g. github) but often you find problems with this. Maybe it is
 
  • outdated and must be adapted to a newer system version
  • there are still bugs in the code
  • it was written for hardware slightly different from the one you want to use
Line: 44 to 44
  Let's try to send a reset command with a little script, not using the sht30 driver:
Changed:
<
<
sht30CmdTest.png
>
>
sht30CmdTest-1.png
  with this result:
Changed:
<
<
sht30NotSupported.png
>
>
sht30NotSupported-1.png
  This tells me that start() and stop() are not supported by the I2C driver on the ESP32. Looks like the I2C start and stop conditions have been integrated into the writeto() and readfrom() methods! Let's just remove those two calls:
Line: 56 to 56
  As you can see, the reset now works without errors. And since we are at it, let's try to make a measurement without passing through the SHT30 class:
Changed:
<
<
sht30CmdOk.png
>
>
sht30CmdV2.png
  with this result:

sht30MeasOk.png

Changed:
<
<
Now that we know how to read and write the SHT30 using the ESP32 I2C driver, we can make the necessary corrections in the SHT30 class.
>
>
Now that we know how to read and write the SHT30 using the ESP32 I2C driver, we can make the necessary corrections in the SHT30 class. After the change all the code snippets in the README.md file should work.

Improving the SHT30 class

  -- Uli Raich - 2020-05-18
Line: 77 to 78
 
META FILEATTACHMENT attachment="sht30Check.png" attr="" comment="" date="1589800925" name="sht30Check.png" path="sht30Check.png" size="7454" user="UliRaich" version="1"
META FILEATTACHMENT attachment="sht30Init.png" attr="" comment="" date="1589805189" name="sht30Init.png" path="sht30Init.png" size="27037" user="UliRaich" version="1"
META FILEATTACHMENT attachment="sht30BusError.png" attr="" comment="" date="1589805507" name="sht30BusError.png" path="sht30BusError.png" size="17573" user="UliRaich" version="1"
Deleted:
<
<
META FILEATTACHMENT attachment="sht30CmdTest.png" attr="" comment="" date="1589806539" name="sht30CmdTest.png" path="sht30CmdTest.png" size="26482" user="UliRaich" version="2"
META FILEATTACHMENT attachment="sht30NotSupported.png" attr="" comment="" date="1589806411" name="sht30NotSupported.png" path="sht30NotSupported.png" size="12209" user="UliRaich" version="1"
 
META FILEATTACHMENT attachment="sht30Reset.png" attr="" comment="" date="1589806966" name="sht30Reset.png" path="sht30Reset.png" size="3718" user="UliRaich" version="1"
META FILEATTACHMENT attachment="sht30CmdOk.png" attr="" comment="" date="1589807968" name="sht30CmdOk.png" path="sht30CmdOk.png" size="72956" user="UliRaich" version="1"
META FILEATTACHMENT attachment="sht30MeasOk.png" attr="" comment="" date="1589808135" name="sht30MeasOk.png" path="sht30MeasOk.png" size="6802" user="UliRaich" version="1"
Added:
>
>
META FILEATTACHMENT attachment="sht30CmdTest.png" attr="" comment="" date="1589832428" name="sht30CmdTest.png" path="sht30CmdTest.png" size="42577" user="UliRaich" version="1"
META FILEATTACHMENT attachment="sht30CmdTest-1.png" attr="" comment="" date="1589832562" name="sht30CmdTest-1.png" path="sht30CmdTest-1.png" size="42577" user="UliRaich" version="1"
META FILEATTACHMENT attachment="sht30NotSupported-1.png" attr="" comment="" date="1589832562" name="sht30NotSupported-1.png" path="sht30NotSupported-1.png" size="20262" user="UliRaich" version="1"
META FILEATTACHMENT attachment="sht30CmdV2.png" attr="" comment="" date="1589833174" name="sht30CmdV2.png" path="sht30CmdV2.png" size="82653" user="UliRaich" version="1"
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback