Help! RPI3 with TP-Link TL-WN722N

Posted by Nerevar692 
This forum is currently read only. You can not log in or make any changes. This is a temporary situation.
Now, this forum is in read-only mode. You find details Details hereContinue on /r/PirateBox
Help! RPI3 with TP-Link TL-WN722N
August 25, 2016 11:56PM
Hello all,
(Bare with me, new here!)

I am new to this forum, and I would like some assistance if available. Long story short, I have successfully setup my raspberrypi 3 with Piratebox, and I have been unable to get my WiFi adaptor (TL-WN722N) to work over the on-board wifi on the RPI3. My main goal is to extend the WiFi range.

I have seen several other threads both on this forum and other sites about this with my model of WiFi adapter, and none of the described solutions have been successful for me. I've read that this particular model is compatible with Piratebox as a plug-and-play device, but my main question is how can I tell if it's actually working?


Contents of my hostapd.conf:

interface=wlan0
driver=nl80211
ssid=PirateBox - Share Freely
hw_mode=g
channel=1
#auth_algs=1
#ieee80211n=1


_______________________________

Contents of my piratebox.conf:

#########
## Config for pirate-box WWW Release
## written by Matthias Strubel (matthias.strubel@aod-rpg.de) 2011-02-22
## licenced by gpl ; feel free to improve or send me feedback
##
## 2012-04-12 Created
## 2012-06-08 Changed IP Stuff to generating dnsmasq.conf stuff
## ADDed SubConfig for IPV6 config
## Changed Order of config
## 2013-08-14 Added timesave url
##
########

#######
## Configuration help
## If you plan to use one laptop as the piratebox:
## Set DO_IFCONFIG , USE_APN, USE_DNSMASQ to yes
## If you plan to run a two component setup (one router and one providing the storage+website)
## connected with ethernet:
## Set DO_IFCONFIG , USE_APN, USE_DNSMASQ to no
## Configure your ethernet eth0 (or whatever) to a static IP
## force your router to publish the HOST Option with your static IP; in case of dnsmasq add the /etc/hosts entrys
## Have a look at [wiki.daviddarts.com] for futher instructions
##
## You may deactivated severall option as needed. It's flexible.


#----------------- Folder Configuration -------------------#

PIRATEBOX_FOLDER="/opt/piratebox"
WWW_FOLDER="/opt/piratebox/www"

#Do not change untill really needed.
PIRATEBOX_PYTHONPATH="$PIRATEBOX_FOLDER/python_lib"


#Datafolder , where is you usb-stick // drive mounted
SHARE_FOLDER="$PIRATEBOX_FOLDER/share"

#Upload Folder
# Change this if you want to user uploaded data in a subfolder
# Make sure the folder exists
# UPLOADFOLDER="$SHARE_FOLDER/Upload"
UPLOADFOLDER="$SHARE_FOLDER/Shared"

#----------------- Startup Configuration -------------------#
# Which Steps has to be done

#Do network config
DO_IFCONFIG="yes"

#Do IW config - setting up a wlan0 interface with iw
# for some wifi-cards required
DO_IW="yes"
#Iw physical interface
PHY_IF="phy0"

# Check if interface exists
# should be set to yes if you use a USB wifi card
PROBE_INTERFACE="yes"
# wait how many seconds until throw an error
PROBE_TIME=10

#Start services...
# act like a apn / <yes|no>
# please have a look @ hostapd.conf ; you may need to change some options, regarding wifi-card
USE_APN="yes"
# act like dns&dhcp (dnsmasq)
USE_DNSMASQ="yes"

#HOSTNAME ... if you really want to change it, plz change:
# bin/droopy
# conf/hosts
HOST="piratebox.lan"

#----------------- Configuration for DNSMASQ & IF-Setup -------------------#
# Name of the wlan interface
INTERFACE="wlan0"
# On which interface DNSMASQ should listen. -i is the parameter for dnsmasq
# Make it empty to disable
DNSMASQ_INTERFACE="wlan0"

#Brdige add interfacce (setr yes to enable bridging)
DO_BRIDGE="no"
BRIDGE="br-lan"

#Network
NET=192.168.77
#IP-SHORT (is stringed together)
# Which IP is your Box?? i.e. 1 => 192.168.77.1
IP_SHORT=1

#DHCP LEASE Start
START_LEASE=10
#DHCP LEASE End Range
END_LEASE=250
#Leasetime (When should the client renew it's IP)
LEASE_DURATION=12h

# Where is the leasefile stored to?
LEASE_FILE_LOCATION=$PIRATEBOX_FOLDER/tmp/lease.file


# Define the netmask
NETMASK=255.255.255.0

#SET IP for ifconfig stuff - DON'T CHANGE
IP=$NET.$IP_SHORT

#Load Config about ipv6 stuff - DON'T CHANGE
. $PIRATEBOX_FOLDER/conf/ipv6.conf


#----------------- Configuration for the pure piratebox -------------------#
## droopy, webserver, shoutbox- and forum-server

## Timesave file for non RTC devices
TIMESAVE="$PIRATEBOX_FOLDER/share/timesave_file"

#On non OpenWRT you can use the default output format
# as an input format. For OpenWrt you need to specify +%C%g%m%d%H%M
# The content is exchanged during makefile processing and image build
TIMESAVE_FORMAT="+%C%g%m%d %H%M"

