Due to high demand expect some shipping delays at this time, orders may not ship for 1-2 business days.
0

Esp32 not working with 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.
Please be positive and constructive with your questions and comments.

Esp32 not working with IO

by onhai2 on Sat Feb 06, 2021 3:59 pm

Hello everyone, if you have some time I would need some help. I'm using esp32 and Arduino ide, and I have a problem with practically all of the examples simply because esp never connects to the IO. At first, a was getting endless ... so I changed Serial.print("."); to Serial.println(io.statusText()); and now I'm getting the message "Disconnected from Adafruit IO".(I found out that this message means that the client disconnected but don't know what do to with it).
Also, I tried the same code with esp8266 and it worked, but as soon as I tried any esp32 same annoying message.
Does anyone know what to do with it? Any help is appreciated thanx.

onhai2
 
Posts: 1
Joined: Sat Feb 06, 2021 3:57 pm

Re: Esp32 not working with IO

by brubell on Mon Feb 08, 2021 12:28 pm

What does your config.h file look like? Could you post it here?

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

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

Re: Esp32 not working with IO

by thebakedbaker on Tue Feb 09, 2021 10:40 am

I'm having a similar issue with an ESP32 not connecting. The code was a previously functional project that suddenly stopped working after I updated my Mac to Catalina (macOS 11.2). Initially, Arduino wouldn't compile code for the ESP32 because of an error, but after using the Boards Manager to update esp32 to 1.0.5-rc6 (as described here: https://github.com/espressif/arduino-esp32/issues/4408) I was finally able to get the code to compile. Unfortunately, the first time I pushed it to the ESP32, the project suddenly failed despite there being a very minor logic change deep within the code (which, once removed, did not resolve the issue).

I found that running the ESP32 > Examples > Time > Simple Time project works fine, but when I use Adafruit IO (such as the "adafruitio_00_publish" example) I get the endless "."s or when using statusText() I get "Connecting to Adafruit IO," "Network disconnected," then endless "Disconnected from Adafruit IO". Using the standard config.h file from the project (with my credentials added correctly):

/************************ 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);

thebakedbaker
 
Posts: 9
Joined: Mon Sep 22, 2014 9:57 pm

Re: Esp32 not working with IO

by thebakedbaker on Tue Feb 09, 2021 3:28 pm

***CORRECTION*** issue occurred after upgrading to Big Sur (11.2) from Catalina.

thebakedbaker
 
Posts: 9
Joined: Mon Sep 22, 2014 9:57 pm

Re: Esp32 not working with IO

by legokid1980 on Sat Feb 13, 2021 9:11 pm

I think I am having the same issue (never-ending '.' printed to console -- i.e. io.statusText() == "Disconnected from Adafruit IO." when trying to use the adafruitio_15_temp_humidity example.
EDIT: I am using Windows 10 with a fresh install of Arduino.
I am using Arduino 1.8.13, an Adafruit HUZZAH.
Library versions that I know about:
Adafruit IO Arduino Version 4.0.2
Adafruit MQTT Version 2.1.0
esp8266 Version 2.7.4

legokid1980
 
Posts: 1
Joined: Mon Nov 30, 2015 11:55 am

Re: Esp32 not working with IO

by pdmazariegos_uvg on Sun Feb 28, 2021 10:34 pm

I'm having the same problem with the ESP32

pdmazariegos_uvg
 
Posts: 2
Joined: Tue Mar 17, 2020 11:45 am

Re: Esp32 not working with IO

by pdmazariegos_uvg on Mon Mar 01, 2021 12:04 am

pdmazariegos_uvg wrote:I'm having the same problem with the ESP32

I change in the board manager the ESP32 version to 1.0.4 and it works again

pdmazariegos_uvg
 
Posts: 2
Joined: Tue Mar 17, 2020 11:45 am

Re: Esp32 not working with IO

by brubell on Mon Mar 01, 2021 10:53 am

pdmazariegos_uvg wrote:
pdmazariegos_uvg wrote:I'm having the same problem with the ESP32

I change in the board manager the ESP32 version to 1.0.4 and it works again


Seems to match what another user experienced in a different thread: viewtopic.php?f=56&t=175896&p=857841#p857841

I'm going to wait for Espressif to do a full release (non-release-candidate) of the ESP32 board support package before diving in. For now, I'd suggest downgrading to ESP Board support Package 1.0.5RC4

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

Re: Esp32 not working with IO

by LC_ on Tue Mar 02, 2021 6:51 pm

brubell wrote:I'm going to wait for Espressif to do a full release (non-release-candidate) of the ESP32 board support package before diving in. For now, I'd suggest downgrading to ESP Board support Package 1.0.5RC4


FYI, It looks like the full 1.0.5 (non-RC) was released a few days ago.

https://github.com/espressif/arduino-es ... /tag/1.0.5

LC_
 
Posts: 16
Joined: Sun Nov 01, 2020 3:16 pm

Re: Esp32 not working with IO

by thebakedbaker on Wed Mar 03, 2021 12:51 pm

I was finally able to get 1.0.4 working by following the steps listed here (turned out it was working, but whenever I changed the boards definition version to one of the 1.0.5RCs, I had to go back and redo the steps): https://github.com/espressif/arduino-esp32/issues/4408.

I updated to 1.0.5, and can confirm I still encounter the issue where the ESP32 will connect to the network (shows up in connected devices on my router/Fing, responds to pings), but it continues to be unable to connect to Adafruit IO as before (described in some more detail viewtopic.php?f=56&t=175686&p=856828#p856828, but I figured I'd continue posting here to sort of keep things together where some others have responded).

thebakedbaker
 
Posts: 9
Joined: Mon Sep 22, 2014 9:57 pm

Please be positive and constructive with your questions and comments.