Black Lives Matter - Action and Equality. ... Adafruit is open and shipping.
0

Nothing is working after the update to 3.7.0
Moderators: adafruit_support_bill, adafruit

Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.
Please be positive and constructive with your questions and comments.

Nothing is working after the update to 3.7.0

by proecogreen on Wed Jul 15, 2020 1:30 am

My project was working flawlessly untill the SSL certificate change. Now that I updated to the latest 3.7.0 library, I tried a test program i.e. the publish example but its stuck at "Connecting to Adafruit IO..............". What could be the problem?

proecogreen
 
Posts: 4
Joined: Tue Jul 14, 2020 10:37 am

Re: Nothing is working after the update to 3.7.0

by mandreko on Wed Jul 15, 2020 10:51 am

I'm having the same issue, unfortunately. I updated my Adafruit IO and Adafruit MQTT libraries, but they never appear to connect. I'm trying to debug and see if I can identify why, but no luck as of yet.

mandreko
 
Posts: 16
Joined: Sun Feb 24, 2019 12:39 pm

Re: Nothing is working after the update to 3.7.0

by brubell on Wed Jul 15, 2020 11:25 am

mandreko and proecogreen - what boards/hardware are you trying to connect to Adafruit IO?

brubell
 
Posts: 988
Joined: Fri Jul 17, 2015 10:33 pm

Re: Nothing is working after the update to 3.7.0

by mandreko on Wed Jul 15, 2020 11:45 am

brubell: I have an ESP8266 D1 mini clone

Through some debugging, I can see my ESP get an IP address on my network after calling 'io.connect()'. However, it's getting stuck in the 'while(io.status() < AIO_CONNECTED)' statement. I started dumping io.statusText() to the serial port, and it's constantly saying "Disconnected from Adafruit IO" and gets stuck there. I'm not sure how to debug why it's connected to my WiFi, but not to IO. I would assume if it were the recent SSL cert causing an issue, that I'd get into the 'AIO_FINGERPRINT_UNKOWN' or 'AIO_FINGERPRINT_INVALID' enum.

mandreko
 
Posts: 16
Joined: Sun Feb 24, 2019 12:39 pm

Re: Nothing is working after the update to 3.7.0

by brubell on Wed Jul 15, 2020 12:04 pm

mandreko wrote:brubell: I have an ESP8266 D1 mini clone

Through some debugging, I can see my ESP get an IP address on my network after calling 'io.connect()'. However, it's getting stuck in the 'while(io.status() < AIO_CONNECTED)' statement. I started dumping io.statusText() to the serial port, and it's constantly saying "Disconnected from Adafruit IO" and gets stuck there. I'm not sure how to debug why it's connected to my WiFi, but not to IO. I would assume if it were the recent SSL cert causing an issue, that I'd get into the 'AIO_FINGERPRINT_UNKOWN' or 'AIO_FINGERPRINT_INVALID' enum.


Does io.adafruit.com/monitor ever show that the device was connected to the Adafruit IO server?

brubell
 
Posts: 988
Joined: Fri Jul 17, 2015 10:33 pm

Re: Nothing is working after the update to 3.7.0

by mandreko on Wed Jul 15, 2020 12:10 pm

No, I get no Connections, Live Errors, or Live Data.

mandreko
 
Posts: 16
Joined: Sun Feb 24, 2019 12:39 pm

Re: Nothing is working after the update to 3.7.0

by mandreko on Wed Jul 15, 2020 12:20 pm

If it's helpful, this is my code as of now, with debugging stuff inserted. I use the common config.h file from many Adafruit IO projects, with my feed names added as constants as well.

The project is pretty much the BME280 sample project, combined with the OLED shield code. I used a generic BME280 from Amazon, with only I2C headers, and an I2C OLED shield from Aliexpress.

Code: Select all | TOGGLE FULL SIZE
#include "config.h"
#include <Adafruit_BME280.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

#define MESSAGE_WAIT_SEC (5 * 60)
#define OLED_RESET 0  // GPIO0
Adafruit_SSD1306 display(OLED_RESET);

// create BME280 instance
Adafruit_BME280 bme; //I2C

// set up the 'temperature' and 'humidity' feeds
AdafruitIO_Feed *temperature = io.feed(IO_TEMP_FEED);
AdafruitIO_Feed *humidity = io.feed(IO_HUMID_FEED);

void setup() {

  // start the serial connection
  Serial.begin(115200);

  // wait for serial monitor to open
  while(! Serial);

  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
  display.display();
  delay(2000);
  display.clearDisplay();
 
  // initialize bme280
  unsigned status;
  status = bme.begin(0x76);
  if (!status) {
    Serial.println("Could not find a valid BME280 sensor, check wiring, address, sensor ID!");
    Serial.print("SensorID was: 0x"); Serial.println(bme.sensorID(),16);
    Serial.print("        ID of 0xFF probably means a bad address, a BMP 180 or BMP 085\n");
    Serial.print("   ID of 0x56-0x58 represents a BMP 280,\n");
    Serial.print("        ID of 0x60 represents a BME 280.\n");
    Serial.print("        ID of 0x61 represents a BME 680.\n");
    while (1);
  }

  // connect to io.adafruit.com
  Serial.println();
  Serial.println("Connecting to WiFi");
  io.connect();

  while(io.status() < AIO_DISCONNECTED) {
    delay(500);
  }
   // Print IP status
  printDeviceDetails();

  Serial.print("Connecting to Adafruit IO");
  // wait for a connection
  while(io.status() < AIO_CONNECTED) {
    //Serial.print(".");
    Serial.println();
    Serial.print(io.statusText());
    delay(500);
  }

  // we are connected
  Serial.println();
  Serial.println(io.statusText());

}

