arandomperson
Posts: 12
Joined: Thu Apr 12, 2018 4:17 pm

Problems with TP-Link WiFi Adapter

Thu Apr 12, 2018 9:02 pm

Hello!

I'm having problems with a TP-Link TL-WN823N WiFi adapter.

Plugging it in, nothing happens.

I've read other posts here and followed their advice, but it does not work.

dmesg | grep usb shows it as a 802.11n NIC from Reaktek, but clicking on the "Wired & Wireless Network Settings' icon shows "No wireless interfaces found".

I've used Ethernet to run sudo apt-get update then sudo apt-get dist-upgrade and rebooted, but nothing.

Using MrEngman's install-wifi does not work, giving errors.
The last few lines of output are:

Installing driver module 8192eu.ko.
/usr/bin/install: line 1: --2016-02-07: command not found
/usr/bin/install: line 2: syntax error near unexpected token `('
/usr/bin/install: line 2: `Resolving www.fars-robotics.net (www.fars-robotics.net)... failed: Name or service not known.'
Loading and running the 8192eu driver, 8192eu.ko.
modprobe: FATAL: Module 8192eu not found.

Ethernet is impractical is only for a temporary solution

Any ideas?.

MrEngman
Posts: 3844
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Problems with TP-Link WiFi Adapter

Fri Apr 13, 2018 10:15 am

arandomperson wrote:
Thu Apr 12, 2018 9:02 pm
Hello!

I'm having problems with a TP-Link TL-WN823N WiFi adapter.

Plugging it in, nothing happens.

I've read other posts here and followed their advice, but it does not work.

dmesg | grep usb shows it as a 802.11n NIC from Reaktek, but clicking on the "Wired & Wireless Network Settings' icon shows "No wireless interfaces found".

I've used Ethernet to run sudo apt-get update then sudo apt-get dist-upgrade and rebooted, but nothing.

Using MrEngman's install-wifi does not work, giving errors.
The last few lines of output are:

Installing driver module 8192eu.ko.
/usr/bin/install: line 1: --2016-02-07: command not found
/usr/bin/install: line 2: syntax error near unexpected token `('
/usr/bin/install: line 2: `Resolving www.fars-robotics.net (www.fars-robotics.net)... failed: Name or service not known.'
Loading and running the 8192eu driver, 8192eu.ko.
modprobe: FATAL: Module 8192eu not found.

Ethernet is impractical is only for a temporary solution

Any ideas?.
Hi, when enquiring about problems like this it is always useful to provide more precise details.

What OS are you using? What kernel version is it using? What is the USB ID of your wifi module as there are generally several different versions of most adapters and they use different drivers.

Not sure why you are getting the error you are seeing using my script. I've never seen that before and I don't remember anyone else reporting that type of error. Could be the script was corrupted during downloading but I can't confirm that.

I am assuming you are using a GUI so to run the script you will need to open a terminal window and run command sudo install-wifi. I don't normally run a GUI but I tried after seeing your problem and it works OK for me.

You could try reinstalling the script and trying again. In a terminal window run commands

Code: Select all

sudo wget http://downloads.fars-robotics.net/install-wifi -O /usr/bin/install-wifi
sudo chmod +x /usr/bin/install-wifi
Note the change in web site name, although the previous web site, http://www.fars-robotics.net, should also be OK to get the script up and running.

As an alternative you can install the driver manually. Access the web site http://downloads.fars-robotics.net with a browser and then download the driver for the kernel version and wifi you are using then open a terminal window and access the directory where the driver is downloaded to and run commands

Code: Select all

tar xzf driver-file.tar.gz
./install.sh
replacing the filename driver-file.tar.gz with the name of the file you downloaded.

And note that whenever you update the kernel you will need to reinstall the driver as it is not included in the kernel image.
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

Please post ALL technical questions on the forum. Please Do Not send private messages.

arandomperson
Posts: 12
Joined: Thu Apr 12, 2018 4:17 pm

Re: Problems with TP-Link WiFi Adapter

Fri Apr 13, 2018 10:59 am

This is a Raspberry Pi 2, on the default Raspbian OS.

uname -a returns this:

Linux raspberrypi 4.9.35 v7+ #1014 SMP Fri Jun 30 14:47:43 BST 2017 armv71 GNU/Linux

