Disconnected from Adafruit IO

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.
Locked
User avatar
Lorent4
 
Posts: 2
Joined: Sun Mar 28, 2021 12:27 pm

Disconnected from Adafruit IO

Post by Lorent4 »

Hi,

I'm, using the ESP32 Huzzah (https://www.adafruit.com/product/3405) with Arduino IDE

I'm, using the adafruitio_00_publish example from the Adafruit IO Arduino - library. Version 4.0.2

I'm getting the message on the serial monitor "Disconnected from Adafruit IO".

Arduino version: 1.8.12
Board package by espressif systems for esp32. Version 1.0.4

Please help!

THE CODE:

Code: Select all

// Adafruit IO Publish Example
//
// Adafruit invests time and resources providing this open source code.
// Please support Adafruit and open source hardware by purchasing
// products from Adafruit!
//
// Written by Todd Treece for Adafruit Industries
// Copyright (c) 2016 Adafruit Industries
// Licensed under the MIT license.
//
// All text above must be included in any redistribution.

/************************** Configuration ***********************************/

// edit the config.h tab and enter your Adafruit IO credentials
// and any additional configuration needed for WiFi, cellular,
// or ethernet clients.
#include "config.h"

/************************ Example Starts Here *******************************/

// this int will hold the current count for our sketch
int count = 0;

// set up the 'counter' feed
AdafruitIO_Feed *counter = io.feed("counter");

