Adafruit is open and shipping! Let's build back better, together!
0

ESP32 Feather HUZZAH - fails to communicate with wifi
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

ESP32 Feather HUZZAH - fails to communicate with wifi

by teppe on Wed Sep 23, 2020 12:41 am

I received a new ESP32 Feather HUZZAH32 with installed headers last week, and went through the instructions. The ScanNetworks sketch compiles and uploads without an error, but the serial monitor says "Communication with WiFi module failed!". The hardware hookup is very straightforward, with just a cord from my computer's USB to the micro USB on the Feather. I even swapped out the cord to be sure that's not an issue.

For the ScanNetworks example, I changed chip select pin to 10, reset pin to 7, busy/ready pin to 5, and GPI00 to -1.

Per the instructions, I downloaded and installed the Silicon Labs CP2104 driver.

I added the link for the additional board URL to my preferences:
https://raw.githubusercontent.com/espre ... index.json

I installed the ESP32 platform through Boards Manager.

I selected the board: Tools > Board > ESP Arduino > Adafruit ESP32 Feather

I'm using Adafruit's version of WIFININA library.

Again, it's compiling and uploading without an error, but can't communicate with wifi. Thanks in advance for your help.

-Tom

teppe
 
Posts: 24
Joined: Wed Apr 11, 2018 9:02 pm

Re: ESP32 Feather HUZZAH - fails to communicate with wifi

by mikeysklar on Wed Sep 23, 2020 9:08 pm

Hi Tom,

Do any of the other test programs work successfully with your Huzzah32? Here is WiFiScan if you want to test it. Open your serial monitor to see the APs. Press the 'reset' button if you see errors or gibberish.

Code: Select all | TOGGLE FULL SIZE
/*
 *  This sketch demonstrates how to scan WiFi networks.
 *  The API is almost the same as with the WiFi Shield library,
 *  the most obvious difference being the different file you need to include:
 */
#include "WiFi.h"

void setup()
{
    Serial.begin(115200);

    // Set WiFi to station mode and disconnect from an AP if it was previously connected
    WiFi.mode(WIFI_STA);
    WiFi.disconnect();
    delay(100);

    Serial.println("Setup done");
}

void loop()
{
    Serial.println("scan start");

    // WiFi.scanNetworks will return the number of networks found
    int n = WiFi.scanNetworks();
    Serial.println("scan done");
    if (n == 0) {
        Serial.println("no networks found");
    } else {
        Serial.print(n);
        Serial.println(" networks found");
        for (int i = 0; i < n; ++i) {
            // Print SSID and RSSI for each network found
            Serial.print(i + 1);
            Serial.print(": ");
            Serial.print(WiFi.SSID(i));
            Serial.print(" (");
            Serial.print(WiFi.RSSI(i));
            Serial.print(")");
            Serial.println((WiFi.encryptionType(i) == WIFI_AUTH_OPEN)?" ":"*");
            delay(10);
        }
    }
    Serial.println("");

    // Wait a bit before scanning again
    delay(5000);
}

mikeysklar
 
Posts: 2345
Joined: Mon Aug 01, 2016 8:10 pm

Re: ESP32 Feather HUZZAH - fails to communicate with wifi

by teppe on Thu Sep 24, 2020 8:34 am

Using your WifiScan sketch, I get an error while compiling: 'class WiFiClass' has no member named 'mode'
I copied the entire error message and included it below (I named your sketch "WifiScanAdafruit"):

Code: Select all | TOGGLE FULL SIZE
Arduino: 1.8.13 (Windows Store 1.8.42.0) (Windows 10), Board: "Adafruit ESP32 Feather, 80MHz, 921600, None, Default"

C:\Users\Parso\OneDrive\Documents\Arduino\WifiScanAdafruit\WifiScanAdafruit.ino: In function 'void setup()':

WifiScanAdafruit:13:10: error: 'class WiFiClass' has no member named 'mode'

     WiFi.mode(WIFI_STA);

          ^

WifiScanAdafruit:13:15: error: 'WIFI_STA' was not declared in this scope

     WiFi.mode(WIFI_STA);

               ^

C:\Users\Parso\OneDrive\Documents\Arduino\WifiScanAdafruit\WifiScanAdafruit.ino: In function 'void loop()':

WifiScanAdafruit:40:55: error: 'WIFI_AUTH_OPEN' was not declared in this scope

             Serial.println((WiFi.encryptionType(i) == WIFI_AUTH_OPEN)?" ":"*");

                                                       ^

Multiple libraries were found for "WiFi.h"

 Used: C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\libraries\WiFi

 Not used: C:\Users\Parso\OneDrive\Documents\Arduino\libraries\WiFiNINA

 Not used: C:\Users\Parso\OneDrive\Documents\Arduino\libraries\WiFiNINA-master

exit status 1

'class WiFiClass' has no member named 'mode'

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

teppe
 
Posts: 24
Joined: Wed Apr 11, 2018 9:02 pm

Re: ESP32 Feather HUZZAH - fails to communicate with wifi

by mikeysklar on Thu Sep 24, 2020 1:03 pm

