Arduino Forum

Products => Arduino Yún => Topic started by: bitfrosting on Nov 05, 2013, 05:11 am

Title: WPA Enterprise with Arduino Yun?
Post by: bitfrosting on Nov 05, 2013, 05:11 am
Can the Arduino Yun connect to a network that is password protected using WPA2 Enterprise? If yes, will someone please explain how. Thanks!
Title: Re: WPA Enterprise with Arduino Yun?
Post by: federicofissore on Nov 05, 2013, 10:44 am
If you search the forum, you find it's an open issue and we still haven't had time to set up a test environment.
Title: Re: WPA Enterprise with Arduino Yun?
Post by: bitfrosting on Nov 07, 2013, 06:27 pm
Hello Federico,
I've searched around the open-wrt wiki and found that open-wrt does handle WPA enterprise even though these options aren't available from the Linino web interface (LuCI). I've attempted to configure WPA enterprise by editing the /etc/config/wireless file.

However, when I restart the wifi using these settings I lose my connection to the Yun. Unfortunately, I cannot access the Yun through the network that is using WPA Enterprise, and I cannot trouble shoot any further, because of my lost connection to the Yun. Do you know how I can connect to the Yun via USB, so that I can continue playing around with the /etc/config/wireless file until I have it configured properly?
Title: Re: WPA Enterprise with Arduino Yun?
Post by: noblepepper on Nov 07, 2013, 06:33 pm
Load the YunSerialTerminal sketch over USB, then you get a console in the SerialMonitor or any other terminal program like PuTTY or picocom attached to the USB port for the Yun.
Title: Re: WPA Enterprise with Arduino Yun?
Post by: bitfrosting on Nov 07, 2013, 06:43 pm
Hi Noblepepper,
Thanks for the suggestion. I have a noob follow up question: after I load the YunSerialTerminal sketch how would I use PuTTY to "access" the terminal?
Thanks!
Title: Re: WPA Enterprise with Arduino Yun?
Post by: noblepepper on Nov 07, 2013, 08:40 pm
I assume you are on windows if you want to use PuTTY, you download it from here: http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html (http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html). Run it and select a Serial connection, point it to the COM your Yun (or any other arduino) is on and set the speed to whatever speed the Serial.begin(); set.
Title: Re: WPA Enterprise with Arduino Yun?
Post by: federicofissore on Nov 08, 2013, 08:56 am
The other option is to plug in an Ethernet cable and access the yun through it. This way you'll never lose the connection as long as you'll play with wifi (because they are two separate network interfaces)
Title: Re: WPA Enterprise with Arduino Yun?
Post by: bitfrosting on Nov 11, 2013, 07:50 am
YES!!!
I've got the Yun to connect via WPA2 Enterprise and I'll include the steps I followed at the bottom of this post. Before getting to this, however, I think my setup is incomplete and could use some further guidance. Specifically, I do not know how to download a CA cert for the network I connect to. This doesn't seem to be necessary to make a connection, because I still connect, but these CA certs seem pretty standard, so I'm not sure what to do. Finally, I can only connect to my Yun by typing the numerical IP address, but not via http://arduino.local; this has been an on-going issue for me, because I do not understand it. How can I connect to my Yun using the the numerical IP address, but then fail to connect via http://arduino.local?

Also, are all opkg packages installed to the Yun memory? Can (and should) any packages be installed to the sd card?

