Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cant connect to eduroam with Arduino Nano 33 IoT #214

Open
iS3cr3Ti opened this issue Mar 2, 2022 · 4 comments
Open

Cant connect to eduroam with Arduino Nano 33 IoT #214

iS3cr3Ti opened this issue Mar 2, 2022 · 4 comments
Labels
type: imperfection Perceived defect in any part of project

Comments

@iS3cr3Ti
Copy link

iS3cr3Ti commented Mar 2, 2022

Hello,
I am currently using the WiFiNINA Library (Sketch "ConnectWithWPA2Enterprise.ino"). I saw that several other Universities got it done with the ESP32.

These Arguments are needed for the WLAN-Connection:
status = WiFi.beginEnterprise(ssid, user, pass, identity, caCert);

But I dont get it working. I received the following login data from my university:

EAP-Method: TTLS or PEAP
Outer Identity with eduroam as identity
Certificate: Needed
Inner Identity with MSCHAPv2 (Username and Password)

Is there a way to specify these settings directly? Or am I doing something wrong?

@per1234
Copy link
Contributor

per1234 commented Mar 2, 2022

Hi @iS3cr3Ti. Thanks for your report.

Please provide a detailed description of the problem you are having, including the full and exact text of any associated error or warning messages.

Please open the Arduino Serial Monitor while the "ConnectWithWPA2Enterprise" and the share here the text that is printed.


Possibly related: #105

@per1234 per1234 added the type: imperfection Perceived defect in any part of project label Mar 2, 2022
@iS3cr3Ti
Copy link
Author

iS3cr3Ti commented Mar 2, 2022

The ConnectWithWPA2Enterprise Code:

/*
  This example connects to a WPA2 Enterprise WiFi network.
  Then it prints the MAC address of the WiFi module,
  the IP address obtained, and other network details.

  Based on ConnectWithWPA.ino by dlf (Metodo2 srl) and Tom Igoe
*/
#include <SPI.h>
#include <WiFiNINA.h>
#include <WiFi.h>

#include "arduino_secrets.h"
///////please enter your sensitive data in the Secret tab/arduino_secrets.h
char ssid[] = SECRET_SSID;  // your WPA2 enterprise network SSID (name)
char user[] = SECRET_USER;  // your WPA2 enterprise username (Inner Method)
char pass[] = SECRET_PASS;  // your WPA2 enterprise password (Inner Method)
char identity[] = SECRET_IDENTITY;  //your WPA2 enterpise identity (Outer Method)
char caCert[] = SECRET_CERT;  //your WPA2 enterprise certificate
int status = WL_IDLE_STATUS;     // the WiFi radio's status
byte mac[6];

void setup() {
  //Initialize serial and wait for port to open:
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }

  // check for the WiFi module:
  if (WiFi.status() == WL_NO_MODULE) {
    Serial.println("Communication with WiFi module failed!");
    // don't continue
    while (true);
  }

  String fv = WiFi.firmwareVersion();
  if (fv < WIFI_FIRMWARE_LATEST_VERSION) {
    Serial.println("Please upgrade the firmware");
  }

  // attempt to connect to WiFi network:
  while (status != WL_CONNECTED) {
    Serial.print("Attempting to connect to WPA SSID: ");
    Serial.println(ssid);
    // Connect to WPA2 enterprise network:
    // - You can optionally provide additional identity and CA cert (string) parameters if your network requires them:
    //      WiFi.beginEnterprise(ssid, user, pass, identity, caCert)
    status = WiFi.beginEnterprise(ssid, user, pass);
    Serial.print("This is the Status: ");
    Serial.println(status);
    Serial.print("This is the Idle Status: ");
    Serial.println(WL_IDLE_STATUS);
    Serial.print("This is the Wanted Status: ");
    Serial.println(WL_CONNECTED);

    // wait 10 seconds for connection:
    delay(10000);
  }

The arduino_secrets.h:

#define SECRET_SSID "eduroam"
#define SECRET_IDENTITY "Outer Identity"
#define SECRET_USER "Inner Method Username"
#define SECRET_PASS "Password for the User"
#define SECRET_CERT "-----BEGIN CERTIFICATE-----\n" \
"MIIDwzCCAqugAwIBAgIBATANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UEBhMCREUx\n" \
*********
"BSeOE6Fuwg==\n" \
"-----END CERTIFICATE-----"

Output of the Serial Monitor:

12:34:54.399 -> Attempting to connect to WPA SSID: eduroam
12:35:44.612 -> This is the Status: 1
12:35:44.612 -> This is the Idle Status: 0
12:35:44.612 -> This is the Wanted Status: 3
12:35:54.611 -> Attempting to connect to WPA SSID: eduroam
12:35:54.744 -> This is the Status: 6 (WRONG_PASSWORD)
12:35:54.744 -> This is the Idle Status: 0
12:35:54.744 -> This is the Wanted Status: 3
12:36:04.741 -> Attempting to connect to WPA SSID: eduroam
12:36:06.867 -> This is the Status: 4
12:36:06.867 -> This is the Idle Status: 0
12:36:06.867 -> This is the Wanted Status: 3

So this is the Code, which I am currently using. There is no Error Message or Warning Message. The Password is working, because I am using it with my Phone too. I just cant connect to the network.

On the related Issue #105, @facchinm m asked for the used Security Method. On my Computer there is "WPA/WPA2, EAP-TTLS, MSCHAPv2".

@iS3cr3Ti
Copy link
Author

iS3cr3Ti commented Mar 7, 2022

Should I provide more Informations or is there anything I can do?

@ChathuZ
Copy link

ChathuZ commented Jan 12, 2023

Should I provide more Informations or is there anything I can do?

Did you find a solution for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

3 participants