Jump to content

NLCbanner2024.jpg.2478be509670e60c2d6efd04834b8b47.jpg

Gina

Beyond the Event Horizon
  • Posts

    45,326
  • Joined

  • Last visited

  • Days Won

    120

Posts posted by Gina

  1. The second BME280 set to address 0x77 does not seem to be working.  Wondering if using one on I2C bus and other on SPI bus would be better that both on I2C with different addresses.  Or maybe I'm doing it wrong.

    I'm setting the two sensors as

    Adafruit_BME280 bme; // I2C (0x76)
    Adafruit_BME280 bme2; // I2C (0x77)

    Setting them going with :-

    void setup() {
      Serial.begin(115200);
      // default settings
      // (you can also pass in a Wire library object like &Wire2)
      //status = bme.begin();  
      if (!bme.begin(0x76) and (!bme2.begin(0x77))) {
        Serial.println("Could not find a valid BME280 sensor, check wiring!");
        while (1);
      }

    Then reading by :-

        temperature = bme.readTemperature();   
    
        obsT = bme2.readTemperature();

    What I'm unsure of is whether

      if (!bme.begin(0x76) and (!bme2.begin(0x77))) {

    Really does begin both.

  2. I've put the obsy sensor unit back out in the obsy, plugged the outside BME280 in and powered up.  The outside pressure isn't working and I'm not sure about the inside (obsy) readings.  The Living Room unit is working fine.  There are no spikes showing (without Forced Mode).  I'm not too worried about the outside pressure as I have the indoor pressure and that's sufficient.  Think I'll now do some tidying up of the display as a lot of it was just for testing.

    1191850188_Screenshotfrom2020-08-2011-07-18.png.f6af6da3091ecc87b8040d344b246464.png

  3. Have the obsy sensor unit on the table running from bench PSU.  The second BME280 is working but doesn't look right.  I can't see it being right that the humidity one side of the room is 67% and the other side just 20%.  Temperature seems sensible though - the table is near the big picture window and expected to be a bit cooler.

    The reason there's no readings for Outside is that the outside BME280 is not plugged in.

    1528640117_Screenshotfrom2020-08-1921-40-56.png.b9f49f6d82dd1b18db9e3f81fb8d1aba.png

  4. New reconnect code. Changed to if (client.connect("indoorClient"))  {

    void reconnect() {
      // Loop until we're reconnected
      while (!client.connected()) {
        Serial.print("Attempting MQTT connection...");
        // Attempt to connect
        if (client.connect("indoorClient")) {
          Serial.println("connected");
          // Subscribe
          client.subscribe("esp32/output");
          client.subscribe("esp32/roof");
        } else {
          Serial.print("failed, rc=");
          Serial.print(client.state());
          Serial.println(" try again in 5 seconds");
          // Wait 5 seconds before retrying
          delay(5000);
        }
      }
    }

    And it works!!

    Finally, problem SOLVED

    • Like 2
    • Haha 1
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. By using this site, you agree to our Terms of Use.