WiFi AP with Edimax EW-7811Un

Posted by mrd0ll4r 
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
WiFi AP with Edimax EW-7811Un
June 14, 2014 11:50AM
Heyho!

I don't know if this is the right place for this, but:

I (accidentally) bought an Edimax EW-7811Un instead of the EW-7711UAn listed in the compatibility list. I went through a lot and nearly gave up on it, BUT: I got it to work, finally!

I mainly followed this Tutorial, but compiled the much newer version of the hostapd/driver from source. The link is included in the tutorial, somewhere in the hostapd part. You need the right chipset of course, the realtek site is rather...confusing.

You do NOT need to edit /etc/defaults/hostapd - hostapd is started with the piratebox service with the correct config file (/opt/piratebox/conf/hostapd.conf) automatically ;-)

The important part after that is to prevent the hostapd from being updated, we can do this by modifying (or creating) /etc/pacman.conf and adding
IgnorePkg=hostapd
as described here.

My /opt/piratebox/conf/hostapd.conf looks something like this (sorry for the stuff in there, some testing):
interface=wlan0
#driver=rtl8192cu
driver=rtl871xdrv
#driver=nl80211
#################
ssid=PirateBox - Share Freely
channel=1
#wmm_enabled=0
#wpa=1
#wpa_passphrase=ConroyPi
#wpa_key_mgmt=WPA-PSK
#wpa_pairwise=TKIP
#rsn_pairwise=CCMP
#auth_algs=1
macaddr_acl=0
##########
#hw_mode=g
#channel=1
#auth_algs=1
#ieee80211n=1
The important part is the driver. I don't think we need to bridge the interfaces (and it's not as simple in arch as in other distributions?), but enlighten me on this one if I'm wrong.

I still need to see if I can tweak anything, but with this setup I get a speed from RPi->Laptop of 600KB/s as reported by wget when downloading a shared file.


So, back to the beginning: I don't know if this is the right place, but I think we can add the EW-7811Un to the list of compatible WiFi dongles. It's damn small, doesn't need a powered hub in my current setup and works somewhat well.


I hope this helps anyone going through the same issues.



Edited 1 time(s). Last edit at 07/06/2014 06:39PM by mrd0ll4r.
Re: WiFi AP with Edimax EW-7811Un
June 14, 2014 11:07PM
Thank you for the detailed howto,
I added the link to this thread in our compatibility list.
Re: WiFi AP with Edimax EW-7811Un
June 14, 2014 11:52PM
Thank you, I hope it will be of good use ;-)

As an addition: With ieee80211n enabled in the hostapd.conf, the speed improved drastically to about 4.5MB/s, which I think is really nice! :-P
Thanks for this!!!

I had some trouble at first, took me a couple hours. (Im not really a linux guru)

My problem was the last step of the tutorial, it said to edit /etc/default/hostapd and update a line. the file was empty for me but i added the line anyway. It said it would make it start on boot. It didnt work. after a lot of trial and error i ended up using systemd to get the wifi dongle to work at startup.

If anyone is as dumb as me and needs help hese how i did it.

Execute this command:
nano /etc/systemd/system/wifi.service


Add the following:
[Unit]
Description=Starts Wifi
[Service]
ExecStart=/usr/bin/hostapd -dd /etc/hostapd/hostapd/conf
[Install]
WantedBy=multi-user.target


Execute these commands:
systemctl start wifi
systemctl enable wifi

Thanks.
Okay sorry I forgot something. This is probobly a really terrible way of doing this but its all i could think of.

I forgot to mention that you need to set the service on a timer or else it wont work, im assuming this is because the os is not ready at the point it executes.

So assuming you did the steps above:

Execute the following:
systemctl disable wifi.service
nano /etc/systemd/system/wifi.timer


Enter the following:
[Unit]
Description=wifi timer
[Timer]
OnBootSec=1min
Unit=wifi.service
[Install]
WantedBy=multi-user.target


Execute the following:
systemctl enable wifi.timer


Reboot and it should work. Sorry if this is a really backwards way of doing things, its all i could think of. Feel free to provide a better solution.
Re: WiFi AP with Edimax EW-7811Un
July 06, 2014 06:37PM
Oh, thanks for this!
I guess that /etc/default/hostapd is not in use, if it's some kind of configuration file you'll need to edit the /opt/piratebox/conf/hostapd.conf, because that's the one in use ;-)

I'll add that in my post, thanks a lot!

