How to install TP-Link AC600 Archer T2U driver on Pinebook

How to install TP-Link AC600 Archer T2U driver on Pinebook

I have a 14-inch Pinebook which once in a while I use for some tinkering. One of its issues is the WiFi card. It works fine under some networks and doesn’t under others. Sadly, the issue persists in newer kernels, even kernel 5. And sometimes it is worse. The router I have does not work well with the Pinebook and I have a very slow download speed, not exceeding more than 100Kbps. This is pretty annoying and changing settings in the router also does not help. That’s why I bought an external WiFi dongle to solve the problem. However, that came with its own challenges of getting the driver working which is the topic of this post. In this article, I explain how to install the TP-Link AC600 Archer T2U WiFi dongle driver on Pinebook legacy kernel (3.10.X).

Before explaining the steps, I’d like to point out that if you are running kernel 4.20.X and < 5, you should not need a driver for TP-Link AC600 T2U. Of course, this is conditioned to the fact that the driver module is loaded. If yes, the kernel should detect the dongle automatically.

This guide is written for Debian based distribution like Ubuntu and Armbian. For other distros the commands to install the packages are different yet the process remains the same.

Preparation

Since there is no binary package for the driver, we have to first compile it and then install it. Prior to starting the process, we need to install some dependencies which are build-essential and linux-headers.

To install Linux kernel headers, first, we need to find the exact kernel version by running,

$ uname -r

Then searching through the packages to find the exact package name. On Debian based distros, this can be done using aptitude,

$ aptitude search linux-headers

After we need to install both dependencies:

$ sudo apt-get install build-essential linux-headers-[3.10.107-pine64]

Replace the [] with the correct version.

The last step of this section is installing a kernel module called recordmcount. To do that follow the below instructions,

$ cd /usr/src/linux-[headers-3.10.107-pine64]/scripts

And then compile the module,

$ sudo make recordmcount

If you skip this step during make phase you may get recordmcount not found error error.

Compiling the TP-Link AC600 Archer T2U driver

To compile the driver, first you need to download the driver of AC600 T2U from the TP-Link site at below:

https://static.tp-link.com/2018/201801/20180118/Archer_T2U_V2_Linux.zip

Keep in mind that this driver support kernel version 2.6~3.16. If your kernel is higher than 3.16, I highly recommend downloading below unofficial driver which supports up to kernel 4.7.

https://github.com/xtknight/mt7610u-linksys-ae6000-wifi-fixes.git

After that cd to where you cloned the repository and run:

$ make && sudo make install

Once the process finished restart your device. Usually, you should see the WiFi is working. But if not, don’t panic just run dmesg and check whether you see the below error:

<-- ERROR in Alloc Bulk buffer for RxContext!

If yes, need to increase the coherent_pool size by editing <code>/boot/boot.cmd file. Before proceed with editing it, get a backup of boot.cmd and boot.scr.

Then add coherent_pool=4M at the end of setenv bootargs and finally run,

$ sudo mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scr

Important note (1): adding coherent_pool to boot.cmd may not always work. It is very distro dependent and so far I couldn’t find a way to work around it. For instance, adding it in Xenial Mate build by ayufan causes the OS to stock on bootloader.

Important note (2): I did multiple attempts to compile the driver on Kernel 5 especially on Manjaro Pinebook i3 but it fails during the make stage. So far there’s no workaround for it yet. If you found one please email me at [email protected].

If you are interested more in Pinebook articles have a look at Pinebook section of the blog.

Inline/featured images credits