Community
OpenEnergyMonitor

OpenEnergyMonitor Community

University WIFI that requires web Username/Password authentication login?

Hi!
I am looking at setting up emonPis in WIFI networks that require username and passwords to log in (e.g. campus network). Is there a possibility to do something like that, maybe by hardcoding the setup in wpa_supplicant.conf, or do I need to create my own (mobile) WIFI network?
Thanks!
Marcel

Hi Marcel,

Do you mean that your wifi networks require some sort of captive portal login authentication via a web page after connection to the network? If so, this is tricky. I’m not sure it’s possible. Your best bet would be to take a look on the RasPi forums for a solution or connect via Ethernet.

Sure, it’s possible to connect via SSH and modify wpa_supplicant.conf on the emonPi but I think this may not be enough to obtain connection to your network.

Hi Glyn,

Not quite, it’s not with a captive portal login authentication but rather username/password combination on a university network. Thanks for your suggestion - the keywords helped me find more information.

This answer looks most plausible but haven’t been able to test myself yet. I will comment again once I have tried it: http://raspberrypi.stackexchange.com/questions/43359/connecting-to-universities-wpa2-enterprise-wifi-network/43400#43400

Thanks

1 Like

Hi Glyn

It’s a bit late but I finally tested the suggested solution in the link I found. It was a little different, especially because I did not need a certificate. Found the solution through various places in the end. The following solution has by now worked in multiple locations:

Change interfaces file:
sudo nano /etc/network/interfaces

# interfaces(5) file used by ifup(8) and ifdown(8)
# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'
# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d
auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
iface wlan0 inet dhcp
  pre-up wpa_supplicant -B -Dwext -i wlan0 -c/etc/wpa_supplicant/wpa_supplicant.conf
  post-down killall -q wpa_supplicant

Then change the config file to have network name and login details hardcoded:
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
  ssid="MyUniversityNetwork (e.g. eduroam)"
  scan_ssid=1
  key_mgmt=WPA-EAP
  pairwise=CCMP TKIP
  group=CCMP TKIP
  eap=PEAP
  identity="MyLoginName"
  password="MyPassword"
  phase1="peapver=0"
  phase2="MSCHAPV2"
}

I hope this will help somebody else.
Cheers Marcel

2 Likes

Nice! Thanks for sharing