void setup() {

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

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

  Serial.print("Connecting to Adafruit IO");

  // connect to io.adafruit.com
  io.connect();

  // wait for a connection
  while(io.status() < AIO_CONNECTED) {
    Serial.print(".");
    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();

  // save count to the 'counter' feed on Adafruit IO
  Serial.print("sending -> ");
  Serial.println(count);
  counter->save(count);

  // increment the count by 1
  count++;

  // Adafruit IO is rate limited for publishing, so a delay is required in
  // between feed->save events. In this example, we will wait three seconds
  // (1000 milliseconds == 1 second) during each loop.
  delay(3000);

}
config:

Code: Select all

/************************ Adafruit IO Config *******************************/

// visit io.adafruit.com if you need to create an account,
// or if you need your Adafruit IO key.
#define IO_USERNAME "your_username"
#define IO_KEY "your_key"

/******************************* WIFI **************************************/

// the AdafruitIO_WiFi client will work with the following boards:
//   - HUZZAH ESP8266 Breakout -> https://www.adafruit.com/products/2471
//   - Feather HUZZAH ESP8266 -> https://www.adafruit.com/products/2821
//   - Feather HUZZAH ESP32 -> https://www.adafruit.com/product/3405
//   - Feather M0 WiFi -> https://www.adafruit.com/products/3010
//   - Feather WICED -> https://www.adafruit.com/products/3056
//   - Adafruit PyPortal -> https://www.adafruit.com/product/4116
//   - Adafruit Metro M4 Express AirLift Lite ->
//   https://www.adafruit.com/product/4000
//   - Adafruit AirLift Breakout -> https://www.adafruit.com/product/4201
//   - Adafruit AirLift Shield -> https://www.adafruit.com/product/4285
//   - Adafruit AirLift FeatherWing -> https://www.adafruit.com/product/4264

#define WIFI_SSID "your_ssid"
#define WIFI_PASS "your_pass"

// uncomment the following line if you are using airlift
// #define USE_AIRLIFT

// uncomment the following line if you are using winc1500
// #define USE_WINC1500

// comment out the following lines if you are using fona or ethernet
#include "AdafruitIO_WiFi.h"

#if defined(USE_AIRLIFT) || defined(ADAFRUIT_METRO_M4_AIRLIFT_LITE) ||         \
    defined(ADAFRUIT_PYPORTAL)
// Configure the pins used for the ESP32 connection
#if !defined(SPIWIFI_SS) // if the wifi definition isnt in the board variant
// Don't change the names of these #define's! they match the variant ones
#define SPIWIFI SPI
#define SPIWIFI_SS 10 // Chip select pin
#define NINA_ACK 9    // a.k.a BUSY or READY pin
#define NINA_RESETN 6 // Reset pin
#define NINA_GPIO0 -1 // Not connected
#endif
AdafruitIO_WiFi io(IO_USERNAME, IO_KEY, WIFI_SSID, WIFI_PASS, SPIWIFI_SS,
                   NINA_ACK, NINA_RESETN, NINA_GPIO0, &SPIWIFI);
#else
AdafruitIO_WiFi io(IO_USERNAME, IO_KEY, WIFI_SSID, WIFI_PASS);
#endif
/******************************* FONA **************************************/

// the AdafruitIO_FONA client will work with the following boards:
//   - Feather 32u4 FONA -> https://www.adafruit.com/product/3027

// uncomment the following two lines for 32u4 FONA,
// and comment out the AdafruitIO_WiFi client in the WIFI section
// #include "AdafruitIO_FONA.h"
// AdafruitIO_FONA io(IO_USERNAME, IO_KEY);

/**************************** ETHERNET ************************************/

// the AdafruitIO_Ethernet client will work with the following boards:
//   - Ethernet FeatherWing -> https://www.adafruit.com/products/3201

// uncomment the following two lines for ethernet,
// and comment out the AdafruitIO_WiFi client in the WIFI section
// #include "AdafruitIO_Ethernet.h"
// AdafruitIO_Ethernet io(IO_USERNAME, IO_KEY);
Attachments
Screenshot 2021-04-06 at 18.46.07.png
Screenshot 2021-04-06 at 18.46.07.png (230.71 KiB) Viewed 699 times

User avatar
adafruit_support_carter
 
Posts: 29156
Joined: Tue Nov 29, 2016 2:45 pm

Re: Disconnected from Adafruit IO

Post by adafruit_support_carter »

Did you change these lines:

Code: Select all

#define IO_USERNAME "your_username"
#define IO_KEY "your_key"
to be your actual AIO username and key?

User avatar
Lorent4
 
Posts: 2
Joined: Sun Mar 28, 2021 12:27 pm

Re: Disconnected from Adafruit IO

Post by Lorent4 »

Yes, and even the WiFi credentials

User avatar
jtsliker
 
Posts: 15
Joined: Tue Jul 25, 2017 3:07 pm

Re: Disconnected from Adafruit IO

Post by jtsliker »

I too am having the same problem. I duplicated the code I used for the ESP8266 which is working fine. I have made the appropriate substitutions for WIFI names and passwords as well as the Adafruit IO credentials. PLEASE HELP !!

Thanks in advance.

User avatar
adafruit_support_carter
 
Posts: 29156
Joined: Tue Nov 29, 2016 2:45 pm

Re: Disconnected from Adafruit IO

Post by adafruit_support_carter »

@jtsliker Please start a new thread for your issue.

User avatar
brubell
Learn User Page
 
Posts: 2010
Joined: Fri Jul 17, 2015 10:33 pm

Re: Disconnected from Adafruit IO

Post by brubell »

Could you try using version the ESP32 Board Support package version 1.0.4? You can find this in the Arduino board's manager.

User avatar
tina90q
 
Posts: 1
Joined: Sat Apr 17, 2021 4:28 pm

Re: Disconnected from Adafruit IO

Post by tina90q »

having the same issue, my arduino IDE version is 1.8.3. Someone please help!

User avatar
LORENT4444
 
Posts: 1
Joined: Wed Apr 21, 2021 7:53 am

Re: Disconnected from Adafruit IO

Post by LORENT4444 »

I am already using version 1.0.4 for the board

User avatar
etailleur
 
Posts: 1
Joined: Mon Apr 19, 2021 11:14 am

Re: Disconnected from Adafruit IO

Post by etailleur »

Same issue, did you find a fix for that issue ?

User avatar
brubell
Learn User Page
 
Posts: 2010
Joined: Fri Jul 17, 2015 10:33 pm

Re: Disconnected from Adafruit IO

Post by brubell »

A user had a simialr user here and rectified it: viewtopic.php?f=56&t=178475

User avatar
JackTheSE
 
Posts: 54
Joined: Wed Jan 02, 2019 8:34 pm

Re: Disconnected from Adafruit IO

Post by JackTheSE »

A user had a simialr user here and rectified it: viewtopic.php?f=56&t=178475
So I also had this problem when running the 1.0.6 version of the ESP32 board installation, and going back to 1.0.4 solved it. But will this ever be fixed? Is it an Adafruit IO problem, or an EspressIf problem? I generally like to keep my libraries and boards up to date. And in this particular case, I had to update to 1.0.6 to get another (non-Adafruit IO) project to work correctly.

User avatar
brubell
Learn User Page
 
Posts: 2010
Joined: Fri Jul 17, 2015 10:33 pm

Re: Disconnected from Adafruit IO

Post by brubell »

JackTheSE wrote:
A user had a simialr user here and rectified it: viewtopic.php?f=56&t=178475
So I also had this problem when running the 1.0.6 version of the ESP32 board installation, and going back to 1.0.4 solved it. But will this ever be fixed? Is it an Adafruit IO problem, or an EspressIf problem? I generally like to keep my libraries and boards up to date. And in this particular case, I had to update to 1.0.6 to get another (non-Adafruit IO) project to work correctly.
We just released a new version of Adafruit IO Arduino which solves this issue. Please update via the Arduino IDE's Library Manager.
https://github.com/adafruit/Adafruit_IO ... /tag/4.1.0

User avatar
JackTheSE
 
Posts: 54
Joined: Wed Jan 02, 2019 8:34 pm

Re: Disconnected from Adafruit IO

Post by JackTheSE »

Yes, I verified that Adafruit_IO 4.1 now works fine with ESP32 1.0.6. Thanks for the quick fix...

Locked
Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.

Return to “Internet of Things: Adafruit IO and Wippersnapper”