Setup a TP-Link TL-WN725N V2 Wireless Dongle on a Raspberry Pi2

This page outlines how to set up a TP-Link TL-WN725N V2 Wireless Dongle on a Raspberry Pi2, install and update the drivers. I've written this to remind me how I set mine up.

The bulk of this information comes from a posts on Stack Exchange by Milliways and raspberrypi.org by MrEngman.

Networking Files

If you are running a recent Raspbian /etc/network/interfaces should be as below. If you have changed it put it back.

	   # 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 manual

	     allow-hotplug wlan0
	     iface wlan0 inet manual
             wpa-conf /etc/wpa_spplicant/wpa_supplicant.conf

	     allow-hotplug wlan1
	     iface wlan1 inet manual
             wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
	

The file /etc/wpa_supplicant/wpa_supplicant.conf will be created/modified by the recommended setup methods, but can be setup by hand. It should contain something like the following:-

       ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
       update_config=1
	
       network={
       ssid="ESSID"
       psk="Your_wifi_password"
       }
	

If you need to connect to a private network (i.e. no broadcast SSID) include the line scan_ssid=1 inside network={...}.

NOTE If you want to connect to different networks (e.g. at work or home) you can include multiple network={...} entries.

There are many other options which can be used see man wpa_supplicant.conf.

Setup a Static IP Address

Milliways recommends that you don't use Static IP's. I like to use a mixture of both Static and Dynamic IP's primarily because I use a website to monitor IP cameras and it is a real pain to have to change the camera monitoring software settings everytime the network goes down. He outlines two ways to set up a static IP address in his post and I chose the dhcpcd method primarily because the first instruction said to leave /etc/network/interfaces as it was.

dhcpcd method

Leave /etc/network/interfaces at its default (as above).

Here is an example which configures a static address, routes and dns.

Edit /etc/dhcpcd.conf as follows:-

       interface eth0
       static ip_address=10.1.1.30/24
       static routers=10.1.1.1
       static domain_name_servers=10.1.1.1
	
       interface wlan0
       static ip_address=10.1.1.31/24
       static routers=10.1.1.1
       static domain_name_servers=10.1.1.1
	

ip_address is the IP address and size you want to set,
routers is the address of your router (or gateway),
domain_name_servers is the DNS address(es) from /etc/resolv.conf.

Install and update the Drivers

The simplest way to install and update the drivers for this dongle is using the script written by MrEngman which can be installed by running the following:-

	
       sudo wget https://www.fars-robotics.net/install-wifi -O /usr/bin/install-wifi
       sudo chmod +x /usr/bin/install-wifi
	

Use command sudo /usr/bin/install-wifi -h for details on how you can use it to download or update the wifi driver. This script will automatically determine the wifi you are using and search for the correct driver to download for the kernel version you are using. The script can also install wifi drivers for wifi modules using 8192eu, 8812au, mt7610 or mt7612 drivers.

The full article can be found on raspberrypi.org

Once installed updating the drivers for the installed dongle is as simple as running sudo /usr/bin/install-wifi after updating the kernel.

That pretty much covers it but you should refer to the base articles if you want more information.

The TLS/SSL certificates used on this website are issued by Let's Encrypt