idkpmiller
Posts: 9
Joined: Sun Dec 02, 2012 6:39 am

RPi access point using cheap RTL8188 based dongle

Fri Apr 26, 2013 2:30 am

Hi RPi users,
I have previously provided a detailed tutorial on using the RTL8188CUS chipset based nano USB device as a wifi access point; I have now taken almost all the effort out by creating a script that will install and setup the access point for you, If this interests you then visit http://blog.sip2serve.com/post/48899893 ... all-script
Feel free to contact me through this post.

Ciao
Paul

robbo100
Posts: 60
Joined: Thu May 17, 2012 11:39 am

Re: RPi access point using cheap RTL8188 based dongle

Thu May 02, 2013 6:31 am

Hi there,

Thanks for posting this.

I am trying to use your script to get my TL-WN725N device to work. It uses the 8188eu drivers, does this matter and if it does, can I use the 8188cus drivers instead?

Unfortunately, when I type

Code: Select all

$ ./install-rtl8188cus.sh
(the last command in your blog to run the script) I get the response

Code: Select all

:no such file or directory
Can you think what I might be doing wrong?

Thanks

Robbo100

P.s. I have also tried sudo ./install-rtl8188cus.sh but the results were the same.

idkpmiller
Posts: 9
Joined: Sun Dec 02, 2012 6:39 am

Re: RPi access point using cheap RTL8188 based dongle

Thu May 02, 2013 10:23 am

Hi robbo100,
I have no idea about any other realtek drivers other than then one stated the 8188CUS, many of the newer wifi adaptors are fine with the default configand api hooks offered by the modern hostapd package.
There is a check part way through the script that assuming I got the logic right will fail if and exit the script if it finds that the normal api hooks are found when an iw list command is executed.

The first example you give (../install-rtl8188cus.sh) I would say would not work as I think there are two 'dots' before the forward slash, and the lack of sudo would not help if you did not have permission to run.

however the second command you show in the P.S looks ok; hmm lets do some basics
Are you changed to the correct directory? Try doing a

Code: Select all

ls -al
You should see a row similar to this:

Code: Select all

-rwxr-xr-x  1 root root 9182 Apr 26 13:04 install-rtl8188cus.sh
The important bits are,
did you see the row? if not try following the instructions once more from top to bottom.
if you saw the row, did you see the X's in the 'rwxr-xr-x' sequence? if not you had a problem with the 'chmod command. try again and read any outut messages carefully.

A good tip is if you 'cd' to the directory with the script and type:

Code: Select all

sudo ./i 
then press the TAB key twice and a list of all the commands in the current directory that start with a lower case 'i' will be displayed, entering more characters of the filename and pressing TAB again will show an updated list of commands that still match the growing prefix you have typed, in this way you can be sure not to have a typo.

Let us know how you get on.

Ciao
Paul

robbo100
Posts: 60
Joined: Thu May 17, 2012 11:39 am

Re: RPi access point using cheap RTL8188 based dongle

Thu May 02, 2013 11:39 am

Thanks for the reply Paul

The ../ was a typo on the forum post, I was definitely using just one dot in the Pi command line.

I am at work at the moment, but will try your suggestions when I get home tonight.

As part of my own fault finding I did do a $ dir command and the file install-rtl8188cus was shown in the directory, but I did not check it's attributes (I will do tonight). When I ran the chmod command the pi didn't reply with any errors, it just seemed to accept the change.

Thanks for the tip on sudo ./i followed by TAB, that will definitely help make sure I get the right filename.

robbo100
Posts: 60
Joined: Thu May 17, 2012 11:39 am

Re: RPi access point using cheap RTL8188 based dongle

Thu May 02, 2013 10:11 pm

Right,

I have managed to get it working now.

The only problem is, I seem to have to restart the uhdcpd service after boot-up to get the HDCP working. Is there a way to automate this re-start after startup (or delay it starting until the end of the boot sequence)?

Thanks again

Robbo100

idkpmiller
Posts: 9
Joined: Sun Dec 02, 2012 6:39 am

Re: RPi access point using cheap RTL8188 based dongle

Thu May 02, 2013 10:44 pm

I assume you mean the DHCP server, I am also assuming that you have installed one on your RPi? the best advice I can offer is as a general rule you can throw your search net on goggle out wide looking for Debian answers or even Ubuntu ones, it is only in a small number of cases that the hardware or CPU architecture of the RPi changes the answer.
Having said that if you would like to explain what you have setup and what you are trying to achieve and the point you get stuck at, I and others on the forum will try and help.

ciao
Paul

smshiera
Posts: 37
Joined: Fri Feb 22, 2013 6:59 am

Re: RPi access point using cheap RTL8188 based dongle

Fri May 03, 2013 3:45 am

i have a 8188cus,i really need this

ls -al
i got this
-rwxr-xr-x 1 root root 9562 May 3 11:16 install-rtl8188cus.sh
then
pi@raspberrypi ~ $ ./install-rtl8188cus.sh
: No such file or directory
pi@raspberrypi ~ $ sudo ./install-rtl8188cus.sh
: No such file or directory

why?

idkpmiller
Posts: 9
Joined: Sun Dec 02, 2012 6:39 am

Re: RPi access point using cheap RTL8188 based dongle

Fri May 03, 2013 5:54 am

Hi smshiera and robbo100,
let me apologise, I have corrected the tumblr blog so that this now works (so I believe) I had made some mistakes with the commands which I have now corrected, but the biggest problem is that the file I had uploaded to dropbox was the one I had saved on to a NAS and it was saved in windows format not unix. Which meant the linefeed that unix/linux use had been converted incorrectly to carriage returns line feeds that windows uses, resulting in the script not bieng run and throwing an error......
If you delete the current script on your RPi by CD'ing to the correct directory and using

