jweob
Posts: 31
Joined: Sun Jul 15, 2012 1:56 pm

Help installing a wireless USB adaptor (TL-WN727N)

Sun Jul 15, 2012 2:50 pm

Hello

Got by Pi yesterday. I'm a linux beginner so was very pleased when I managed to get SSH and VNC working, and very very excited when I managed to connect lego mindstorms to the Pi and control the motors using NXT-Python. I am running the Pi off a 5000 mAh battery so the only cable that is preventing me from mounting the pi on a lego rover chassis and driving it around my flat using SSH is the ethernet cable.

So I bought a TL-WN727N wireless USB adaptor from TP-LINK thinking I could install that and go fully wireless. I called tech support first and they assured me that there was an (unsupported) driver for the adaptor which they emailed to me - http://www.ralinktech.com/en/04_support ... hp?sn=5016.

I didn't try that first since I wanted to see if I could use aptitude to get the driver. Installed firmware-ralink and then plugged in the wireless USB. I used iwconfig and could see the wireless USB.

Code: Select all

wlan0     IEEE 802.11bgn  ESSID:off/any
          Mode:Managed  Access Point: Not-Associated  `Tx-Power=0 dBm
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Power Management:on
I installed network manager and tried to connect to my wireless through the GUI but it didn't work (just said that it was disconnected in top right corner)

Looked at some posts which suggested putting in dmesg. Output from that showed the following after connecting the wireless USB:

Code: Select all

sshd (797): /proc/797/oom_adj is deprecated, please use /proc/797/oom_score_adj instead.
usb 1-1.3: new high speed USB device number 4 using dwc_otg
usb 1-1.3: New USB device found, idVendor=148f, idProduct=5370
usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-1.3: Product: 802.11 n WLAN
usb 1-1.3: Manufacturer: TPlink
usb 1-1.3: SerialNumber: 1.0
cfg80211: Calling CRDA to update world regulatory domain
usb 1-1.3: reset high speed USB device number 4 using dwc_otg
ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
Registered led device: rt2800usb-phy0::radio
Registered led device: rt2800usb-phy0::assoc
Registered led device: rt2800usb-phy0::quality
usbcore: registered new interface driver rt2800usb
phy0 -> rt2x00lib_request_firmware: Error - Current firmware does not support detected chipset.
phy0 -> rt2x00lib_request_firmware: Error - Current firmware does not support detected chipset.
I'm guessing that the rt2x00_request_firmware error is why it is not working. I read on a post that it could be caused by linux using a conflicting driver and added some blacklists in the blacklist.conf file

Code: Select all

#JOB trying to get wireless card to work
blacklist rt2x00usb
blacklist rt2x00lib
Still didn't work. So now I am trying to install the driver that tech support sent to me. The instructions are:

Code: Select all

=======================================================================
Build Instructions:
====================

1> $tar -xvzf DPB_RT2870_Linux_STA_x.x.x.x.tgz
    go to "./DPB_RT2870_Linux_STA_x.x.x.x" directory.

2> In Makefile
         set the "MODE = STA" in Makefile and chose the TARGET to Linux by
set "TARGET = LINUX"
         define the linux kernel source include file path LINUX_SRC
         modify to meet your need.

3> In os/linux/config.mk
        define the GCC and LD of the target machine
        define the compiler flags CFLAGS
        modify to meet your need.
        ** Build for being controlled by NetworkManager or wpa_supplicant
wext functions
           Please set 'HAS_WPA_SUPPLICANT=y' and 'HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=y'.
           => #>cd wpa_supplicant-x.x
           => #>./wpa_supplicant -Dwext -ira0 -c wpa_supplicant.conf -d
        ** Build for being controlled by WpaSupplicant with Ralink Driver
           Please set 'HAS_WPA_SUPPLICANT=y' and 'HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=n'.
           => #>cd wpa_supplicant-0.5.7
           => #>./wpa_supplicant -Dralink -ira0 -c wpa_supplicant.conf -d

4> $make
        # compile driver source code
        # To fix "error: too few arguments to function ¡¥iwe_stream_add_event"
          => $patch -i os/linux/sta_ioctl.c.patch os/linux/sta_ioctl.c

5> $cp RT2870STA.dat  /etc/Wireless/RT2870STA/RT2870STA.dat

6> load driver, go to "os/linux/" directory.
    #[kernel 2.4]
    #    $/sbin/insmod rt2870sta.o
    #    $/sbin/ifconfig ra0 inet YOUR_IP up

    #[kernel 2.6]
    #    $/sbin/insmod rt2870sta.ko
    #    $/sbin/ifconfig ra0 inet YOUR_IP up

7> unload driver
    $/sbin/ifconfig ra0 down
        $/sbin/rmmod rt2870sta
I don't really understand the details in point 2 & 3 but when I type "make" i get the following error message:

Code: Select all

pi@raspberrypi:~/2011_0719_RT3070_RT3370_RT5370_RT5372_Linux_STA_V2.5.0.3_DPO$ make
make -C tools
make[1]: Entering directory `/home/pi/2011_0719_RT3070_RT3370_RT5370_RT5372_Linux_STA_V2.5.0.3_DPO/tools'
gcc -g bin2h.c -o bin2h
make[1]: Leaving directory `/home/pi/2011_0719_RT3070_RT3370_RT5370_RT5372_Linux_STA_V2.5.0.3_DPO/tools'
/home/pi/2011_0719_RT3070_RT3370_RT5370_RT5372_Linux_STA_V2.5.0.3_DPO/tools/bin2h
cp -f os/linux/Makefile.6 /home/pi/2011_0719_RT3070_RT3370_RT5370_RT5372_Linux_STA_V2.5.0.3_DPO/os/linux/Makefile
make -C /lib/modules/3.1.9+/build SUBDIRS=/home/pi/2011_0719_RT3070_RT3370_RT5370_RT5372_Linux_STA_V2.5.0.3_DPO/os/linux modules
make: *** /lib/modules/3.1.9+/build: No such file or directory.  Stop.
make: *** [LINUX] Error 2
I found a post on this forum with a similar issue (http://www.raspberrypi.org/phpBB3/viewt ... f=6&t=5671) and one of the suggestions was to use the following code:

Code: Select all

sudo apt-get install git
git clone --depth 1 https://github.com/raspberrypi/linux.git
sudo mv linux /lib/modules/3.1.9+/build
cd /lib/modules/3.1.9+/build
make mrproper
gzip -dc /proc/config.gz > .config
make modules_prepare
I got as far as the second line, but my pi crashed while it was still executing the instruction. Now when I try the second line again I get the error message

Code: Select all

pi@raspberrypi:~$ git clone --depth 1 https://github.com/raspberrypi/linux.git
fatal: destination path 'linux' already exists and is not an empty directory.
Sorry for the long post, I get the feeling I am overcomplicating this! Would really appreciate any help you can provide!

Thanks

John

jweob
Posts: 31
Joined: Sun Jul 15, 2012 1:56 pm

Re: Help installing a wireless USB adaptor (TL-WN727N)

Mon Jul 23, 2012 12:42 pm

My solution to this problem was to buy the TL-WN722N instead and use the excellent guide at http://elinux.org/RPi_Peripherals#Wirel ... ebian_6.29

The only problem I had was with power management. The wifi dongle only works when it is plugged into a powered USB hub. The wireless hub also confused me - when it is powered and plugged into the Pi's USB socket the Pi's red light comes on even though the Pi was not switched on. The Pi wouldn't switch on properly in this state. Now I have both the Pi and the hub running off a battery pack which has a handy attached switch that turns them both on at the same time.

McAngus
Posts: 1
Joined: Mon Dec 17, 2012 7:12 pm

Re: Help installing a wireless USB adaptor (TL-WN727N)

Mon Dec 17, 2012 7:16 pm

Hi, did you ever found a solution to this problem. I am myself in the very same situation...Thx

fivenp
Posts: 1
Joined: Mon Jan 28, 2013 9:36 pm

Re: Help installing a wireless USB adaptor (TL-WN727N)

Mon Jan 28, 2013 9:38 pm

for anyone having the same problem with this dongle:
http://lucsmall.com/2012/09/21/ralink-r ... pberry-pi/

victagayun
Posts: 129
Joined: Sun Apr 15, 2012 4:01 pm
Contact: Website

Re: Help installing a wireless USB adaptor (TL-WN727N)

Fri Sep 06, 2013 12:52 pm

I am interested what software and hardware you use to interface to Lego NXT?
Care to share?

Return to “Networking and servers”