Comments (8)
Read on the Arduino forum long ago that code in the constructor has the risk that not all hardware is initialized when constructor is executed and can cause unwanted side effects (aka crash). So initializing a variable to 42 is ok, but checking complexer IO e.g. I2C depends on when the Wire constructor is executed.
Satisfied with the library? Missing things?
Otherwise you may close the issue.
from sht31.
Hi Oscar,
Thanks for the issue, I'm rather busy at the moment so it can take a few days before diving into this.
from sht31.
Is there any error message?
from sht31.
Thanks for your quick response Rob!
No, there is no error message. The expected behavior is to print a debug message but it is not appearing. What is happening is that my ESP32 is interrupted by the watchdog:
rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:1184
load:0x40078000,len:13160
load:0x40080400,len:3036
entry 0x400805e4
from sht31.
When commenting sht (declared as SHT31 sht;) calls, the rest of the code continues working.
This remark is ambiguous as sht is used multiple times.
Which line is commented?
Note: I have no hardware to setup an equivalent, so I depend on your testing.
from sht31.
I was referring to these lines: bool sht_begin = sht.begin(SHT31_ADDRESS);
and sht.reset();
of the previous code.
The rest of the code is independent from SHT31 library, as it only prints some debug messages.
from sht31.
Can you create a minimal sketch that fails? As I have not enough clues yet.
I am using packages\esp32\hardware\esp32\1.0.6 in my tests (and I need to keep that config )
from sht31.
My fault!! It is already fixed. I do not know the reason but moving this code...
Wire.begin();
bool sht_begin = sht.begin(SHT31_ADDRESS);
sht.reset();
Wire.setClock(100000);
...out of the constructor, it works properly.
It is weird that with arduino-esp32 v1.0.6 worked but not with v2.0.5.
Thank you for your support, I will remove this issue after you read it so as not to mess up the repository.
from sht31.
Related Issues (12)
- Exposing the raw temperature and humidity? HOT 6
- SHT31 library two I2C interfaces: example, advice needed HOT 31
- Add lastHeaterStopTime variable to prevent switching on the heater too early HOT 2
- Return 0.0C and 0.0% HOT 5
- isConnected returns true if voltaje to SHT31 is not connected. HOT 4
- SoftWire library + SHT31 library HOT 23
- prototype for 'bool SHT31::begin(uint8_t, uint8_t, uint8_t)' does not match any in class 'SHT31' HOT 6
- Using SHT31 in High Humidity Environment HOT 9
- check SHT2x functions added HOT 1
- Heater HOT 5
- Question on i2c error handling HOT 23
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sht31.