8000 esp8266: WPA2 Enterprise support? · Issue #2778 · micropython/micropython · GitHub
[go: up one dir, main page]

Skip to content

esp8266: WPA2 Enterprise support? #2778

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

Open
udupa-varun opened this issue Jan 9, 2017 · 28 comments
Open

esp8266: WPA2 Enterprise support? #2778

udupa-varun opened this issue Jan 9, 2017 · 28 comments
Labels
enhancement Feature requests, new feature implementations port-esp8266

Comments

@udupa-varun
Copy link

The network security protocols that can be handled are listed as WEP, WPA-PSK and WPA2-PSK. Are there any plans to support WPA2-Enterprise PEAP in the near future? Would love to see that included.

@dpgeorge
Copy link
Member

Note that there are multiple boards that support wifi... which in particular are you talking about?

@udupa-varun
Copy link
Author

Of course, sorry about that. I should have mentioned that I meant the ESP8266 NodeMCU development boards. For example, the Adafruit HUZZAH ESP8266 Breakout or the Lolin NODEMCU v3.

@wilatai
Copy link
wilatai commented Feb 2, 2017

If possible, I would love to see this supported for ESP8266 NodeMCU boards.

It would open so many possibilities in business and education environments that frequently use this form of network security.

@pfalcon
Copy link
Contributor
pfalcon commented Feb 2, 2017

It would open so many possibilities in business and education environments that frequently use this form of network security.

Feel free to sponsor this development.

@wilatai
Copy link
wilatai commented Feb 3, 2017

What are the options to sponsor this development?
Is there a donation/bounty/crowdfunding system in place somewhere?

@pfalcon
Copy link
Contributor
pfalcon commented Feb 3, 2017

There's a universal bounty platform for Open Source project, you can watch an attempt to use it in this ticket: #888 (comment)

For serious ("business and education") offers please contact George Robotics, the creators of MicroPython directly using the information at the site: http://micropython.org/

@wilatai
Copy link
wilatai commented Feb 3, 2017

Thank you for your reply. I'll try to check it out in the near future!

Although I can see the possibilities of WPA2 enterprise support for business and education (for example the frequently mentioned and sought after Eduroam support) world wide, I can only consider a contribution on a personal basis. Academic organizations are (in my experience) unfortunately, often not that flexible when it comes to funding/sponsoring these kind of initiatives. (Everything that needs a credit card, PayPal, etc. has to be paid in advance by faculty members themselves.. and requires approval of N people. ;-o ).

Hopefully a system like the one you mentioned could help bring a number of people together to sponsor this functionality. :)

@hickford
Copy link
hickford commented Feb 28, 2017

I'm also interested in connecting to enterprise wi-fi 802.1x EAP (ssid, username, password) from micropython on esp8266

@hickford
Copy link
hickford commented Mar 9, 2017

I've been reading to try understand how WPA2 Enterprise could be implemented.

This looks to be the relevant micropython code https://github.com/micropython/micropython/blob/master/esp8266/modnetwork.c#L97

It calls functions (viz. wifi_station_set_config and wifi_station_connect) in the Espressif esp8266 SDK https://espressif.com/sites/default/files/documentation/2c-esp8266_non_os_sdk_api_reference_en.pdf

There's a pertinent section in the SDK documentation about WPA2 Enterprise

3.14. WPA2_Enterprise APIs

ESP8266 Station can connect to WPA2_Enterprise APs.
WPA2_Enterprise APIs can be found in /ESP8266_NONOS_SDK/include/
wpa2_enterprise.h

3.14.15.WPA2_Enterprise Work Flow

Here is the work flow that prepares ESP266 station to connect to WPA2_Enterprise AP.

  1. Call wifi_station_set_config to set the configuration of target AP.
  2. Call wifi_station_set_wpa2_enterprise_auth(1); to enable WPA2_Enterprise authentication.
    • For EAP-TLS authentication, call wifi_station_set_enterprise_cert_key to set certificate and private key. wifi_station_set_enterprise_username is an optional choice, it can be called to set user name.
    • For EAP-TTLS or EAP-PEAP authentication, call wifi_station_set_enterprise_username and wifi_station_set_enterprise_password to set user name and password. wifi_station_set_enterprise_ca_cert is an optional choice, it can be called to set root certificate.
  3. Call wifi_station_connect to connect to target AP.
  4. After being connected to an AP, or failing to connect to AP and on stopped retries, please call the corresponding wifi_station_clear_enterprise_XXX APIs to release the resources

@kfricke
Copy link
Contributor
kfricke commented Mar 9, 2017

The real problem is not the client side to implement this. Try to find an enterprise environment where you can implement, thoroughly test and play with this feature.
Of course one can implement such an infrastructure with Linux based components (all components are available as opensource tools), but the amount of work to create and play with such an infrastructure is bigger than embedding some methods from the SDK into MicroPython's network API.

@Jostikas
Copy link
Jostikas commented May 3, 2017

A first go at trying to "embed some methods" resulted in overflowing the irom0_0_seg, as libwpa2 and libcrypto seem to both be needed.

@hickford
Copy link
hickford commented Mar 8, 2018

I see that Pycom document "Connecting to a WPA2-Enterprise network". Is this useful to us? Can we copy code from their fork?