The USB ID of my WiFi adapter is: 2357:0109

sudo wget http://downloads.fars-robotics.net/install-wifi -O /usr/bin/install-wifi throws an error HTTP 404 Not Found.

Manually downloading 8192eu-4.9.35-v7-1014.tar.gz and running the commands gives no error, saying "reboot to run the driver".
It mentions "configuring your wifi", which I have done in /etc/wpa_supplicant/wpa_supplicant.conf

However, when rebooting with "sudo reboot", after the Pi starts back up, it can't see any wireless interfaces and nothing changes.
Final notes: my WiFi adapter is plugged in all through these steps and my power supply is the official Pi supply.

MrEngman
Posts: 3844
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Problems with TP-Link WiFi Adapter

Fri Apr 13, 2018 11:51 am

arandomperson wrote:
Fri Apr 13, 2018 10:59 am
This is a Raspberry Pi 2, on the default Raspbian OS.

uname -a returns this:

Linux raspberrypi 4.9.35 v7+ #1014 SMP Fri Jun 30 14:47:43 BST 2017 armv71 GNU/Linux

The USB ID of my WiFi adapter is: 2357:0109

sudo wget http://downloads.fars-robotics.net/install-wifi -O /usr/bin/install-wifi throws an error HTTP 404 Not Found.

Manually downloading 8192eu-4.9.35-v7-1014.tar.gz and running the commands gives no error, saying "reboot to run the driver".
It mentions "configuring your wifi", which I have done in /etc/wpa_supplicant/wpa_supplicant.conf

However, when rebooting with "sudo reboot", after the Pi starts back up, it can't see any wireless interfaces and nothing changes.
Final notes: my WiFi adapter is plugged in all through these steps and my power supply is the official Pi supply.
Sorry link was wrong. Should be

Code: Select all

sudo wget http://downloads.fars-robotics.net/wifi-drivers/install-wifi -O /usr/bin/install-wifi
sudo chmod +x /usr/bin/install-wifi
After rebooting what does command lsmod show? If the driver is recognised it should show 8192eu in the list of loaded modules.

If the driver module is loaded then the problem is likely to be your wifi configuration.
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

Please post ALL technical questions on the forum. Please Do Not send private messages.

arandomperson
Posts: 12
Joined: Thu Apr 12, 2018 4:17 pm

Re: Problems with TP-Link WiFi Adapter

Fri Apr 13, 2018 12:19 pm

I've redownloaded and rerun install-wifi, but it still fails with output:

Your current kernel revision = 4.9.35-v7+
Your current kernel build = #1014

Checking for a wifi module to determine the driver to install.

Your wifi module is Bus 001 Device 007: ID 2357:0109

And it uses the 8192eu driver.

Checking for a 8192eu wifi driver module for your current kernel.
There is a driver module available for this kernel revision.
Downloading the 8192eu driver.
Installing the 8192eu driver.

Installing driver module 8192eu.ko.
/usr/bin/install: line 1: --2016-02-07: command not found
/usr/bin/install: line 2: syntax error near unexpected token `('
/usr/bin/install: line 2: `Resolving www.fars-robotics.net (www.fars-robotics.net)... failed: Name or service not known.'
Loading and running the 8192eu driver, 8192eu.ko.
modprobe: FATAL: Module 8192eu not found.

Rebooting afterwards and running lsmod still does not show 8192eu in the list.

I think the driver isn't being installed or started for some reason.

MrEngman
Posts: 3844
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Problems with TP-Link WiFi Adapter

Fri Apr 13, 2018 1:40 pm

arandomperson wrote:
Fri Apr 13, 2018 12:19 pm
Downloading the 8192eu driver.
Installing the 8192eu driver.

Installing driver module 8192eu.ko.
/usr/bin/install: line 1: --2016-02-07: command not found
/usr/bin/install: line 2: syntax error near unexpected token `('
/usr/bin/install: line 2: `Resolving www.fars-robotics.net (www.fars-robotics.net)... failed: Name or service not known.'
Loading and running the 8192eu driver, 8192eu.ko.
modprobe: FATAL: Module 8192eu not found.

Rebooting afterwards and running lsmod still does not show 8192eu in the list.

I think the driver isn't being installed or started for some reason.
I think I've figured out where the error is occurring. it would appear there is some issue with the command /usr/bin/install file but I don't understand why.