It looks like the wrong WiFi.h is being found and the question is what is the right header file. It looks like ther are ESP32 specific WiFi examples versus general WiFi examples. Please take a look at this thread.

https://github.com/espressif/arduino-esp32/issues/103

What worked for me
Ensure that right board is selected in Tools > Board (my board is from ebay, so I chose ESP32 Dev Module)
When the right board is selected inside of examples you will have section Examples for ESP32 Dev Module
Within those examples pick Examples for ESP32 Dev Module > Wifi > WifiClient
Set up your SSID and KEY and Compile. Everything worked for me
ps. I am using Ubuntu 16.04 but I have a feeling that Windows should produce exactly same results (based on OP problem)

mikeysklar
 
Posts: 2345
Joined: Mon Aug 01, 2016 8:10 pm

Re: ESP32 Feather HUZZAH - fails to communicate with wifi

by teppe on Mon Sep 28, 2020 11:41 pm

Per your suggestion, I've downloaded a couple simple sketches that don't give me the compiling error due to a WiFi command not recognized. However, the wifi communication still doesn't work.
Here's a real simple sketch that compiles and downloads without error, but is not able to find my wifi network. After downloading and resetting, it just says "Connecting to ++MyNetwork++", followed by a dot every 500ms.
Code: Select all | TOGGLE FULL SIZE
#include <WiFi.h>

char ssid[] = "...myNetworkName...";
char password[] = "...MyPassword...";

void setup()
{
  Serial.begin(115200);
 
  //connect to WiFi
  Serial.printf("Connecting to %s ", ssid);
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
      delay(500);
      Serial.print(".");
  }
  Serial.println(" CONNECTED");
}

void loop()
{
  delay(1000);
}
I adapted this code from the "SimpleTime" sketch that I found as an example specifically for the Adafruit ESP32 Feather, which is what I'm using.

-Tom

teppe
 
Posts: 24
Joined: Wed Apr 11, 2018 9:02 pm

Re: ESP32 Feather HUZZAH - fails to communicate with wifi

by mikeysklar on Tue Sep 29, 2020 11:41 am

Hi Tom,

I'm glad you got some example code to compile and now it is just a matter of connecting to the AP.

What model of access point are you using?

Are you updating the code portion for ssid and password values?

Code: Select all | TOGGLE FULL SIZE
char ssid[] = "...myNetworkName...";
char password[] = "...MyPassword...";

mikeysklar
 
Posts: 2345
Joined: Mon Aug 01, 2016 8:10 pm

Re: ESP32 Feather HUZZAH - fails to communicate with wifi

by teppe on Tue Sep 29, 2020 12:37 pm

Yes, I put my specific network name (SSID) and password in the sketch when I tested it, but didn't want to share it on this forum.

My primary router is a Google Wifi router (dual band), which has the network name that I put in the sketch for SSID.

In addition, I have an ASUS model RT-N56U router that's set up for both 2.4 Ghz and 5Ghz. I could change the name in my sketch to point to these networks for test purposes (the 2.4 Ghz frequency is a different network name than the 5 Ghz), although I really doubt the router is the problem.

-Tom

teppe
 
Posts: 24
Joined: Wed Apr 11, 2018 9:02 pm

Re: ESP32 Feather HUZZAH - fails to communicate with wifi

by teppe on Wed Sep 30, 2020 12:00 am

