# Setting up Photon/P1 on WPA Enterprise (0.7.0)

**URL:** <https://community.particle.io/t/setting-up-photon-p1-on-wpa-enterprise-0-7-0/34167>\
**Category:** Firmware\
**Created:** [June 29, 2017, 4:20pm UTC](https://community.particle.io/t/setting-up-photon-p1-on-wpa-enterprise-0-7-0/34167 "2017-06-29T16:20:16Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![BDub](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/bdub/32/5137_2.png) [@BDub](https://community.particle.io/u/BDub)\
**Post date:** [June 29, 2017, 4:20pm UTC](https://community.particle.io/t/setting-up-photon-p1-on-wpa-enterprise-0-7-0/34167/1 "2017-06-29T16:20:16Z")

</div>

Hi Friends!

**WPA Enterprise support is here!** We have a pre-release firmware version 0.7.0-rc.x that is waiting for you to start using now. Also remember that it is not ready for production until it’s defaulted to 0.7.0.

### Purpose

This thread will serve the purpose of creating a place to provide instructions for the WPA Enterprise setup process as it evolves, and help to answer any questions that come up about the process. Currently as of this writing we have two ways to run setup: 1) Serial setup over USB without the CLI, and 2) CLI support with v1.23.1 via `particle serial wifi`.

### Required

WPA Enterprise requires a capable access point and a separate authentication server. We would love to see you try the various test methods below, and of course chime in and let us know if it’s working well in your already established WPA Enterprise environment (campuses, workplace, etc…).

### Test Methods

