GithubHelp home page GithubHelp logo

Bootloop about arduino-sht HOT 7 CLOSED

sensirion avatar sensirion commented on June 28, 2024
Bootloop

from arduino-sht.

Comments (7)

winkj avatar winkj commented on June 28, 2024

Does the same error occur with the official samples, e.g. sht-autodetect? I'd start there as a baseline, and then enable the second sensor support line by line.

One thing that I would recommend is checking the return values for the calls to init() to make sure the sensors were properly detected, although the library should be robust enough to handle this without causing bootloops.

from arduino-sht.

myctindustry avatar myctindustry commented on June 28, 2024

Hi winkj

sht-autodetect does not cause bootloop but will return "error in readsample" regardless of 1 or 2 sensors.

sht-multiple-sht-sensor will return "error in readsample 2" if only 1 sensor is plugged in. And error in readsample when both sensors are plugged in.

The multiple-sht-sensor has a comment regarding address pins. However, the SHT-85 only has 4 pins, no separate address pin.
// Sensor 1 with address pin pulled to GND
// Sensor 2 with address pin pulled to Vdd

I will try with the auto-detect line by line but is it even worth moving forward if no sensors are being auto-detected?

Thanks

from arduino-sht.

winkj avatar winkj commented on June 28, 2024

I will try with the auto-detect line by line but is it even worth moving forward if no sensors are being auto-detected?

Just to be sure, did you adjust the Wire configuration for the sht-autodetect sample?

Since all the readSamples seem to fail here, I personally would try first with a simple I2C scanner, like shown here: https://playground.arduino.cc/Main/I2cScanner/. Of course, you may have to adjust the pins to the bus you're using. I'd focus on one I2C bus first, and make sure that the sensor is being discovered properly. This should rule out any wiring issues. If this is working, we can move on to troubleshoot the library.

The address of the SHT85 is going to be fixed at the default (0x44), so you shouldn't have to do do any additional configuration for that.

from arduino-sht.

myctindustry avatar myctindustry commented on June 28, 2024

Hi winkj

Sorry, Just tested again with sht-autodetect sample to verify.
With just a single sensor it is in fact showing sensor readings.
If multiple sensors are plugged in to the same i2c bus then "error in readsample" occurs.

I will modify the wire configuration and see if it provides a reading on 2 separate i2c buses as well as the i2c scanner if it fails.
Thanks

from arduino-sht.

winkj avatar winkj commented on June 28, 2024

Glad to hear, and keep us posted once you get it to work.

It may make sense to try the second bus on it's own first, too - i.e. make sure that both sensors work individually, then move on to running them at the same time.

from arduino-sht.

myctindustry avatar myctindustry commented on June 28, 2024

Hi winkj

Got it working with the following code:
SHT-85 x 2
NodeMCU-32s

Thanks for your support.

#include <Wire.h>
#include <SHTSensor.h>
#define I2C2_SDA 4
#define I2C2_SCL 5

SHTSensor sht1;
SHTSensor sht2;

void setup() {
// put your setup code here, to run once:

Serial.begin(9600);
Wire.begin();
Wire1.begin(I2C2_SDA, I2C2_SCL);
Wire.setClock(100000);

delay(1000); // let serial console settle

if (sht1.init()) {
Serial.print("init(): success\n");
} else {
Serial.print("init(): failed\n");
}

if (sht2.init(Wire1)) {
Serial.print("init(): success\n");
} else {
Serial.print("init(): failed\n");
}

}

void loop() {
// put your main code here, to run repeatedly:

if (sht1.readSample()) {
Serial.print("Bottom:\n");
Serial.print(" RH: ");
Serial.print(sht1.getHumidity(), 1);
Serial.print("\n");
Serial.print(" T: ");
Serial.print(sht1.getTemperature(), 1);
Serial.print("\n");
} else {
Serial.print("Error in readSample1()\n");
}

if (sht2.readSample()) {
  Serial.print("Top:\n");
  Serial.print("  RH: ");
  Serial.print(sht2.getHumidity(), 1);
  Serial.print("\n");
  Serial.print("  T:  ");
  Serial.print(sht2.getTemperature(), 1);
  Serial.print("\n");

} else {
Serial.print("Error in readSample2()\n");
}
delay(5000);
}

from arduino-sht.

winkj avatar winkj commented on June 28, 2024

Awesome, thanks for reporting back. We have a todo item to add a sample for multiple sensors to this library.

from arduino-sht.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.