From charlesreid1

No edit summary
Line 1: Line 1:
=Wifi Config for UGR Wifi Project=
See the following repo, which has details of how to configure <code>/etc/network/interfaces</code>:
See the following repo, which has details of how to configure <code>/etc/network/interfaces</code>:


Line 30: Line 32:
Once you get these two network configuration files squared away, the Raspberry Pi should join that wifi network on boot.
Once you get these two network configuration files squared away, the Raspberry Pi should join that wifi network on boot.


==Joining Encrypted Wifi==
To join an encrypted wifi, use a slightly different syntax for the config file. Call this <code>securenet.cfg</code> and put it in <code>/etc/network/interfaces.d/securenet.cfg</code>:
<pre>
auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhp
wpa-ssid SecureNetwork
wpa-psk abcdefg123
</pre>
Next, reference this file in the <code>/etc/network/interfaces</code> file the same way as for unsecured networks:
<pre>
...
source /etc/network/interfaces.d/securenet.cfg
</pre>


This should connect to the wifi network SecureNetwork automatically on boot.


=Debugging=


If the wifi network is not connecting, or is not connecting on boot, check <code>/var/log/syslog</code>, which will contain a detailed error log from the network.


=Flags=
=Flags=


{{PiFlag}}
{{PiFlag}}

Revision as of 04:28, 4 April 2017

Wifi Config for UGR Wifi Project

See the following repo, which has details of how to configure /etc/network/interfaces:

https://git.charlesreid1.com/rpi/pi-join-wifi

The basics:

Joining Unencrypted Wifi

This supposes you want to join a wifi network called MyWifiNetwork that is unencrypted. Add the following wireless network information to /etc/network/interfaces.d/widy.cfg, which is a config file specific to this wifi router that you can use to swap wifi network configurations in and out:

auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
wireless-essid OpenWrt

Next, include this config file in your /etc/network/interfaces file by adding the last line shown to it:

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

source /etc/network/interfaces.d/mywifi.cfg

Once you get these two network configuration files squared away, the Raspberry Pi should join that wifi network on boot.

Joining Encrypted Wifi

To join an encrypted wifi, use a slightly different syntax for the config file. Call this securenet.cfg and put it in /etc/network/interfaces.d/securenet.cfg:

auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhp
wpa-ssid SecureNetwork
wpa-psk abcdefg123

Next, reference this file in the /etc/network/interfaces file the same way as for unsecured networks:

...

source /etc/network/interfaces.d/securenet.cfg

This should connect to the wifi network SecureNetwork automatically on boot.

Debugging

If the wifi network is not connecting, or is not connecting on boot, check /var/log/syslog, which will contain a detailed error log from the network.

Flags