The line that installs the driver, line 346, is

Code: Select all

install -p -m 644 $driver1.ko $module_dir
and when the script is run this should translate to

Code: Select all

install -p -m 644 8192eu.ko /lib/modules/4.9.35-v7+/kernel/drivers/net/wireless
to install the driver.

The error states it cannot find the file so is it the file /usr/bin/install or the file the command /usr/bin/install it is trying to install. As you were able to install the command by manually downloading then I don't think it is /usr/bin/install.

Can you try running the script again. I have updated it to show the output of the install command so it should, hopefully, give a clue as to why the error is occurring.
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

Please post ALL technical questions on the forum. Please Do Not send private messages.

arandomperson
Posts: 12
Joined: Thu Apr 12, 2018 4:17 pm

Re: Problems with TP-Link WiFi Adapter

Fri Apr 13, 2018 1:55 pm

Okay, I ran the script again. Here are the results:

Installing driver module 8192eu.ko.
install -p -m 644 8192eu.ko /lib/modules/4.9.35-v7+/kernel/drivers/net/wireless
/usr/bin/install: line 1: --2016-02-07: command not found
/usr/bin/install: line 2: syntax error near unexpected token `('
/usr/bin/install: line 2: `Resolving www.fars-robotics.net (www.fars-robotics.net)... failed: Name or service not known.'
Loading and running the 8192eu driver, 8192eu.ko.
modprobe: FATAL: Module 8192eu not found.

MrEngman
Posts: 3844
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Problems with TP-Link WiFi Adapter

Fri Apr 13, 2018 2:56 pm

arandomperson wrote:
Fri Apr 13, 2018 1:55 pm
Okay, I ran the script again. Here are the results:

Installing driver module 8192eu.ko.
install -p -m 644 8192eu.ko /lib/modules/4.9.35-v7+/kernel/drivers/net/wireless
/usr/bin/install: line 1: --2016-02-07: command not found
/usr/bin/install: line 2: syntax error near unexpected token `('
/usr/bin/install: line 2: `Resolving www.fars-robotics.net (www.fars-robotics.net)... failed: Name or service not known.'
Loading and running the 8192eu driver, 8192eu.ko.
modprobe: FATAL: Module 8192eu not found.
Thanks.

This is really weird. The command to install the driver is correct

Code: Select all

install -p -m 644 8192eu.ko /lib/modules/4.9.35-v7+/kernel/drivers/net/wireless
This command should install the driver 8192eu.ko in directory /lib/modules/4.9.35-v7+/kernel/drivers/net/wireless and then register the wifi driver but when the command is run it generates those errors which are really strange.

One thing that I find really odd is why is it referencing www.fars-robotics.net. There is nothing in my script that does that.

In fact the errors appear as though the command /usr/bin/install is some sort of script when it should actually be a binary file.

How are you running the script? You should open a Command Line terminal window and run command sudo install-wifi.

I usually only run my Pis with Raspbian Lite OS and access then using putty and SSH from my laptop so no GUI but I have one Pi running full Raspbian with a GUI but I access it over the network using VNC viewer on my Windows laptop. In X windows I open a Command Line terminal window and run the script using sudo install-wifi and everything works OK so the error you are getting is really confusing and I have no idea why it is occurring.

You did say you installed the driver by downloading from the web page and were then able to install it without errors. I would suggest for now to try that again and then after rebooting check if the 8192eu driver is in the output from the lsmod command. If it is and your wifi does not work then there may be an issue with your configuration. If it does not show in the lsmod output check directory /lib/modules/4.9.35-v7+/kernel/drivers/net/wireless to see if it actually installed
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

Please post ALL technical questions on the forum. Please Do Not send private messages.

User avatar
DougieLawson
Posts: 35817
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Problems with TP-Link WiFi Adapter

Fri Apr 13, 2018 3:06 pm

arandomperson wrote:
Fri Apr 13, 2018 1:55 pm