Edit: Took a look at the tutorial - What they are doing is getting hostapd to start at bootup with the correct config, we don't need to do that because it will be started by the piratebox service with /opt/piratebox/conf/hostapd.conf as config file ;-)



Edited 1 time(s). Last edit at 07/06/2014 06:41PM by mrd0ll4r.
Re: WiFi AP with Edimax EW-7811Un
July 09, 2014 07:24PM
Hi Jacob,
the idea of the wifi timer is quite well.

We already have the function called "PROBE_INTERFACE" to wait until the USB Stuff is available.

regards Matthias


This is only my signature.
if you guys want a image for just the hot-spot and install priratebox yourself i have a torrent download. Sorry its 8gb thats how large my card was. torrent link :
magnetmoody smileyxt=urn:btih:1171107872C60D1E18415EAE87D57431FB9CB9AA
just copy and paste into magnet uri input in torrent client
Re: WiFi AP with Edimax EW-7811Un
October 04, 2014 06:38PM
But how I conect the edimax?
Re: WiFi AP with Edimax EW-7811Un
October 09, 2014 10:09PM
I got my EW-7811Un working with this tutorial, however after about 20 mins, the system kicks the USB wifi dongle offline. Rebooting solves it. Does anyone know a fix for this, or if it is a driver problem?
Re: WiFi AP with Edimax EW-7811Un
October 10, 2014 03:13PM
jbtorras, plug it in any of the USB ports, the lower works fine for me.

wiretap, I'm sorry, I don't have that issue... however, I'll leave it on for some time to see what happens
Re: WiFi AP with Edimax EW-7811Un
October 11, 2014 11:15AM
Thanks mrd0ll4r.

I do all the steps but whan I have to deconect the ethernet cable, I can't open the piratebox with putty.
Have i done something wrong?

thanks.
Re: WiFi AP with Edimax EW-7811Un
October 12, 2014 10:49AM
jbtorras,

do you have a "Pirate Box (Share freely)" Wifi now? Because that's the greater goal here:
Use the LAN/Ethernet connection with SSH/PuTTy to set up the box
-> RPi should now "create" a WiFi Access Point named "Pirate Box (something something)"

Because of that the RPi is not reachable via the same IP-Address as before. In fact you'd have to join the WiFi and then SSH/PuTTy to it.
Re: WiFi AP with Edimax EW-7811Un
November 04, 2014 12:28AM
Hi all, I wanted to chronicle my experience getting this all working for you guys. In case anyone else gets in the same boat, or more likely, if I mess something up and need to start over smiling smiley

I have a Raspberry Pi B+ and an Edimax EW-7811Un and was successful in getting everything working thanks to this thread and some help from Matthias via IRC. Thanks everyone!

So, from the top:
----------------------------------------------------------------------------------

1. Download and write the Arch image, following the Raspberry Pi Tutorial
- Once written you need to do a few steps before you actually enable and start piratebox, so:

2. Boot the Pi with the SD card in, and with a ethernet cable plugged. You need to ssh into the box, so you need to find it's IP address. I use an app called Fing on android which will print all your LAN devices IPs. but anywho once you have the IP type in a terminal (replacing the #'s with your actual numbers)
ssh root@192.168.###.##
(For windows users, you can use Putty to do this, and point it's host address to the IP address you learned)
the username and password are both root by default.

3. Once you see a prompt, go ahead and change your password with the command
passwd

4. OK, now we need to switch the hostapd with the one built from Realtek's source, which Matthias has been kind enough to include for us. I tried to build it from source as described in the OP, but after building it didn't work (YMMV). So, since we have the option of using this known working one, we'll do that. So:
pacman -U /prebuild/hostapd/hostapd-8192cu-0.8_rtw_r7475.20130812_beta-3-armv6h.pkg.tar.xz
Note: that filename could change someday, so just type the first few letters and use TAB to complete the filename. just make sure it's the one for 8192cu.
When you hit enter it will ask if you want to remove the current hostapd, and then confirm again. Choose yes for both.

5. When it's done, we need to tell pacman (the pacage manager for arch) to never try to update this package for us, as it may break things someday. To do so, type:
nano /etc/pacman.conf
use your arrow keys to work your way to the bottom of the file and add the following line at the end:
IgnorePkg=hostapd
When you're done, hit Ctl+O to write the file out, hit enter to confirm, then hit Ctl+X to exit nano

6. Next up, we just need to tell hostapd to use the proper driver for our adapter. so:
nano /opt/piratebox/conf/hostapd.conf
Edit it to look like the following:
interface=wlan0
driver=rtl871xdrv
ssid=PirateBox - Share Freely
hw_mode=g
channel=1
ieee80211n=1
The bolded portion is the main thing to change. I have ieee80211n enabled as well which should increase speed.
When done, Ctl+O and Ctl+X to save, and exit as before.

7. When you are done, you can go ahead and reboot with
shutdown -r now
And when its back up, ssh back in and continue the RaspberryPi setup tutorial as before, continuing from Installation section, step 6.

------------------------------------------------------------------------------------------

Once you have got to the point (in the Raspberry Pi guide) of running "systemctl start/enable piratebox", you ought to see an access point from any device you have that supports WiFi. If not, try a reboot and try again, if still nothing, reply here and I and others will try to help you. Double check your hostapd conf files. And if you get an error on boot about wlan link not being ready you can try the solutions in this topic. Id recommend most of those changes even if everything is working.

NOTES:
I had a bit of trouble due to a stupid mistake, make sure when you edit the hostapd.conf that you type the driver name right. there is a L and a 1 in that name. in all caps it'd be RTL871XDRV but don't type it in caps winking smiley

The only thing I haven't tested thus far is bridged mode, though I would like to get that working eventually. If anyone can report back if/how they got it working I'd be very grateful!

smileys with beer
Cheers all! and a big thanks to the devs who made it possible for me to have a piratebox!



Edited 3 time(s). Last edit at 11/04/2014 12:33AM by WACOMalt.
Re: WiFi AP with Edimax EW-7811Un
November 05, 2014 08:08PM
I've been having a bunch of trouble getting the Edimax working, too. Before I run through all of this again, I just want to ask - this install should work fine if I happen to have a screen & keyboard plugged into my RPi, am logged in as root and simply do everything that way instead of going through the trouble of sshing in. Yes?

Thanks!
Evan
Re: WiFi AP with Edimax EW-7811Un
November 06, 2014 10:07AM
@evan: Yes, that should not cause any problems ;-)

@WACOMalt: Great tutorial! Thanks :-)
Re: WiFi AP with Edimax EW-7811Un
November 07, 2014 02:46PM
Thanks WACOMalt and mrd0ll4r

I alredy have running the raspi piratebox
Hi, I'm French user so excuse my poor english.

Try this, it will disable to go to sleep :

sudo nano /etc/modprobe.d/8192cu.conf


Add to the end of file :
# Disable wifi sleeping
options 8192cu rtw_power_mgnt=0


Best regard, Fred
Luke
Re: WiFi AP with Edimax EW-7811Un
April 28, 2015 10:23PM
Thanks for this tutorial, I got a comfast usb wifi adapter to work, it users the RTL8188CUS chip set smileys with beer
Re: WiFi AP with Edimax EW-7811Un
October 13, 2015 11:46PM
Hello everybody.
I tried to configure and compile the kernel and using different versions and hostapd 8192cu.ko. different configs. but nothing work!
I spent a lot of time trying to configure this shit .
This is really shit from realtek .


use RTL871XDRV and
alfa awus036nhr v2 with Realtek Semiconductor Corp. RTL8188RU 802.11n WLAN Adapter
(rtl8192cu on x86)

and I was able to run it all on a new driver 8192cu.ko, but the network is visible only at close range only .from -87 to -93dBi
here proof:


pls help! How i can boost this shit? moody smiley
Who knows how to run and compat rtlwifi (rtl8192cu and nl80211)? nl80211 works on my linux PC very good.
Re: WiFi AP with Edimax EW-7811Un
November 03, 2015 02:42PM
I did what you guys mentioned all the codes , and in the end wlan0 : link is not ready , I dont know what I can do more
mr
Re: WiFi AP with Edimax EW-7811Un
November 24, 2015 11:35AM
Would this work whit raspbian , beacuse I start and it dosent appear on the wireless list
Re: WiFi AP with Edimax EW-7811Un
December 14, 2015 04:00PM
Hey!

I got it to work (finally) and now I am very happy.

But I found a problem :

When I download vor upload something i only get arroud 50-690 KB/s

How can I make It faster?

I am using the hostapd from mrd0ll4r (first post) and the driver from daveconroy.com


Btw: Anyome knows where the files I uploaded are stored?


Thanks smiling smiley
Re: WiFi AP with Edimax EW-7811Un
March 09, 2019 08:11PM
Thank you Jacob for your solution. it worked for me.