@joostd
Copy link
joostd commented Mar 8, 2018

Probably, but note that Pycom produces esp32 based boards, so the micropython implementation for these boards is based on espressif's esp-idf targeting the esp32, and using a closed source wifi library also specific to the esp32. Pycom seems to have ported to the ESP8266 as well, but I'm not sure if that supports wpa2-enterprise?

@dpgeorge
Copy link
Member
dpgeorge commented Mar 9, 2018

I see that Pycom document "Connecting to a WPA2-Enterprise network". Is this useful to us? Can we copy code from their fork?

No, please do not copy any code from there because their license is not compatible with the MIT license used here.

@hickford
Copy link
hickford commented Mar 9, 2018

@joostd I have an esp8266 Wemos D1 Mini and an esp32 Wemos Lolin32. It looks like Pycom's WPA2_ENT implemenation is esp32-only. I guess it needs extra memory.

@dpgeorge Thanks Damien for your reply. Shucks. I'd hoped the collaboration announced last year would make that possible.

We are pleased to confirm that after further discussions with Damien George, we have decided to work together on a single Port of MicroPython for the ESP32. This Port will be MIT licensed thus enabling Pycom and the existing MP community to build a super-rich and quality code base hosted on the official MicroPython repository.

@hickford
Copy link
hickford commented Mar 15, 2018

Some good news from Espressif? espressif/esp32-wifi-lib#2 (comment)

Parts of WPA2 and WPS source code are planned to be open sourced in [Espressif IDF] 3.1.

@dpgeorge dpgeorge changed the title WPA2 Enterprise support? esp8266: WPA2 Enterprise support? Dec 4, 2018
@dpgeorge dpgeorge added enhancement Feature requests, new feature implementations port-esp8266 labels Dec 4, 2018
@Abd0s
Copy link
Abd0s commented Aug 29, 2019

Is this now implemented in the lib? I remember reading it in a changelog, but can't find anything about it in docs etc,

@dpgeorge
Copy link
Member

Is this now implemented in the lib?

No.

@phatcatmatt
Copy link

I'm also interested in connecting to enterprise wi-fi 802.1x EAP (ssid, username, password) from micropython on esp8266

Plus one from me.

@abogdanovich
Copy link

+1

1 similar comment
@tongclement
Copy link

+1

@tongclement
Copy link
tongclement commented Jan 28, 2021

+1 - my school uses WPA2 Enterprise. How can I help contribute to this? I have no experience with contributing to Micropython but I have some basic understanding of Arduino and C code. Any mentoring and advice will be appreciated. Thanks

@qermit
Copy link
qermit commented Jul 11, 2021

Hi. I started modifying the esp8266 port to enable WPA Enterprise but I have some problems in linking phase

Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
LINK build-GENERIC/firmware.elf
build-GENERIC/modnetwork.o:(.text.esp_connect+0x14): undefined reference to `wifi_station_set_wpa2_enterprise_auth'
build-GENERIC/modnetwork.o:(.text.esp_connect+0x18): undefined reference to `wifi_station_set_enterprise_identity'
build-GENERIC/modnetwork.o:(.text.esp_connect+0x1c): undefined reference to `wifi_station_set_enterprise_username'
build-GENERIC/modnetwork.o:(.text.esp_connect+0x20): undefined reference to `wifi_station_set_enterprise_password'
build-GENERIC/modnetwork.o: In function `esp_connect':
modnetwork.c:(.text.esp_connect+0x185): undefined reference to `wifi_station_set_wpa2_enterprise_auth'
modnetwork.c:(.text.esp_connect+0x19a): undefined reference to `wifi_station_set_enterprise_identity'
modnetwork.c:(.text.esp_connect+0x1b4): undefined reference to `wifi_station_set_enterprise_username'
modnetwork.c:(.text.esp_connect+0x1c6): undefined reference to `wifi_station_set_enterprise_password'
make: *** [Makefile:217: build-GENERIC/firmware.elf] Error 1

When I add additional libraries i get following error:

Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
LINK build-GENERIC/firmware.elf
/home/qermit/esp-open-sdk/xtensa-lx106-elf/xtensa-lx106-elf/sysroot/usr/lib/libwpa.a(sha256-internal.o): In function `sha256_init':
(.text.sha256_init+0x20): multiple definition of `sha256_init'
build-GENERIC/extmod/moduhashlib.o:moduhashlib.c:(.text.sha256_init+0x28): first defined here
make: *** [Makefile:217: build-GENERIC/firmware.elf] Error 1

@qermit
Copy link
qermit commented Jul 13, 2021

I have found sha256_init definition in extmod/crypto-algorithms/sha256.c

@MATTYGILO
Copy link

Has anyone achieved this yet?

@tonyallan
Copy link

Has anyone achieved this yet?

No I haven't but at the time this was an issue I arranged for the organisation to create a restricted 2.5GHz WPA2 Wi-FI network for IoT.

@MaxMyzer
Copy link

I came across this while looking for a way to get an RP2 to connect, I suppose its gonna be a while

@tigercoding56
Copy link
tigercoding56 commented Jan 26, 2023

is there a way to connect to wpa enterprise in normal python ? , if so maybe someone could port relevant code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature requests, new feature implementations port-esp8266
Projects
None yet
Development

No branches or pull requests

0