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

ATWINC AIO Connection Issues
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.

ATWINC AIO Connection Issues

by grady56 on Tue Jun 30, 2020 8:16 am

I'm having issues getting my Adafruit feather m0+atwinc1500 dev. board to connect to my network(I'm guessing that's the problem, ill explain why briefly).

I'm getting the dreaded infinite "Connecting to Adafruit IO........(continuing)" error.

Things I've tried:

1) replacing Serial.print("Connecting to Adafruit IO"); with "Serial.print(io.statusText());"

I'm receiving: "Network disconnected" which makes me believe its something on my end, Adafruit IO services where/are online when I executed this test!

So based on that I did a few things:

2) Resetting my network(Powered down for 2 minutes and unplugged ALL connections to router+modem)

3) Changing my network password

4) And waiting a few days to see if it clears up on its own.....to no avail :(

5) I've also tried other things like resetting the dev. board with its reset button, reprogramming it and verifying that ALL of my config.h connection and Adafruit IO information is indeed correct, and it was!

** Note: I also have an M4 Express Airlift Lite, and with the same code it performs as expected, making the connection to my network and then connecting to Adafruit IO. This is a little concerning, I hope I didn't somehow brick/fry my ATWINC dev. board! I haven't uploaded or touched its firmware and its always been powered from a 5V USB supply and disconnected when not in use, so I don't know!

If anyone has had similar issues and knows a fix please help a fellow tinkerer out, or if you have ANY suggestions, all are welcome!

Thanks guys and gals!

P.S. In an effort to provide as much information as possible I've included ALL my code, but I've deleted my personal information from the config.h file to protect myself for obvious reasons.

Code: Select all | TOGGLE FULL SIZE
// Adafruit IO Digital Output Example
// Tutorial Link: https://learn.adafruit.com/adafruit-io-basics-digital-output
//
// 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 *******************************/

// digital pin 5
#define LED_PIN 5

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

void setup() {
 
  pinMode(LED_PIN, OUTPUT);
 
  // start the serial connection
  Serial.begin(115200);

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

  // connect to io.adafruit.com
  Serial.print("Connecting to Adafruit IO");
  io.connect();

  // set up a message handler for the 'digital' feed.
  // the handleMessage function (defined below)
  // will be called whenever a message is
  // received from adafruit io.
  digital->onMessage(handleMessage);

  // wait for a connection
  while(io.status() < AIO_CONNECTED) {
    Serial.print(".");
    delay(500);
  }

  // we are connected
  Serial.println();
  Serial.println(io.statusText());
  digital->get();

}

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();

}

// this function is called whenever an 'digital' feed message
// is received from Adafruit IO. it was attached to
// the 'digital' feed in the setup() function above.
void handleMessage(AdafruitIO_Data *data) {

  Serial.print("received <- ");

  if(data->toPinLevel() == HIGH)
    Serial.println("HIGH");
  else
    Serial.println("LOW");


  digitalWrite(LED_PIN, data->toPinLevel());
}

CONFIG.H
Code: Select all | TOGGLE FULL SIZE
/************************ 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 ""
#define IO_KEY ""

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

#define WIFI_SSID ""
#define WIFI_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);

grady56
 
Posts: 18
Joined: Mon Feb 17, 2020 12:54 pm

Re: ATWINC AIO Connection Issues

by Systembolaget on Thu Jul 02, 2020 2:46 pm

Maybe it's a similar issue like in this viewtopic.php?f=56&t=164725#p811081 thread. There is an amended AIO library out.

Systembolaget
 
Posts: 252
Joined: Wed Mar 08, 2017 1:01 pm

Re: ATWINC AIO Connection Issues

by grady56 on Thu Jul 02, 2020 3:40 pm

I dont think thats it, unfortunately. I have the latest AIO library installed according to my IDE.

Ive been trying to get one response from somebody for months, so THANK YOU for at least trying to help out!

Im really at a loss here, Ive tried everything I know how, multiple times.

My older post regarding this has gone unanswered for quite a while: https://forums.adafruit.com/viewtopic.php?f=57&t=165704

grady56
 
Posts: 18
Joined: Mon Feb 17, 2020 12:54 pm

Re: ATWINC AIO Connection Issues

by Systembolaget on Thu Jul 02, 2020 5:51 pm

Well, hard to say from here without having that device for trying it out. Did you follow the initial tutorial https://learn.adafruit.com/adafruit-fea ... 0/overview exactly before trying your own set-up or code modifications?

Other users also had problems with that exact same device, maybe that https://forum.arduino.cc/index.php?topi ... msg4158564 solves it?

Systembolaget
 
Posts: 252
Joined: Wed Mar 08, 2017 1:01 pm

Re: ATWINC AIO Connection Issues

by grady56 on Thu Jul 02, 2020 6:25 pm

Didn't appear to work :(

grady56
 
Posts: 18
Joined: Mon Feb 17, 2020 12:54 pm

Re: ATWINC AIO Connection Issues

by Systembolaget on Fri Jul 03, 2020 1:49 am

Only someone with the exact same board can really be of help. I would search online how other ATWIN users overcome such problems, as there are quite a few.

Systembolaget
 
Posts: 252
Joined: Wed Mar 08, 2017 1:01 pm

Re: ATWINC AIO Connection Issues

by brubell on Fri Jul 03, 2020 10:37 am

Did you follow this page to upload the SSL certificate for Adafruit.io to the ATWINC1500 module?

https://learn.adafruit.com/adafruit-fea ... rtificates

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

Re: ATWINC AIO Connection Issues

by grady56 on Fri Jul 03, 2020 11:39 am

brubell wrote:Did you follow this page to upload the SSL certificate for Adafruit.io to the ATWINC1500 module?

https://learn.adafruit.com/adafruit-fea ... rtificates


I guess not! After uploading SSL certificates to my ATWINC, AIO works as intended and everything is resolved.

Thanks again brubell!

grady56
 
Posts: 18
Joined: Mon Feb 17, 2020 12:54 pm

Re: ATWINC AIO Connection Issues

by brubell on Fri Jul 03, 2020 11:42 am

no problem - have a good weekend

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

Re: ATWINC AIO Connection Issues

by frogeye on Fri Jul 17, 2020 5:45 am

Thank you!
This helped me as well :)

frogeye
 
Posts: 2
Joined: Tue Jun 04, 2019 6:01 am

Re: ATWINC AIO Connection Issues

by grady56 on Fri Jul 17, 2020 10:17 am

frogeye wrote:Thank you!
This helped me as well :)


I'm glad!

Sometimes you get so excited with a new controller you miss very IMPORTANT things in the setup process or article graciously provided by Adafruit!

I mean SSL is right beneath updating firmware, I don't know how I missed it!

Should've just paid attention and gone through the ENTIRE article instead of thinking you "know what you're doing" :)

Lesson learned I guess!

grady56
 
Posts: 18
Joined: Mon Feb 17, 2020 12:54 pm

Please be positive and constructive with your questions and comments.