1. Setting up a WPA2 Enterprise Test Environment with Raspberry Pi [Instructions Below](https://community.particle.io/t/setting-up-photon-p1-on-wpa-enterprise-0-7-0-rc-1/34167/2)
2. Setting up a WPA2 Enterprise Test Environment with a local computer via Docker image [Instructions Below](https://community.particle.io/t/setting-up-photon-p1-on-wpa-enterprise-0-7-0-rc-1/34167/3)
3. Share your own test method! Please let us know which authentication types you used and what issues you might have run into.

### More WPA Enterprise Docs links:

[setCredentials()](https://prerelease-docs.particle.io/reference/firmware/photon/#setcredentials-)  
[WiFiCredentials class](https://prerelease-docs.particle.io/reference/firmware/photon/#wificredentials-class)

---

<div class="post-metadata">

**Author:** ![BDub](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/bdub/32/5137_2.png) [@BDub](https://community.particle.io/u/BDub)\
**Post date:** [June 29, 2017, 4:20pm UTC](https://community.particle.io/t/setting-up-photon-p1-on-wpa-enterprise-0-7-0/34167/2 "2017-06-29T16:20:46Z")

</div>

# Setting up a WPA2 Enterprise Test Environment with Raspberry Pi

## Required Gear

1. Raspberry Pi 2/3 for the RADIUS server
2. Ethernet cable
3. Wireless Access Point (WAP) that is capable of using WPA2 Enterprise mode, and pointing to a RADIUS server for authentication

## Setup

1. Download [RASPBIAN JESSIE WITH PIXEL](https://www.raspberrypi.org/downloads/raspbian/)
2. Unzip and Write to SD card using the appropriate software ([ApplePi-Baker app on Mac](https://www.tweaking4all.com/software/macosx-software/macosx-apple-pi-baker/))
3. Boot up the Pi with the newly created SD card
4. WAP should be in WPA2 Personal mode for initial configuration

### The following commands need an HDMI, Keyboard and Mouse connection on the RasPi

1. Connect to WAP over Wi-Fi (optional)
2. Change resolution to 1280x720 (optional)
3. Rename host to `radiusserver` so it's easy to recognize on your Access Point (optional)
4. Change Keyboard to US alternative (optional)
5. **Enable ssh (required)**

### Plug the RasPi into the WAP with an ethernet cable (required)

- This will remove the catch 22 necessity for the RasPi to have to authenticate with itself once we enable WPA2 Enterprise

### Plug your host computer into the WAP with an ethernet cable as well, so you don't lose connection with it during configuration (required)

1. Log into the WAP (192.168.1.1 or 10.0.0.1 typically)

2. Find the list of clients, and grab the IP address for device "radiusserver"

3. Add a password for `root`

4. Change `PermitRootLogin without-password` to `PermitRootLogin yes` in:

5. Reboot the Pi and login as `root`, commands will be much easier.

6. If you have previously ssh'd into this address and get an error, you may need to:

7. Install freeradius

8. Edit the clients.conf file

9. Make a directory for new certificate files on the RasPi

10. Edit the eap.conf file

11. Copy certificate files

12. Edit the users file

13. Restart freeradius in debugging mode so we can see what's going on

## Now let's switch the WAP to use WPA Enterprise

1. Switch the Wireless Authentication Type to WPA2 Enterprise (apply)
2. Under RADIUS Setting configuration:
  - Server IP Address: Enter the IP address of the `radiusserver` (our RasPi)
  - Server Port: `1812`
  - Connection Secret: `particle`

## Setup the Photon/P1

1. Connect via USB cable

2. Enter Listening Mode

3. Connect via serial (`screen /dev/cu.usbmodemXXXX` on Mac or use Tera Term VT on Windows)

4. Press `w`

5. If you are still SSH'd into your RasPi, you should see activity from the freeradius process, and your device should have an internet connection.

6. If you don't see any activity, try rebooting your RasPi

---

<div class="post-metadata">

**Author:** ![BDub](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/bdub/32/5137_2.png) [@BDub](https://community.particle.io/u/BDub)\
**Post date:** [June 29, 2017, 4:20pm UTC](https://community.particle.io/t/setting-up-photon-p1-on-wpa-enterprise-0-7-0/34167/3 "2017-06-29T16:20:56Z")

</div>

# Setting up a WPA2 Enterprise Test Environment with a local computer via Docker image

## Required Gear

1. Local Computer for the RADIUS server
2. [Docker](https://www.docker.com/) pre-installed
3. Ethernet cable
4. Wireless Access Point (WAP) that is capable of using WPA2 Enterprise mode, and pointing to a RADIUS server for authentication

## Setup

1. WAP should be in WPA2 Personal mode for initial configuration

2. Plug the Local Machine into the WAP with an ethernet cable (required)

3. Log into the WAP (192.168.1.1 or 10.0.0.1 typically)

4. Find the list of clients, and grab the IP address for your Local Computer

5. Clone this repo on your Local Machine [GitHub - avtolstoy/particle-wpa-enterprise-docker: A Docker image with a test FreeRADIUS configuration to test EAP-TLS and PEAP/MSCHAPv2 authentication.](https://github.com/avtolstoy/particle-wpa-enterprise-docker)

6. Navigate to the `particle-wpa-enterprise-docker` directory on your Local Computer via terminal.

7. Build the Docker Image (this will take a while)

8. Run the Docker Image (you should see debugging output from the FreeRADIUS process)

## Now let's switch the WAP to use WPA Enterprise

1. Switch the Wireless Authentication Type to WPA2 Enterprise (apply)
2. Under RADIUS Setting configuration:
  - Server IP Address: Enter the IP address of the Local Machine
  - Server Port: `1812`
  - Connection Secret: `particle`

## Setup the Photon/P1

1. Connect via USB cable

2. Enter Listening Mode

3. Connect via serial (`screen /dev/cu.usbmodemXXXX` on Mac or use Tera Term VT on Windows)

4. Press `w`

5. If you still have the Docker process in Terminal open, you should see activity from the freeradius process, and your device should have an internet connection.

6. If you don't see any activity, try restarting the Docker image (see kill command below, run is above).

7. If you'd like to terminate the Docker image, follow these steps:

---

<div class="post-metadata">

**Author:** ![BDub](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/bdub/32/5137_2.png) [@BDub](https://community.particle.io/u/BDub)\
**Post date:** [June 29, 2017, 6:51pm UTC](https://community.particle.io/t/setting-up-photon-p1-on-wpa-enterprise-0-7-0/34167/4 "2017-06-29T18:51:52Z")

</div>

Pinned on June 29, 2017, 6:51pm UTC



---

<div class="post-metadata">

**Author:** ![BDub](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/bdub/32/5137_2.png) [@BDub](https://community.particle.io/u/BDub)\
**Post date:** [June 29, 2017, 6:55pm UTC](https://community.particle.io/t/setting-up-photon-p1-on-wpa-enterprise-0-7-0/34167/5 "2017-06-29T18:55:51Z")

</div>

# Saving a spot for CLI setup

---

<div class="post-metadata">

**Author:** ![Viscacha](https://avatars.discourse-cdn.com/v4/letter/v/919ad9/32.png) [@Viscacha](https://community.particle.io/u/Viscacha)\
**Post date:** [July 7, 2017, 10:27am UTC](https://community.particle.io/t/setting-up-photon-p1-on-wpa-enterprise-0-7-0/34167/6 "2017-07-07T10:27:13Z")

</div>

This all looks very promising, will anybody be altering the SoftAP example to support this?  
I would imagine it would need the user to have the key and certificate stored as files on their device and then a way of uploading them, tapping them in on a phone would be a disaster!

---

<div class="post-metadata">

**Author:** ![BDub](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/bdub/32/5137_2.png) [@BDub](https://community.particle.io/u/BDub)\
**Post date:** [July 7, 2017, 3:47pm UTC](https://community.particle.io/t/setting-up-photon-p1-on-wpa-enterprise-0-7-0/34167/7 "2017-07-07T15:47:29Z")

</div>

Thanks @Viscacha Do you mean the [**SoftAP HTTP Pages**](https://docs.particle.io/reference/firmware/photon/#softap-http-pages) in firmware, or [**Photon Web Setup**](https://setup.particle.io/)? There is released support for WPA Enterprise in the [**softap-setup-js library**](https://github.com/spark/softap-setup-js/releases/tag/v4.1.0) now, so this is on our radar along with support in the iOS and Android Tinker apps!

---

<div class="post-metadata">

**Author:** ![Viscacha](https://avatars.discourse-cdn.com/v4/letter/v/919ad9/32.png) [@Viscacha](https://community.particle.io/u/Viscacha)\
**Post date:** [July 7, 2017, 4:03pm UTC](https://community.particle.io/t/setting-up-photon-p1-on-wpa-enterprise-0-7-0/34167/8 "2017-07-07T16:03:45Z")

</div>

I mean the SoftAP HTTP pages

---

<div class="post-metadata">

**Author:** ![naikrovek](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/naikrovek/32/4162_2.png) [@naikrovek](https://community.particle.io/u/naikrovek)\
**Post date:** [July 11, 2017, 5:55pm UTC](https://community.particle.io/t/setting-up-photon-p1-on-wpa-enterprise-0-7-0/34167/10 "2017-07-11T17:55:06Z")

</div>

Oh holy cow I am **happy** about this. I haven’t tested it yet, and I have the infrastructure to test ALL of the scenarios you’ve (very helpfully) outlined.

not much of a requirement for me, but I suspect the next ask you’re going to receive in terms of enterprise compatibility is going to be proxy support. not everyone uses transparent proxies.

---

<div class="post-metadata">

**Author:** ![BDub](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/bdub/32/5137_2.png) [@BDub](https://community.particle.io/u/BDub)\
**Post date:** [July 20, 2017, 2:56pm UTC](https://community.particle.io/t/setting-up-photon-p1-on-wpa-enterprise-0-7-0/34167/11 "2017-07-20T14:56:00Z")

</div>

@Viscacha actually I misinterpreted something and SoftAP HTTP Pages doesn’t require any firmware changes, just the example needs to be updated. Pull requests to the Docs repo for this example would be very welcome 🙂

---

<div class="post-metadata">

**Author:** ![Viscacha](https://avatars.discourse-cdn.com/v4/letter/v/919ad9/32.png) [@Viscacha](https://community.particle.io/u/Viscacha)\
**Post date:** [July 20, 2017, 3:06pm UTC](https://community.particle.io/t/setting-up-photon-p1-on-wpa-enterprise-0-7-0/34167/12 "2017-07-20T15:06:32Z")

</div>

I figured I could probably call the relevant functions if I added them to the page but my HTML skills date back to the use of tags like `<FRAME>`` and `` <BLINK>`😉

---

<div class="post-metadata">

**Author:** ![naikrovek](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/naikrovek/32/4162_2.png) [@naikrovek](https://community.particle.io/u/naikrovek)\
**Post date:** [July 27, 2017, 4:28pm UTC](https://community.particle.io/t/setting-up-photon-p1-on-wpa-enterprise-0-7-0/34167/13 "2017-07-27T16:28:01Z")

</div>

I’m having an issue on a Photon that I’ve upgraded to 0.7.0 with an ST-Link. I always get an error when it tries to save the credentials I have entered. No one else is reporting this (that I’ve found) so I’m pretty sure it’s something I’ve done wrong. I don’t know what it could be, though.

Anyone know?

---

<div class="post-metadata">

**Author:** ![ScruffR](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/scruffr/32/6952_2.png) [@ScruffR](https://community.particle.io/u/ScruffR)\
**Post date:** [July 27, 2017, 4:52pm UTC](https://community.particle.io/t/setting-up-photon-p1-on-wpa-enterprise-0-7-0/34167/14 "2017-07-27T16:52:33Z")

</div>

How are you applying the credentials?

Since SoftAP is mentioned in this thread, there is an open issue about 0.7.0-xxx and SoftAP here

> <https://github.com/particle-iot/firmware/issues/1360>

---

<div class="post-metadata">

**Author:** ![naikrovek](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/naikrovek/32/4162_2.png) [@naikrovek](https://community.particle.io/u/naikrovek)\
**Post date:** [July 27, 2017, 5:19pm UTC](https://community.particle.io/t/setting-up-photon-p1-on-wpa-enterprise-0-7-0/34167/15 "2017-07-27T17:19:15Z")

</div>

I’m using the serial interface, so I don’t think that bug applies to me.

---

<div class="post-metadata">

**Author:** ![ScruffR](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/scruffr/32/6952_2.png) [@ScruffR](https://community.particle.io/u/ScruffR)\
**Post date:** [July 27, 2017, 7:22pm UTC](https://community.particle.io/t/setting-up-photon-p1-on-wpa-enterprise-0-7-0/34167/16 "2017-07-27T19:22:36Z")

</div>

> [@naikrovek](#):
>
> I always get an error when it tries to save the credentials I have entered.

What error would this be?  
Is the network present and visible?  
Are you using CLI or a serial terminal via the `w` command?

---

<div class="post-metadata">

**Author:** ![naikrovek](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/naikrovek/32/4162_2.png) [@naikrovek](https://community.particle.io/u/naikrovek)\
**Post date:** [July 27, 2017, 7:48pm UTC](https://community.particle.io/t/setting-up-photon-p1-on-wpa-enterprise-0-7-0/34167/17 "2017-07-27T19:48:34Z")

</div>

I can’t recall the error at the moment, and it is related to not being able to save the configuration. I can’t find one now to test with, and the one I’m having an issue with is at work. I’ll get you the exact error message tomorrow.

Network is present and visible.

Serial terminal via `w` command.

---

<div class="post-metadata">

**Author:** ![naikrovek](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/naikrovek/32/4162_2.png) [@naikrovek](https://community.particle.io/u/naikrovek)\
**Post date:** [July 28, 2017, 6:48pm UTC](https://community.particle.io/t/setting-up-photon-p1-on-wpa-enterprise-0-7-0/34167/18 "2017-07-28T18:48:00Z")

</div>

Here’s the error I see. I’m not prompted for credentials, which I imagine is the second stage of this procedure.

![](https://us1.discourse-cdn.com/flex026/uploads/particle/original/2X/6/6ba28cb7d1fe1805fbd3621aabedf6c306e3b16e.png)

---

<div class="post-metadata">

**Author:** ![ScruffR](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/scruffr/32/6952_2.png) [@ScruffR](https://community.particle.io/u/ScruffR)\
**Post date:** [July 28, 2017, 8:32pm UTC](https://community.particle.io/t/setting-up-photon-p1-on-wpa-enterprise-0-7-0/34167/19 "2017-07-28T20:32:14Z")

</div>

That’s something for @rickkas7 to look into (and maybe forward to the engineers)

---

<div class="post-metadata">

**Author:** ![Visionary](https://avatars.discourse-cdn.com/v4/letter/v/13edae/32.png) [@Visionary](https://community.particle.io/u/Visionary)\
**Post date:** [August 2, 2017, 3:20pm UTC](https://community.particle.io/t/setting-up-photon-p1-on-wpa-enterprise-0-7-0/34167/20 "2017-08-02T15:20:36Z")

</div>

Hello there!

I'm trying to connect my Photon to the WiFi of my university using WPA2-Enterprise/PEAP/MSCHAP2.  
My code seems fine, I'm using the 0.7.0-rc2 firmware, but I get the following log:

> 0000005603 [hal.wlan] INFO: Clearing enterprise credentials  
> 0000005684 [hal.wlan] INFO: EAP config valid: 0  
> 0000005684 [hal.wlan] INFO: Writing EAP configuration

> 0000005850 [hal.wlan] INFO: EAP config valid: 1  
> 0000005850 [hal.wlan] INFO: Writing EAP configuration  
> 0000007269 [hal.wlan] ERROR: wiced\_join\_ap\_specific(), result: 1025  
> 0000007703 [hal.wlan] INFO: Joining CampusWLAN  
> 0000008489 [hal.wlan] ERROR: wiced\_join\_ap\_specific(), result: 1025  
> 0000008924 [hal.wlan] INFO: Joining CampusWLAN

Sometimes i get a 1025 result, sometimes 1024 and sometimes 1006. But I don't even know if these numbers are relevant.

My code doesn't do anything special:

> WiFiCredentials credentials("CampusWLAN", WPA2\_ENTERPRISE);  
> // EAP type: PEAP/MSCHAPv2  
> credentials.setEapType(WLAN\_EAP\_TYPE\_PEAP);  
> credentials.setIdentity("user");  
> credentials.setPassword("pass");  
> credentials.setCipher(WLAN\_CIPHER\_AES);  
> credentials.setOuterIdentity("anonymous");

> WiFi.setCredentials(credentials);

Checking the settings i made in Ubuntu, it should work. Can I get a better a better log with more info or more details about this somehow?

Thanks for your help!

---

<div class="post-metadata">

**Author:** ![BDub](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/bdub/32/5137_2.png) [@BDub](https://community.particle.io/u/BDub)\
**Post date:** [August 2, 2017, 3:37pm UTC](https://community.particle.io/t/setting-up-photon-p1-on-wpa-enterprise-0-7-0/34167/21 "2017-08-02T15:37:23Z")

</div>

> [@naikrovek](#):
>
> Here's the error I see.

@naikrovek This one may indicate that you are out of heap needed for WPA Enterprise. Try reducing some of the static ram allocation in your user app, possibly moving things to flash with `const`. You can also use the System.freeMemory() to get an idea of where you are at.[quote="Visionary, post:20, topic:34167"]

Sometimes i get a 1025 result, sometimes 1024 and sometimes 1006. But I don't even know if these numbers are relevant.  
[/quote]

@Visionary would you please try a few things for me? I'd like to know if you get the same issue if you use the serial based setup (see above). Also if you move to different locations on campus do you still have problems? What is the signal strength of the network as reported by your computer? Try commenting out `credentials.setOuterIdentity("anonymous");` as well and leave this as the default setting. When trying serial based setup, just press enter for Outer Identity vs. typing "anonymous" first.

[Next page](https://community.particle.io/t/setting-up-photon-p1-on-wpa-enterprise-0-7-0/34167.md?page=2)