A way to have the Yun connect to WPA Enterprise; I hope this helps as a starting point for just one other soul:
0. This setup was preformed with the help of  Windows box.
1. Connect the Yun to a computer via the micro USB. This is not only a good way to power the Yun, but also convenient to communicate with a virtual serial connection. Upload the sketch File>Examples>Bridge>YunSerialTerminal from the Arduino IDE.
2. Place the Yun within range of a wireless network (or connected via ethernet) that does not require WPA Enterprise. Connect the Yun to this network.
3. Open PuTTY, select the Serial from the radio buttons, and change the baud rate to 115200. The baud rate will be whatever was set in the YunSerialTerminal sketch in the line
Code: [Select]
Serial.begin(####). Click the Open button and a window will open. Press enter and the Linino spash screen should appear or at the very least a command line.
4. Install wpad with the opkg package manager, because wpad has the wpa-enterprise ability whereas wpad-mini, the default package in the Yun, does not. wpad-mini comes pre-installed and must be removed first.
Code: [Select]
opkg update
opkg remove wpad-mini
opkg install wpad

5. Confirm the installation with
Code: [Select]
opkg list-installed.
6. Edit the /etc/config/network file using the vi text editor. Add a new config section that looks like
Code: [Select]
config interface 'myNetwork'
     option proto 'dhcp'
.
To start editing the file, from the command line enter
Code: [Select]
vi /etc/config/network.

7. Now, edit the /etc/config/wireless file using vi again. I found my setup worked when I included only the following under the config wifi-iface section. Also, some of these settings are network specific, so please adjust accordingly:
Code: [Select]
option device 'radio0'
option network 'myNetwork'
option mode 'sta'
option encryption 'mixed-wpa+aes'
option eap_type 'peap'
option ssid 'mySSID'
option identity 'myUsername'
option password 'myPassword'

8. Move the Yun into the range of the WPA Enterprise protected network. Restart the wireless interface of the Yun by entering the following command from the command line:
Code: [Select]
wifi
9. The Yun will output some text with details about the connection being made. Finally, confirm and discover the IP address assigned to the Yun using the command
Code: [Select]
ifconfig. The output of this command will contain a section called wlan0; the IP address can be found next to the text inet.

Thanks for everyone's help!
Title: Re: WPA Enterprise with Arduino Yun?
Post by: federicofissore on Nov 11, 2013, 10:36 am
You saved me hours of work! Thank you so much!
Title: Re: WPA Enterprise with Arduino Yun?
Post by: ProfePaco on Nov 20, 2013, 04:24 pm
Thanks for sharing!!!
Title: Re: WPA Enterprise with Arduino Yun?
Post by: Jesse12345 on Mar 12, 2014, 02:11 am
I don't think the network interface 'myNetwork' is initialized until you run the script /etc/init.d/network start

At which point, the wifi command works.

Thanks for the tutorial!
Title: Re: WPA Enterprise with Arduino Yun?
Post by: Ryan_Ferrin on Dec 10, 2014, 05:36 pm
Thanks for the Information!

For this info:

option device 'radio0'
option network 'myNetwork'
option mode 'sta'
option encryption 'mixed-wpa+aes'
option eap_type 'peap'

Can you tell me where I find the network specific content?

thank you,

Ryan
Title: Re: WPA Enterprise with Arduino Yun?
Post by: sonnyyu on Dec 11, 2014, 05:46 pm
http://wiki.openwrt.org/doc/uci/wireless (http://wiki.openwrt.org/doc/uci/wireless)

Check WPA Modes sections for Value.


http://www.itcom.itd.umich.edu/wireless/connect/xp.php (http://www.itcom.itd.umich.edu/wireless/connect/xp.php)

Use Windows machine login WPA2 Enterprise network, copy the value from windows machine.

Title: Re: WPA Enterprise with Arduino Yun?
Post by: Ryan_Ferrin on Dec 13, 2014, 01:28 am
Thank you Sonnyyu!
Title: Re: WPA Enterprise with Arduino Yun?
Post by: PineCone on Feb 02, 2015, 05:41 pm
I would like to do this also but I am running into some problems.  I am getting numerous error messages as the Yun tries but then says wlan0: deauthenticating from <address> by local choice (Reason: 3=DEAUTH_LEAVING).  This may be because something is overwriting the content I put into /etc/config/wireless.  In particular, these lines get modified.

option mode 'sta'
option encryption 'mixed-wpa+aes'
option ssid 'mySSID'


ssid gets reset to the original Yun SSID that it came with out of the box.  Encryption is reset to none and mode is switched to 'ap'.  I can confirm that the file has been saved when I make the changes using vi.  I can re-edit the file using vi and the changes are there.  However, running subsequent commands lead to these changes.
Title: Re: WPA Enterprise with Arduino Yun?
Post by: ShapeShifter on Feb 02, 2015, 08:37 pm
ssid gets reset to the original Yun SSID that it came with out of the box.  Encryption is reset to none and mode is switched to 'ap'.  I can confirm that the file has been saved when I make the changes using vi.
Yes, those are the default out of the box settings. When the Yun boots, it tries to connect to the access point you had configured (mySSID in your example.) If, after one minute, there hasn't been a successful WiFi connection, the Yun resets the WiFi connection to the defaults and reboots. The idea is that if you improperly configured the WiFi settings, and the Yun is unable to connect, it will return to the default access point mode to allow you connect and retry the settings.

The problem here is the deauthentication. You need to solve that: it's not being caused by these parameters getting reset. I wouldn't worry about the settings getting reset at this point, as this is what is letting you back in for another try.

Once you get it to where it will authenticate properly (and stay authenticated) you can easily disable this automatic reset behavior (it gets annoying to have to reset everything back the way you want it if your access point goes down temporarily.) You may also want to disable this behavior if you have another way to access your Yun, like the Ethernet port.

To stop this auto-reset, edit /etc/rc.local, and comment out the line that calls wifi-live-or-reset
Title: Re: WPA Enterprise with Arduino Yun?
Post by: jessemonroy650 on Feb 02, 2015, 10:27 pm
::::SNIP::::
ssid gets reset to the original Yun SSID that it came with out of the box.  Encryption is reset to none and mode is switched to 'ap'.  I can confirm that the file has been saved when I make the changes using vi.  I can re-edit the file using vi and the changes are there.  However, running subsequent commands lead to these changes.
PineCone,
The Arduino Yun has a script that puts it back into default SSID and AP mode, when it cannot find the AP you have set it for.

Watch this video (6:53)
Getting started with Arduino Yún - tutorial
https://www.youtube.com/watch?v=9-hPhWHWnvs (https://www.youtube.com/watch?v=9-hPhWHWnvs)

Then, read these short instructions.
Resetting the processors (AR9331, WiFi, and 32U4)
http://arduino.cc/en/Guide/ArduinoYun#toc6 (http://arduino.cc/en/Guide/ArduinoYun#toc6)

Then start over, plug in your Yun, do a quick reset (5-10 seconds), and run this sketch
http://arduino.cc/en/Tutorial/YunSerialTerminal (http://arduino.cc/en/Tutorial/YunSerialTerminal)

Let us know how it goes.
Post results from the YunSerialTerminal, if you are still having problems
Please use markup when posting results.

Jesse




Title: Re: WPA Enterprise with Arduino Yun?
Post by: PineCone on Feb 04, 2015, 05:17 pm
Thank you all, I will give these a try!
Title: Re: WPA Enterprise with Arduino Yun?
Post by: PhoenixMT on Mar 30, 2015, 08:50 pm
YES!!!
I've got the Yun to connect via WPA2 Enterprise...
Fantastic post, thank very much for sharing.  I was up and running in about 3 mins after reading your post.
Title: Re: WPA Enterprise with Arduino Yun?
Post by: jessemonroy650 on Mar 30, 2015, 10:22 pm
@PineCone,
please start a new thread and explain your problem from the beginning. There are three solutions to this thread and two have nothing to do with the original problem.

It is very likely you have a different problem. Please start a new thread.

Jesse
Title: Re: WPA Enterprise with Arduino Yun?
Post by: vanko25 on Apr 26, 2016, 06:08 pm
Hello all,

I've followed the tutorial bitfrosting but still can not connect to my network. I am sure that it uses WPA2-Enterprise and PEAP. The problem is that it gets associated and then says
Code: [Select]
deauthenticating from b4:a4:e3:ca:be:f0 by local choice (Reason: 3=DEAUTH_LEAVING)
 and drops the connection. Any ideas?
Title: Re: WPA Enterprise with Arduino Yun?
Post by: mdfitzpatrick on Jun 13, 2016, 05:23 pm
YES!!!
I've got the Yun to connect via WPA2 Enterprise and I'll include the steps I followed at the bottom of this post. Before getting to this, however, I think my setup is incomplete and could use some further guidance. Specifically, I do not know how to download a CA cert for the network I connect to. This doesn't seem to be necessary to make a connection, because I still connect, but these CA certs seem pretty standard, so I'm not sure what to do. Finally, I can only connect to my Yun by typing the numerical IP address, but not via http://arduino.local; this has been an on-going issue for me, because I do not understand it. How can I connect to my Yun using the the numerical IP address, but then fail to connect via http://arduino.local?

Also, are all opkg packages installed to the Yun memory? Can (and should) any packages be installed to the sd card?

A way to have the Yun connect to WPA Enterprise; I hope this helps as a starting point for just one other soul:
0. This setup was preformed with the help of  Windows box.
1. Connect the Yun to a computer via the micro USB. This is not only a good way to power the Yun, but also convenient to communicate with a virtual serial connection. Upload the sketch File>Examples>Bridge>YunSerialTerminal from the Arduino IDE.
2. Place the Yun within range of a wireless network (or connected via ethernet) that does not require WPA Enterprise. Connect the Yun to this network.
3. Open PuTTY, select the Serial from the radio buttons, and change the baud rate to 115200. The baud rate will be whatever was set in the YunSerialTerminal sketch in the line
Code: [Select]
Serial.begin(####). Click the Open button and a window will open. Press enter and the Linino spash screen should appear or at the very least a command line.
4. Install wpad with the opkg package manager, because wpad has the wpa-enterprise ability whereas wpad-mini, the default package in the Yun, does not. wpad-mini comes pre-installed and must be removed first.
Code: [Select]
opkg update
opkg remove wpad-mini
opkg install wpad

5. Confirm the installation with
Code: [Select]
opkg list-installed.
6. Edit the /etc/config/network file using the vi text editor. Add a new config section that looks like
Code: [Select]
config interface 'myNetwork'
     option proto 'dhcp'
.
To start editing the file, from the command line enter
Code: [Select]
vi /etc/config/network.
  • Press 'i' to start editing text
  • Press 'ESC' to stop editing text
  • Type ':x' save changes and exit
  • Type ':q' to exit
  • Type ':q!' to exit without saving changes

7. Now, edit the /etc/config/wireless file using vi again. I found my setup worked when I included only the following under the config wifi-iface section. Also, some of these settings are network specific, so please adjust accordingly:
Code: [Select]
option device 'radio0'
option network 'myNetwork'
option mode 'sta'
option encryption 'mixed-wpa+aes'
option eap_type 'peap'
option ssid 'mySSID'
option identity 'myUsername'
option password 'myPassword'

8. Move the Yun into the range of the WPA Enterprise protected network. Restart the wireless interface of the Yun by entering the following command from the command line:
Code: [Select]
wifi
9. The Yun will output some text with details about the connection being made. Finally, confirm and discover the IP address assigned to the Yun using the command
Code: [Select]
ifconfig. The output of this command will contain a section called wlan0; the IP address can be found next to the text inet.

Thanks for everyone's help!
Hey so i did this and it worked!
I just have one last concern. Without rooting into the device how can I tell what IP address the Yun has been assigned?
Normally if im connected to the same network as the yun in the Arduino IDE i can see a list of all devices connected to the network but i cannot see any devices.
Title: Re: WPA Enterprise with Arduino Yun?
Post by: tibohuyers on Dec 08, 2017, 03:34 pm
Arduino support redirected me here to be able to connect to wifi at my school using the arduino industrial 101.

I am having some trouble installing the wpad package.
this i what i entered into the console from putty and what i got back.

root@ArduinoIndustrial101:/# opkg update
Downloading http://download.linino.org/linino_distro/lininoIO/latest/packages/Packages.gz.
Downloading http://download.linino.org/linino_distro/lininoIO/latest/packages/Packages.sig.
signature check failed.
Remove wrong Signature file.
Collected errors:
* opkg_download: Failed to download http://download.linino.org/linino_distro/lininoIO/latest/packages/Packages.gz, wget returned 4.
* opkg_download: Failed to download http://download.linino.org/linino_distro/lininoIO/latest/packages/Packages.sig, wget returned 4.
root@ArduinoIndustrial101:/# opkg remove wpad-mini
Removing package wpad-mini from root...
root@ArduinoIndustrial101:/# opkg install wpad
Unknown package 'wpad'.
Collected errors:
* opkg_install_cmd: Cannot install package wpad.

In red you can see i uninstalled wpad mini. And in blue i tried to install wpad, but it says it's an unknown package.
When i try to reinstall wpad mini it also says unknow package:

root@ArduinoIndustrial101:/# opkg install wpad-mini
Unknown package 'wpad-mini'.
Collected errors:
* opkg_install_cmd: Cannot install package wpad-mini.