#Start droopy? - Enable upload?
DROOPY_ENABLED="yes"
#Image-SRC
IMAGENAME="piratebox-logo-small.png"
IMAGE="$PIRATEBOX_FOLDER/src/$IMAGENAME"
DROOPY_TXT=""
DROOPY_PORT="8080"
# Set correct permissions for an uploaded file
DROOPY_CHMOD="755"
DROOPY_USERDIR=""
# Uncomment line below for adding directory feature
#DROOPY_USERDIR=" -u True "

#Use UserId from lighttpd for droopy (use on ext-filesystems)
DROOPY_USE_USER="yes"

#Configuration for chat (If you decide to move the chat folder, you have to change /opt/piratebox/chat/cgi-bin/py* files )
CHATFILE="$WWW_FOLDER/cgi-bin/data.pso"

#Generated File
GEN_CHATFILE="$WWW_FOLDER/chat_content.html"

#Generated File for DiskUsage
GEN_DISKFILE="$WWW_FOLDER/diskusage.html"

# Reset Shoutbox on Startup?
RESET_CHAT="yes"

#Inititiation Chat-Message
CHATMSG="<div class='message'><date>00:00:00</date> <name>PirateBox:</name> <data class='def'>Chat and share files anonymously!</data></div>"

#Activate Global chat
# Still experimentall!
GLOBAL_CHAT="no"

#On which broadcast address should it send
# Take care on the syntax!!
GLOBAL_DEST="[ #255.255.255.255# , #10.255.255.255# , #$NET.255# ]"

#------------------------ Additional configuration for lighttpd
LIGHTTPD_USER=nobody
LIGHTTPD_GROUP=nogroup


#------------------------ Hook in user-config
. $PIRATEBOX_FOLDER/conf/hook_custom.conf



Edited 2 time(s). Last edit at 08/26/2016 12:29AM by Nerevar692.
Re: Help! RPI3 with TP-Link TL-WN722N
August 27, 2016 10:04AM
You can check the interfaces you have with
ifconfig
This will show you the status of the currently active interfaces. From there you should be able to see which one is actually broadcasting the local network. Although I'm not sure if the new interface is automatically detected and used as default instead of the on-board one. If not,you may have to change
#Iw physical interface
PHY_IF="phy0"
phy0 to the name of the new interface.

Ubuntuhak, playing and tinkering with Ubuntu!
Re: Help! RPI3 with TP-Link TL-WN722N
August 27, 2016 06:03PM
Doesn't look like it detects the external adapter at all. Only shows wlan0 and "lo" which I assume is the loopback address. Know of a way to make the adapter show up?
Re: Help! RPI3 with TP-Link TL-WN722N
August 28, 2016 05:01PM
Depending on the version of the adapter (http://elinux.org/RPi_USB_Wi-Fi_Adapters) you may need a powered hub. Also, the driver may not be pre-installed.

Ubuntuhak, playing and tinkering with Ubuntu!
Re: Help! RPI3 with TP-Link TL-WN722N
August 29, 2016 01:02PM
Sigh. I feel like I'm close to the answer, but it's frustrating.

I have located the firmware via other tutorials, and have done:'

_____________________
sudo wget [linuxwireless.org]
sudo cp htc_9271.fw /lib/firmware
_____________________

But it didn't change anything. Interestingly enough, when I do iwconfig, it shows the wlan1. But even when I edit piratebox.conf and hostapd.conf to use wlan1, it shows no available access point.

iwconfig
wlan0 IEEE 802.11bgn Mode:Master Tx-Power=1496 dBm
Retry short limit:7 RTS thryawning smileyff Fragment thryawning smileyff
Power Managementyawning smileyn

lo no wireless extensions.

eth0 no wireless extensions.

wlan1 IEEE 802.11bgn ESSIDyawning smileyff/any
Mode:Managed Access Point: Not-Associated Tx-Power=0 dBm
Retry short limit:7 RTS thryawning smileyff Fragment thryawning smileyff
Power Managementyawning smileyff
_________________________________________________________


Also, when I do lsusb it SHOWS the atheros adapter there.
Bus 001 Device 005: ID 0cf3:9271 Atheros Communications, Inc. AR9271 802.11n
Bus 001 Device 004: ID 154b:005b PNY Flash Drive
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Does "driver=nl80211" need to be something related to the firmware I downloaded? I can't seem to find any info on that oddly enough... or maybe it's looking me in the face?
Re: Help! RPI3 with TP-Link TL-WN722N
September 20, 2016 04:18PM
Hi,
thanks for posting the different outputs.
Depending on the age of the WN722N you can run into hostap/driver issues. I think we have another thread about this... I still need to figure a way out of this..

The issue is, that newer WN722N needs a special Realtek hostap version, which is automatically installed on PirateBox, when the new USB stick is detected as wlan0.
But on the RPi3, wlan0 is always the internal card, so that detection does not work.

If you want to change the usage of the PirateBox to the 2nd (USB Wifi) card, you need to change:

piratebox.conf => all occurencies of wlan0 to wlan1
piratebox.conf => phy0 to phy1
hostapd.conf => wlan0 to wlan1

Then reboot the device (the most cleanest way).

If you are lucky, that will work... if not, you need to do additional steps, which I am currently not aware of.

best regards
Matthias


This is only my signature.