/usr/bin/install: line 2: `Resolving www.fars-robotics.net (www.fars-robotics.net)... failed: Name or service not known.'
Your network isn't configured correctly.

Can you get the output from the following commands

ip route
ping -c3 $(ip route | awk '/default/ {print $3};')
ping -c3 8.8.8.8
ping -c3 google.com
cat /etc/resolv.conf
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

arandomperson
Posts: 12
Joined: Thu Apr 12, 2018 4:17 pm

Re: Problems with TP-Link WiFi Adapter

Fri Apr 13, 2018 3:16 pm

I have run these commands, here are the results:

[email protected] ~ $ ip route
default via 192.168.1.254 dev eth0 metric 202
192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.82 metric 202
[email protected] ~ $ ping -c3 $(ip route | awk '/default/ {print $3};')
PING 192.168.1.254 (192.168.1.254) 56(84) bytes of data.
64 bytes from 192.168.1.254: icmp_seq=1 ttl=64 time=1.15 ms
64 bytes from 192.168.1.254: icmp_seq=2 ttl=64 time=1.13 ms
64 bytes from 192.168.1.254: icmp_seq=3 ttl=64 time=1.06 ms

--- 192.168.1.254 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 1.062/1.115/1.154/0.054 ms
[email protected] ~ $ ping -c3 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=58 time=15.9 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=58 time=15.9 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=58 time=15.9 ms

--- 8.8.8.8 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 15.920/15.958/15.985/0.106 ms
[email protected] ~ $ ping -c3 google.com
PING google.com (216.58.204.78) 56(84) bytes of data.
64 bytes from lhr25s13-in-f14.1e100.net (216.58.204.78): icmp_seq=1 ttl=54 time=15.7 ms
64 bytes from lhr25s13-in-f14.1e100.net (216.58.204.78): icmp_seq=2 ttl=54 time=15.8 ms
64 bytes from lhr25s13-in-f14.1e100.net (216.58.204.78): icmp_seq=3 ttl=54 time=15.8 ms

--- google.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 15.744/15.825/15.884/0.156 ms
[email protected] ~ $ cat /etc/resolv.conf
# Generated by resolvconf
domain home
nameserver 192.168.1.254
[email protected] ~ $

If it helps, I'm in the UK, using an ISP provided BT Smart Hub.
All other devices seem to connect fine, including a Windows 10 machine using the exact same adapter.

User avatar
DougieLawson
Posts: 35817
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Problems with TP-Link WiFi Adapter

Fri Apr 13, 2018 3:22 pm

OK. I've found your error. You're trying to download something from an out-of-date post.

Mr Engmans' script is available at: http://downloads.fars-robotics.net/wifi ... stall-wifi
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

arandomperson
Posts: 12
Joined: Thu Apr 12, 2018 4:17 pm

Re: Problems with TP-Link WiFi Adapter

Fri Apr 13, 2018 3:29 pm

I've downloaded from that link, but get this error:

sudo sh ./install-wifi
./install-wifi: 15: ./install-wifi: Syntax error "(" unexpected

The command used to download was: sudo wget http://downloads.fars-robotics.net/wifi ... stall-wifi

Perhaps a typo in the code?

User avatar
B.Goode
Posts: 8271
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Problems with TP-Link WiFi Adapter

Fri Apr 13, 2018 3:41 pm

arandomperson wrote:
Fri Apr 13, 2018 3:29 pm
I've downloaded from that link, but get this error:

sudo sh ./install-wifi
./install-wifi: 15: ./install-wifi: Syntax error "(" unexpected

The command used to download was: sudo wget http://downloads.fars-robotics.net/wifi ... stall-wifi

Perhaps a typo in the code?
The 'shebang' at the head of the downloaded install script is:

Code: Select all

#!/bin/bash
Maybe there is a critical difference in semantics between sh and bash?

What happens if you download it to /usr/bin, make it executable, then invoke it with

Code: Select all

sudo install-wifi
?

Or maybe just

Code: Select all

sudo ./install-wifi
from your existing download?

MrEngman
Posts: 3844
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Problems with TP-Link WiFi Adapter

Fri Apr 13, 2018 3:43 pm

arandomperson wrote:
Fri Apr 13, 2018 3:29 pm
I've downloaded from that link, but get this error:

sudo sh ./install-wifi
./install-wifi: 15: ./install-wifi: Syntax error "(" unexpected

The command used to download was: sudo wget http://downloads.fars-robotics.net/wifi ... stall-wifi

Perhaps a typo in the code?
Why are you using command

Code: Select all

sudo sh ./install-wifi
You should install the script using commands

Code: Select all

sudo wget http://downloads.fars-robotics.net/wifi-drivers/install-wifi -O /usr/bin/install-wifi
sudo chmod +x /usr/bin/install-wifi
and run it using command

Code: Select all

sudo install-wifi
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

Please post ALL technical questions on the forum. Please Do Not send private messages.

MrEngman
Posts: 3844
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Problems with TP-Link WiFi Adapter

Fri Apr 13, 2018 3:51 pm

NOTE: The script automatically updates itself if necessary so if it is not installed as it should be it will not work.
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

Please post ALL technical questions on the forum. Please Do Not send private messages.

arandomperson
Posts: 12
Joined: Thu Apr 12, 2018 4:17 pm

Re: Problems with TP-Link WiFi Adapter

Fri Apr 13, 2018 4:07 pm

Unfortunately, after both re-installing the script and running sudo install-wifi and trying direct download of the .tar.gz from downloads.fars-robotics.net, wireless still fails to work.

The install script from the directly-downloaded tar.gz file still says to reboot, but my WiFi module is still not detected.

The install-wifi program still fails with the identical errors.

After attempting to run both and then rebooting, I looked in /lib/modules/4.9.35-v7+/kernel/drivers/net/wireless/realtek to see the drivers.
There are four there: rtl8xxu, rtl818x, rtl8192cu, and rtlwifi.

I fear that the only solution may be to reformat the card and start afresh, since this is indeed very unusual behaviour.

arandomperson
Posts: 12
Joined: Thu Apr 12, 2018 4:17 pm

Re: Problems with TP-Link WiFi Adapter

Fri Apr 13, 2018 4:46 pm

Is there anything else that might possibly be done? I've seen this exact model of adapter to work elsewhere on the forums, what could possibly be the issue here?

MrEngman
Posts: 3844
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Problems with TP-Link WiFi Adapter

Fri Apr 13, 2018 7:30 pm

arandomperson wrote:
Fri Apr 13, 2018 4:07 pm
Unfortunately, after both re-installing the script and running sudo install-wifi and trying direct download of the .tar.gz from downloads.fars-robotics.net, wireless still fails to work.

The install script from the directly-downloaded tar.gz file still says to reboot, but my WiFi module is still not detected.
That script will always say reboot as it only installs the driver and does not load and start it running.
The install-wifi program still fails with the identical errors.

After attempting to run both and then rebooting, I looked in /lib/modules/4.9.35-v7+/kernel/drivers/net/wireless/realtek to see the drivers.
There are four there: rtl8xxu, rtl818x, rtl8192cu, and rtlwifi.

I fear that the only solution may be to reformat the card and start afresh, since this is indeed very unusual behaviour.
You're looking in the wrong directory. The driver should be installed in directory /lib/modules/4.9.35-v7+/kernel/drivers/net/wireless, NOT /lib/modules/4.9.35-v7+/kernel/drivers/net/wireless/realtek so check directory /lib/modules/4.9.35-v7+/kernel/drivers/net/wireless to see if the driver is installed there.

And if it is installed then when rebooting I would expect it to be seen in the list of running modules shown by command lsmod regardless of whether the wifi is configure correctly, incorrectly or not configured at all.
arandomperson wrote:
Fri Apr 13, 2018 4:46 pm
Is there anything else that might possibly be done? I've seen this exact model of adapter to work elsewhere on the forums, what could possibly be the issue here?
There are plenty of people using this wifi adapter and using the script without problems. Out of curiosity I checked my web site log file and the script has been used about 3000 times for a variety of different drivers in the last 2 weeks and you are the only person reporting an error.

There is something very odd happening and I have no idea why. Might be best to re-install the OS on the SD card.
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

Please post ALL technical questions on the forum. Please Do Not send private messages.

arandomperson
Posts: 12
Joined: Thu Apr 12, 2018 4:17 pm

Re: Problems with TP-Link WiFi Adapter

Sat Apr 14, 2018 5:39 pm

Finally, I decided to format the SD card, download and then install the newest version of Raspbian.

Afterwards, I ran the usual sudo apt-get update and sudo apt-get diss-install just to make sure I was on the newest software.

After reinstalling install-wifi and running it, I'm pleased to say I have fully functional Wi-Fi on my Pi!

Anyway, thanks for all your help and suggestions to get WiFi working on my Pi!

Return to “Beginners”