For test purposes, I changed the network name (SSID) and password in my sketch (shown in post #5 above) to match my ASUS 2.4GHz network name, then the ASUS 5Ghz name, but still got the same results - no wifi connection. The Huzzah is not able to find any of the three wifi networks I've tried.

I did prove that this sketch does work with a Metro Mini 328 board (ADA 2590) hooked up to an ESP32 AirLift FeatherWing (ADA 4264). All I did was change the board from "Adafruit ESP32 Feather" to "Arduino UNO" after connecting the Mini 328/FeatherWing.

Do you think I have a bad Huzzah board?

-Tom

teppe
 
Posts: 24
Joined: Wed Apr 11, 2018 9:02 pm

Re: ESP32 Feather HUZZAH - fails to communicate with wifi

by mikeysklar on Wed Sep 30, 2020 11:10 am

Hi teppe,

I appreciate you trying each of these sketches and other hardware as well.

Let's try swapping out your Huzzah32 with a replacement. Please e-mail support@adafruit.com requesting a replacement Huzzah32 and link them to this forum. Also include your original order#.

mikeysklar
 
Posts: 2345
Joined: Mon Aug 01, 2016 8:10 pm

Re: ESP32 Feather HUZZAH - fails to communicate with wifi

by teppe on Mon Oct 05, 2020 11:37 pm

I received the replacement Huzzah board today. Thanks for that. However, I must be doing something wrong because the replacement Huzzah acts the same as the previous one. After we get this setup working, I will return the replacement board to you, if you'd like.

Anyway, the Huzzah doesn't find any networks using the ScanNetworks example, and it fails to find my specific network when I use the sketch shown above in my post #5.

I'm trying to figure out why my similar setup does work, but the Huzzah doesn't. As I said previously, I have a Metro Mini 328 board (ADA 2590) hooked up to an ESP32 AirLift FeatherWing (ADA 4264), which consistently finds my network. One difference I noticed during the uploading is that the MetroMini/FeatherWing combo uploads much quicker and has a very short message in the upload dialogue box stating the sketch size (6890 bytes of program storage space) and memory (928 bytes of dynamic memory) used. The Huzzah, on the other hand, has a lengthy message, some of which is in orange, and it uses alot more storage space/memory. I've pasted it here (below). Perhaps this offers a clue to what's preventing it from connecting?
thx, Tom
Code: Select all | TOGGLE FULL SIZE
Sketch uses 226257 bytes (17%) of program storage space. Maximum is 1310720 bytes.
Global variables use 16044 bytes (4%) of dynamic memory, leaving 311636 bytes for local variables. Maximum is 327680 bytes.
esptool.py v2.6
Serial port COM4
Connecting....
Chip is ESP32D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
MAC: f0:08:d1:d9:71:48
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 8192 bytes to 47...
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.0 seconds (effective 21845.2 kbit/s)...
Hash of data verified.
Compressed 15856 bytes to 10276...
Wrote 15856 bytes (10276 compressed) at 0x00001000 in 0.1 seconds (effective 899.6 kbit/s)...
Hash of data verified.
Compressed 226368 bytes to 113640...
Wrote 226368 bytes (113640 compressed) at 0x00010000 in 1.7 seconds (effective 1087.0 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 128...
Wrote 3072 bytes (128 compressed) at 0x00008000 in 0.0 seconds (effective 4096.1 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...

teppe
 
Posts: 24
Joined: Wed Apr 11, 2018 9:02 pm

Re: ESP32 Feather HUZZAH - fails to communicate with wifi

by mikeysklar on Tue Oct 06, 2020 5:13 pm

Hi teppe,

Let's make sure everything about your Arduino environment and ESP32 cores are correct. You had various build issues early on that were concerning signs.

Could you please do a fresh install of the current Arduino IDE renaming your current folders so avoid confusion. Then re-install the ESP32 core stable release.

https://github.com/espressif/arduino-es ... manager.md

https://learn.adafruit.com/users/auth/a ... 079d621272

Since your upload speeds have been slow you can try using the 921600 as our guide suggests.

mikeysklar
 
Posts: 2345
Joined: Mon Aug 01, 2016 8:10 pm

Re: ESP32 Feather HUZZAH - fails to communicate with wifi

by MattTheNoob on Sat Nov 21, 2020 11:49 pm

The suspense is killing me! ;D

Did Teppe get his board to work?

I'm watching this with great interest because I'm about to dive into a Huzzah project and I'm trying to get a feel for the difficulty.

MattTheNoob
 
Posts: 13
Joined: Thu Jun 04, 2015 3:10 am

Re: ESP32 Feather HUZZAH - fails to communicate with wifi

by teppe on Sun Nov 22, 2020 12:17 pm

<< SOLVED >>
Yes, my ESP32 Huzzah works now. I ended up uninstalling the 64-bit version of the Arduino IDE app, and installing the 32-bit version. I’m not saying that the 64-bit version won’t work, but the 32-bit version allows me access to delete and re-install a library, to be sure it’s the current version. I suspect my original problem was with a corrupt or outdated library file, but I had no way of deleting and re-installing it (unless I’m missing something, the “Manage Libraries” menu doesn’t give you the option of deleting a previously installed library).

Here’s what I learned: When installing the 64-bit program, it creates a folder and stores the libraries within C:\Program Files\WindowsApps (note that this is a hidden folder). When you try to access this folder you get an error 'You have been denied permission to access this folder', even if you have administrator privileges. If you search the internet you’ll find somewhat complicated ways of granting yourself access, but I learned that the 32-bit version of the Arduino app avoids this problem since it stores the libraries in C:\Program Files(x86)\Arduino\libraries, which is easily accessible.

During the uninstall of the 64-bit and the installation of the 32-bit program, it deleted all my old libraries and installed fresh versions, which solved my problem. I have not had to go into the new libraries folder to delete or replace a file, but I could if I need to do that in the future. I am now able to access my wifi by using the WiFi.h library, and I’ve been successfully using the ESP32_MailClient.h library. Also, I haven’t noticed any difference in performance between the 64-bit versus the 32-bit version. QED

Hope that helps.
-Tom

teppe
 
Posts: 24
Joined: Wed Apr 11, 2018 9:02 pm

Re: ESP32 Feather HUZZAH - fails to communicate with wifi

by MattTheNoob on Sun Nov 22, 2020 1:32 pm

Awesome! Thanks for following up.
My Huzzah is on order!

MattTheNoob
 
Posts: 13
Joined: Thu Jun 04, 2015 3:10 am

Re: ESP32 Feather HUZZAH - fails to communicate with wifi

by mikeysklar on Mon Nov 23, 2020 9:11 pm

@teppe,

Really glad to hear that a full fresh install resolved this and to understand that there could be a 64-bit / 32-bit library mismatch with a Arduino IDE update. Thank you for the followup.

mikeysklar
 
Posts: 2345
Joined: Mon Aug 01, 2016 8:10 pm

Please be positive and constructive with your questions and comments.