Jenkins
Posts: 6
Joined: Fri Aug 03, 2012 5:12 am

[HOW TO] Wireless Hotspot With Realtek RTL8188CUS

Mon Oct 08, 2012 5:40 pm

As part of my project use the raspberry pi to control my dlsr I wanted it to create a wireless hotspot if it was unable to connect to a wireless network. This is how I got it working for me with a Edimax EW-7811Un (Realtek RTL8188CUS) .
I used the latest Raspbian image so did not need to install any drivers for the wifi dongle.

You need to check the name of your wifi dongle mine was "wlan0" , this can be done using the command.

Code: Select all

ifconfig
To connect to wifi on boot you need to configure the interfaces file. This is the network which the pi trys to connect to first.

Code: Select all

nano /etc/network/interfaces
My interfaces file looks like this, make sure you change "your-ssid" and "your-password"
auto lo wlan0

iface lo inet loopback
iface wlan0 inet dhcp
wpa-ssid your-ssid
wpa-psk your-password

iface eth0 inet dhcp
Next install the dhcp server

Code: Select all

apt-get install isc-dhcp-server
Now so set up the dhcp, edit the file

Code: Select all

nano /etc/default/isc-dhcp-server
So the bottom line reads
INTERFACES="wlan0"
Now edit this file

Code: Select all

nano /etc/dhcp/dhcpd.conf 
So it looks like:
Change any names/settings to suit your requirements. The hardware address will need changing to match yours, it can be found by running

Code: Select all

ifconfig
DDHCPDARGS=wlan0; # to specify to which interface your dhcpd server have to listen

default-lease-time 600;
max-lease-time 7200;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.1.255;
option routers 192.168.1.255;
option domain-name "DSLR.PI";

subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.1 192.168.1.10;
}

host raspberrypi {
hardware ethernet 80:1f:02:61:0e:b1;
fixed-address 192.168.1.3;
}
Because this file is not created when isc-dhcp-server is installed you need to create it.

Code: Select all

touch /var/lib/dhcp/dhcpd.leases
Finally so that the wifi hotspot is created if you are not connected to a network edit this file :

Code: Select all

nano /etc/rc.local
Adding this in changing "your-ssid", and any of the settings sicha s teh essid and the key.
if iwconfig | grep your-ssid
then
echo "Already conneced to wireless network"
else
echo "Setting up wireless hotspot"
ip link set wlan0 down
iwconfig wlan0 mode ad-hoc
iwconfig wlan0 channel 4
iwconfig wlan0 essid 'RasPiDSLR'
iwconfig wlan0 key password
ip addr add 192.168.1.255/16 dev wlan0
ip link set wlan0 up
/usr/sbin/dhcpd wlan0
fi
Hope this helps people.

DOSSTONED
Posts: 14
Joined: Wed Sep 19, 2012 2:47 pm

Re: [HOW TO] Wireless Hotspot With Realtek RTL8188CUS

Tue Oct 09, 2012 2:51 pm

I'll try it.
1. Always wanted to use IPv6 in the subnet(IPv6 advertisement is handled by the gateway, and I just pass the traffic from eth0 to wlan0)
2. Maybe we can wait for the new driver cause the current driver DOES NOT provide AP mode, but I made the AP possible under Fedora 17 X86_64. You know, ad-hoc seems not support with smart phones.

Jenkins
Posts: 6
Joined: Fri Aug 03, 2012 5:12 am

Re: [HOW TO] Wireless Hotspot With Realtek RTL8188CUS

Tue Oct 09, 2012 4:42 pm

DOSSTONED wrote: You know, ad-hoc seems not support with smart phones.
Hopefully it works for you, I can connect to the ad-hoc network and ssh into my pi with my htc desire and the connect bot app.

Edit: I am running the oxygen rom

Colly
Posts: 17
Joined: Mon Jul 16, 2012 4:27 am

Re: [HOW TO] Wireless Hotspot With Realtek RTL8188CUS

Tue Jan 15, 2013 8:49 am

Jenkins wrote:As part of my project use the raspberry pi to control my dlsr I wanted it to create a wireless hotspot if it was unable to connect to a wireless network.
What's a "dlsr"? Something new I hadn't heard of?
Is it one of the things in this list? http://www.acronymgeek.com/DLSR

I especially like your idea that it should create a wi-fi hotspot even if it can't connect to the net.

Jenkins
Posts: 6
Joined: Fri Aug 03, 2012 5:12 am

Re: [HOW TO] Wireless Hotspot With Realtek RTL8188CUS

Fri Jan 18, 2013 10:05 pm

Colly wrote:
What's a "dlsr"? Something new I hadn't heard of?
Is it one of the things in this list? http://www.acronymgeek.com/DLSR

I especially like your idea that it should create a wi-fi hotspot even if it can't connect to the net.
DSLR stands for digital single lens reflex digital camera such as these ones by Nikon http://www.nikonusa.com/en/Nikon-Produc ... index.page

Colly
Posts: 17
Joined: Mon Jul 16, 2012 4:27 am

Re: [HOW TO] Wireless Hotspot With Realtek RTL8188CUS

Sat Jan 19, 2013 4:40 am

Jenkins wrote:
Colly wrote:
What's a "dlsr"? Something new I hadn't heard of?
Is it one of the things in this list? http://www.acronymgeek.com/DLSR

I especially like your idea that it should create a wi-fi hotspot even if it can't connect to the net.
DSLR stands for digital single lens reflex digital camera such as these ones by Nikon http://www.nikonusa.com/en/Nikon-Produc ... index.page
Ah - so then "DLSR" was just a typo with the L & S swapped,

Jenkins
Posts: 6
Joined: Fri Aug 03, 2012 5:12 am

Re: [HOW TO] Wireless Hotspot With Realtek RTL8188CUS

Sun Jan 20, 2013 2:14 pm

Opps had not spotted that thanks!

User avatar
Tickle
Posts: 23
Joined: Thu Jan 17, 2013 2:28 pm
Location: Indianapolis, Indiana

Re: [HOW TO] Wireless Hotspot With Realtek RTL8188CUS

Tue Jan 22, 2013 4:30 pm

Sweet! I'm so glad you included what Wifi dongle you used, I had been usure of which one to buy. I will use this as soon as my Pi comes in the mail (literally the slowest few weeks of my life :lol: )
Hunter's Pi Projects: http://www.hunterthornsberry.com/raspberrypi.html

Return to “Networking and servers”