Go Down

Topic: Quest to get WPA2 Enterprise working on the ATWINC1500 with Arduino. (Read 539 times) previous topic - next topic

eineel

Hi,

I've spend a good week now trying to get the ATWINC1500 to connect to a WPA2 Enterprise network using PEAP and MSCHAPV2.
I've learned a lot but unfortunately I still haven't been able to connect. I will share my steps bellow in the hope someone can sopt a mistake or point me in a new direction.

1. I've updated the firmware on the feather to 19.6.1 using the firmware update tool in the Arduino IDE and a binary from Atmel.
According to the release notes from Atmel this firmware version should now support WPA2 enterprise PEAP.

2. The changes from the 19.6.1 drivers are ported to the WiFi101 library.

The above was done with the help of Joe Cicchiello whom I had hired to help me with this issue.
It is documented in more detail on his GitHub here.

The WPA2 Enterprise network is an ISP hotspot network. The ISP provides a root certificate to download and instructs to install it for Android and Windows systems although I can connect fine on Android without it.

To get this certificate loaded manually I downloaded the firmware updater from GitHub here.
I then removed some certificates from the "certs" folder to make space for the new certificate (as storage is apparently maxed out by default.)
Using the command line version of the uploader I issued:
Code: [Select]
.\winc1500-uploader.exe -certs certs -port COM7 (on Windows VM as the updater would not work under Mac OS)

This seemed to work fine so I ran the WPA2 enterprise example sketch made by Joe again but no luck. (find the sketch code bellow) I keep getting error code "6"

I'm hoping someone can shed some new light on this.

Thanks in advance.

Code: [Select]

/*

 This example connects to a WPA Enterprise Wifi network.
 Then it prints the  MAC address of the Wifi shield,
 the IP address obtained, and other network details.

 Circuit:
 * WiFi shield attached

 created 13 July 2010
 by dlf (Metodo2 srl)
 modified 31 May 2012
 by Tom Igoe
modified 29 June 2016
by Tim Dicus
 */
#include <SPI.h>
#include <WiFi101.h>

char ssid[] = "Ziggo";     //  your network SSID (name)
int status = WL_IDLE_STATUS;     // the Wifi radio's status

#define MAIN_WLAN_DEVICE_NAME "Ziggo"
#define MAIN_WLAN_802_1X_USR_NAME "myUser"
#define MAIN_WLAN_802_1X_PWD "myPass!"


// change these to your user/password
static tstr1xAuthCredentials auth;


void setup() {
  //Configure pins for Adafruit ATWINC1500 Feather
  WiFi.setPins(8,7,4,2);
   
  //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 presence of the shield:
  if (WiFi.status() == WL_NO_SHIELD) {
    Serial.println("WiFi shield not present");
    // don't continue:
    while (true);
  }

  strcpy((char*) auth.au8UserName, MAIN_WLAN_802_1X_USR_NAME);
  strcpy((char*) auth.au8Passwd, MAIN_WLAN_802_1X_PWD);

  // attempt to connect to Wifi network:
  while ( WiFi.status() != WL_CONNECTED) {
    Serial.print("Attempting to connect to WPA SSID: ");
    Serial.println(ssid);

    // Connect to WPA/WPA2 Enterprise network:
    //  WiFi.begin(ssid,ENC_TYPE_CCMP, &pass);
    //m2m_wifi_connect((char *)MAIN_WLAN_DEVICE_NAME, sizeof(MAIN_WLAN_DEVICE_NAME), M2M_WIFI_SEC_802_1X, (char *)&pass, M2M_WIFI_CH_ALL);
    uint8_t stat = WiFi.begin(ssid, &auth);
    Serial.print("Status after WiFi::begin: ");
    Serial.println(stat);
   
    delay(2000);
    Serial.print(".");
  }

  // you're connected now, so print out the data:
  Serial.print("You're connected to the network");
  printCurrentNet();
  printWifiData();

}

void loop() {
  // check the network connection once every 10 seconds:
  delay(10000);
  printCurrentNet();
}

void printWifiData() {
  // print your WiFi shield's IP address:
  IPAddress ip = WiFi.localIP();
  Serial.print("IP Address: ");
  Serial.println(ip);
  Serial.println(ip);

  // print your MAC address:
  byte mac[6];
  WiFi.macAddress(mac);
  Serial.print("MAC address: ");
  Serial.print(mac[5], HEX);
  Serial.print(":");
  Serial.print(mac[4], HEX);
  Serial.print(":");
  Serial.print(mac[3], HEX);
  Serial.print(":");
  Serial.print(mac[2], HEX);
  Serial.print(":");
  Serial.print(mac[1], HEX);
  Serial.print(":");
  Serial.println(mac[0], HEX);

}

void printCurrentNet() {
  // print the SSID of the network you're attached to:
  Serial.print("SSID: ");
  Serial.println(WiFi.SSID());

  // print the MAC address of the router you're attached to:
  byte bssid[6];
  WiFi.BSSID(bssid);
  Serial.print("BSSID: ");
  Serial.print(bssid[5], HEX);
  Serial.print(":");
  Serial.print(bssid[4], HEX);
  Serial.print(":");
  Serial.print(bssid[3], HEX);
  Serial.print(":");
  Serial.print(bssid[2], HEX);
  Serial.print(":");
  Serial.print(bssid[1], HEX);
  Serial.print(":");
  Serial.println(bssid[0], HEX);

  // print the received signal strength:
  long rssi = WiFi.RSSI();
  Serial.print("signal strength (RSSI):");
  Serial.println(rssi);

  // print the encryption type:
  byte encryption = WiFi.encryptionType();
  Serial.print("Encryption Type:");
  Serial.println(encryption, HEX);
  Serial.println();
}

Yoonghm

Hi,

I understand that different enterprise wireless networks have different hand-shaking and encryption methods. I do not see how wifi101 support this.

What is your status now? Could you share more? I am also looking for solution.

Best regards

martinius96

I connected sucessfuly to eduroam network with ATWINC1500 with my custom sketch.
But I will not share it. But i can tell you, Enterprise networks are suported.
Arduino and website programmer

keithprice

I've also been trying to connect to eduroam using the example sketch supplied by Joe.  I also get a "Giving up; not connected: _status: 6" error.



Go Up