Code: Select all

rm -f -y  install-rtl8188cus.sh
Now go back to the corrected blog post and start again.
@robbo100, if you are uncomfortable for me mentioning your nickname in the post let me know and will remove it.

robbo100
Posts: 60
Joined: Thu May 17, 2012 11:39 am

Re: RPi access point using cheap RTL8188 based dongle

Fri May 03, 2013 6:27 am

Hi Paul,

I have no problem with being mentioned on the blog (not that I have done much other than get stuck :lol: )

Because of the problems with the script, I ended up using the instructions here: www.jenssegers.be which worked fine (I felt like a I had entered the full world of linux having to compile something from github). There are a couple of typos in this guide (some of his file references are inconsistent between v1.0 and v1.1), but if you correct those when you go through the process then it works fine.

My ultimate aim is to have a fully functioning Raspberry Pi Wireless HotSpot with combined NAS function. I plan to have it in my car, so that I can use XBMC on my Nexus tablet to access media whilst on the road (for the kids, not whilst I am driving :lol: ).

I have set up udhcpd to do the routing based upon the instructions here: http://www.elinux.org/RPI-Wireless-Hotspot

The problem for me is that when I power up the Pi, the wireless hotspot is available, but when I connect to it from another device (i.e. the Nexus) it will not acquire an IP address. If I then restart the udhcpd service on the pi, it immediatelly works fine and gets an IP address. So it seems like the udhcpd service maybe starting to early in the boot process and may need to be delayed, or restarted later.

I will have a more detailed look on the internet tonight, but if anyone has any ideas how to fix it, then please let me know. I am soooooo close!

Thanks

Robbo100

idkpmiller
Posts: 9
Joined: Sun Dec 02, 2012 6:39 am

Re: RPi access point using cheap RTL8188 based dongle

Fri May 03, 2013 6:54 am

its a real shame that the http://www.jenssegers.be blog post was not available when I needed it last year, oh well good to know there is a source for the hostapd binary.

I also played with using udhcpd but not for use as a straight forward DHCP server but instead for setting up an automatic discovery mode; the idea is that you connect your RPi to a network wifi and/or Ethernet and the RPi would work out if:
A. a DHCP server was present if it was it would have a DHCP address with an obscure static seconday IP so I could always find it.
B. if no DHCP server was fgound it would start up a DHCP server and allocate IP addresses to devices that issue DHCP requests

I have not given up on this and believe oit is doable, I got sidetracked making all the interfaces I plug-in truely hot-plugable.
As part of this I found I had to restart the hostapd application everytime the configuration changed.
there are a few places that you can branch off to run a script depending on what you want to do, the quick and dirty one is to use the /etc/rc.local file and before the 'exit 0' simply add the restart command for what you want to reset late in the boot up process, it pays to put an echo statement before and after your restart command with some marker text so you can see that it got to where you hopped it would.
Although you get a warning make sure in a script file you restart a service like this:

Code: Select all

/etc/init.d/hostapd restart
and not like this:

Code: Select all

service hostapd restart
Hope that helps

Ciao
Paul.

robbo100
Posts: 60
Joined: Thu May 17, 2012 11:39 am

Re: RPi access point using cheap RTL8188 based dongle

Fri May 03, 2013 8:05 am

Thinking about it on the way to work this morning, it may just be that the service isn't started. To get it to work I restart the service, but I haven't tried just starting it.

I wonder if I might have just put a typo in the command used to tell the Pi to start it automatically on startup.

I will have a play tonight.

smshiera
Posts: 37
Joined: Fri Feb 22, 2013 6:59 am

Re: RPi access point using cheap RTL8188 based dongle

Fri May 03, 2013 8:49 am

Backup hostapd file [OK]
Delete old hostapd file [OK]
Download the hostapd file [FAIL]

pi@raspberrypi ~ $

I cant download this hostapd,i tried three times.
Can i pre-download it? so I can install it at local-directory..
Last edited by smshiera on Fri May 03, 2013 10:17 am, edited 1 time in total.

idkpmiller
Posts: 9
Joined: Sun Dec 02, 2012 6:39 am

Re: RPi access point using cheap RTL8188 based dongle

Fri May 03, 2013 9:01 am

Look at the script and perform the actions manually, you are closer to the end then the beginning
Good luck

smshiera
Posts: 37
Joined: Fri Feb 22, 2013 6:59 am

Re: RPi access point using cheap RTL8188 based dongle

Fri May 03, 2013 10:15 am

idkpmiller wrote:Look at the script and perform the actions manually, you are closer to the end then the beginning
Good luck

finally it work!
I use ipad reply this post through 8188cus-ap,thank you very much.

ask another stupid question,how can i turn it back to normal network card?

idkpmiller
Posts: 9
Joined: Sun Dec 02, 2012 6:39 am

Re: RPi access point using cheap RTL8188 based dongle

Fri May 03, 2013 8:27 pm

Do you mean a client mode wifi?
if so not with the script, it was always apparently easy for people to get the adaptor working as a client.
This is something I would use from a point where I decided I wanted the access point ability on the RPi image. if I decided I did not want it I would return to the last SD card image backup or start afresh as I was simple playing with ideas.
The ethernet port and the wifi port are now essentially a bridge meaning that whatever you connect on one can be seen on the other; there are lots of things that can be done in this area and some nice scripts with menu's like raspi-config would be one of them, its simply not what I am into doing...
I hope you have fun with your new access point capability option and use it when you need it now all the time, rememebr the RPi has IO issues and a bridge makes it work quite hard expecially on anything other than a quiet network.

Ciao
Paul

Return to “Networking and servers”