void loop() {

  // io.run(); is required for all sketches.
  // it should always be present at the top of your loop
  // function. it keeps the client connected to
  // io.adafruit.com, and processes any incoming data.
  io.run();

  float h = bme.readHumidity();
  float c = bme.readTemperature();
  float f= 0;
  f = (c*1.8)+32;

  // Check if any reads failed and exit early (to try again).
  if (isnan(h) || isnan(f)) {
    Serial.println(F("Failed to read from BME280 sensor!"));
    return;
  }

  display.clearDisplay();
  display.setTextSize(1);
  display.setTextColor(WHITE);
  display.setCursor(0,0);

  Serial.print("Temperature: ");
  Serial.print(f);
  Serial.println("°F");
  display.println("Temp. ");
  display.print(f);
  display.println("F");
  display.println();
 
  Serial.print("    Humidity: ");
  Serial.print(h);
  Serial.println("%");
  display.println("Humidity");
  display.print(h);
  display.println("%");

  display.display();

  // save fahrenheit (or celsius) to Adafruit IO
  temperature->save(f);
  humidity->save(h);

  // wait for next time
  for (int i = 0; i < MESSAGE_WAIT_SEC; i++)
  {
    delay(1000);
  }

}

void printDeviceDetails() {
  byte mac[6];
 
  // Device Info
  Serial.println("----DEVICE INFO----");
  IPAddress ip = WiFi.localIP();
  Serial.print("IP Address: ");
  Serial.println(ip);

  WiFi.macAddress(mac);
  Serial.print("MAC Address: ");
  for(int i=0;i<6;i++) {
    Serial.print(mac[i], HEX);
  }
  Serial.println();

  // Network Info
  Serial.println("----ROUTER INFO----");
  Serial.print("WIFI SSID: ");
  Serial.println(WIFI_SSID);
  Serial.print("WIFI Pass: ");
  Serial.println(WIFI_PASS);
  long rssi = WiFi.RSSI();
  Serial.print("RSSI:");
  Serial.println(rssi);

  // Feed Info
  Serial.println("----FEED INFO----");
  Serial.print("TEMP FEED: ");
  Serial.println(IO_TEMP_FEED);
  Serial.print("HUMID FEED: ");
  Serial.println(IO_HUMID_FEED);
}

mandreko
 
Posts: 16
Joined: Sun Feb 24, 2019 12:39 pm

Re: Nothing is working after the update to 3.7.0

by john87 on Wed Jul 15, 2020 1:53 pm

The same thing happened to me.

A project that was compiled a couple of months ago compiled nicely but gives only "." s as it tries to connect. The same thing happens with one of the Adafruit IO examples.

Is there any way to get error messages from the library?

John

john87
 
Posts: 17
Joined: Sun Jul 21, 2019 11:20 pm

Re: Nothing is working after the update to 3.7.0

by proecogreen on Wed Jul 15, 2020 2:10 pm

@brubell: I'm using the ESP8266 based NodeMCU.

proecogreen
 
Posts: 4
Joined: Tue Jul 14, 2020 10:37 am

Re: Nothing is working after the update to 3.7.0

by john87 on Wed Jul 15, 2020 10:43 pm

@brubell: I'm using the ESP8266 based NodeMCU and a Feather Huzzah.

I don't see anything new show up on the router when I start the programs so it looks like the WiFi is not connecting. For one of the tested programs, it's the same header file with the SSID & PW that has always worked.

john87
 
Posts: 17
Joined: Sun Jul 21, 2019 11:20 pm

Re: Nothing is working after the update to 3.7.0

by mandreko on Wed Jul 15, 2020 11:01 pm

John87: That’s interesting. I see my esp8266 connect to my router, and I can ping it while it’s trying to connect to IO. The wifi connection is working for me, but the IO connection is not.

mandreko
 
Posts: 16
Joined: Sun Feb 24, 2019 12:39 pm

Re: Nothing is working after the update to 3.7.0

by john87 on Thu Jul 16, 2020 10:02 am

That is what I would expect also. I couldn't see a way to put some serial print statements into the library file, so I'm pretty blind.

I will try setting up a new computer with fresh everything.

john87
 
Posts: 17
Joined: Sun Jul 21, 2019 11:20 pm

Re: Nothing is working after the update to 3.7.0

by mandreko on Thu Jul 16, 2020 1:28 pm

I did a packet capture this morning from my router. It can see the ESP8266 device turn on, get an IP address, do a DNS lookup for io.adafruit.com, and try connecting on port 8333 to the MQTT server. Since it's HTTPS, I can't inspect the communication. I'm not sure what's wrong at this point.

Image

mandreko
 
Posts: 16
Joined: Sun Feb 24, 2019 12:39 pm

Re: Nothing is working after the update to 3.7.0

by brubell on Fri Jul 17, 2020 9:55 am

Are you able to connect to Adafruit IO using this sketch and the ESP8266:

https://github.com/adafruit/Adafruit_MQ ... sp8266.ino

brubell
 
Posts: 988
Joined: Fri Jul 17, 2015 10:33 pm

Re: Nothing is working after the update to 3.7.0

by john87 on Fri Jul 17, 2020 11:27 am

Brent,

That looks like a good program to try to separate the wifi connection from the Adafruit connection. I'll try it asap.

I am no longer sure that I was NOT connecting to my WiFi, neither my router nor the android app Fing seem to reliably tell if a certain bit of hardware is connected. I ran another example that reported the WiFi connection and IP address successfully.

John

john87
 
Posts: 17
Joined: Sun Jul 21, 2019 11:20 pm

Please be positive and constructive with your questions and comments.