RussellPiBot
Posts: 32
Joined: Wed Oct 15, 2014 3:47 pm

Setting up B+ as WiFi Access Point

Sat Jan 10, 2015 6:37 pm

I am trying to setup the Pi as a wifi hotspot so I can give instructions to a PiBot using wireless.

I have been working on this issue for days using various online tools/information to include:

Penguin Tutor - Design and build a Raspberry Pi robot

Lady Ada's - Adafruit Learn - Setting up a Raspberry Pi as a WiFi access point - Last updated on 2014-12-08 09:00:19 PM EST.

The Adafruit guide got me almost to the finish line; I ran into the following problem:

The problem may involve the Adafruit down load:

wget http: //adafruitdownload.s3.amazonaws.com/adafruit_hostapd_14128.zip

When the First Test is run after downloading, unzipping, etc. hostapd_14128.zip file the following code line appears about 16 lines down:

ioctl[RTL_IOCTL_HOSTAPD]: Invalid argument it appears the "C" is missing right after the "[" (bracket)

I believe this error is why the following error message is observed when rebooting the Pi

[failed] startpar: services returned failure: isc-dhcp-server ... failed!

This situation results in the Pi Hotspot being seen by other devices; however, the Pi is not issuing IP addresses to devices that want to join the Access Point.

I do not possess the skills to fix this problem myself.

Any help would be greatly appreciated.

User avatar
kusti8
Posts: 3439
Joined: Sat Dec 21, 2013 5:29 pm
Location: USA

Re: Setting up B+ as WiFi Access Point

Sat Jan 10, 2015 7:13 pm

1. What dongle are you using and what is the chipset. This can be found using lsusb.
2. What is the contents of your interfaces file, your dhcp.conf and hostapd.conf
I used the following instructions and they worked flawlessly for me.

Code: Select all

wget "http://raspberry-at-home.com/files/ap_setup.sh"
chmod +x ap_setup.sh
sudo ./ap_setup.sh
There are 10 types of people: those who understand binary and those who don't.

RussellPiBot
Posts: 32
Joined: Wed Oct 15, 2014 3:47 pm

Re: Setting up B+ as WiFi Access Point

Sat Jan 10, 2015 8:04 pm

Thanks for the questions - answers follow.

dongle is a Realtek RTL8188cus 802.11n

/////////////////////////////////////////////////////////////////////////////
/etc/network/interfaces

auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow hotplug wlan0
iface wlan0 inet static
address 192.168.42.1
netmask 255.255.255.0
up iptables-restore < /etc/iptables.ipv4.net

///////////////////////////////////////////////////////
/etc/hostapd/hostapd.conf

interface=wlan0
driver=rtl871xdrv
ssid=<name>
hw_mode=g
channel=6
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=<name>
wpa_key-mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP

//////////////////////////////////////////
/etc/dhcp/dhcpd.conf

subnet 192.168.42.0 netmask 255.255.255.0 {
range 192.168.42.10 192.168.42.50;
option broadcast-address 192.168.42.255;
option routers 192.168.42.1;
default-lease-time 600;
max-lease-time 7200;
option domain-name "local";
option domain-name-servers 8.8.8.8, 8.8.4.4;
}
/////////////////////////////////////////////////////////////////////////////
End of reponse

DirkS
Posts: 10363
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Setting up B+ as WiFi Access Point

Sat Jan 10, 2015 8:17 pm

You could try using http://www.raspberrypi.org/forums/viewt ... 93#p388827 as a starting point.

Gr.
Dirk.

User avatar
kusti8
Posts: 3439
Joined: Sat Dec 21, 2013 5:29 pm
Location: USA

Re: Setting up B+ as WiFi Access Point

Sat Jan 10, 2015 8:21 pm

The rtl8188cus had to have a special hostapd. I suggest you purge hostapd and isc-dhcp and use the simple script that I posted. It had support for the special hostapd. I can't confirm if you already have that version since I am not at my computer, but the script I posted will make it way easier. I had this problem with the Adafruit tutorial and using the script fixed it.
There are 10 types of people: those who understand binary and those who don't.

RussellPiBot
Posts: 32
Joined: Wed Oct 15, 2014 3:47 pm

Re: Setting up B+ as WiFi Access Point

Sat Jan 10, 2015 9:20 pm

Thanks - I will give it a go tomorrow.

I have more than one SD card so I can clone the one I am currently using, test the solution you are recommending, and not lose any ground with finding a solution to the Adafruit - Learn wifi hotspot guidelines. For piece of mind I need to resolve why I cannot get the the Adafruit solution to work.

That said, I still need to get my PiBot hotspot ready so if your solutions works that is what I will go with.

I will post the outcome.

Thanks again.
Regards,

RussellPiBot
Posts: 32
Joined: Wed Oct 15, 2014 3:47 pm

Re: Setting up B+ as WiFi Access Point

Mon Jan 12, 2015 6:34 pm

DiekS & Kusti8

Thank you both for your suggestions, both recommendations led to some improvements; however, neither led to a solution that would allow me to remote-in to the Pi and issues cmd-line instructions to the Pi.

With that in mind I have decide to work through the problem by posting the results from the following actions on the Adafruit forum. Doing so may be the best way to help ensure my problems can be avoided by others and Pi Based WiFi becomes routine in the Pi world.

1. Format the SD card, load Noobs and install the latest addition of Rasbian.
2. Carefully follow the Adafruit Learn pdf step-by-step to set-up the Pi WiFi hotspot - take notes
3. Document the hardware being used and the Pi set-up - usb hub, what is plugged in where, etc.
4. Provide camera photos of all set-up screens and error messages - if I canot accomplish step five
5. Get up to speed on taking Pi screen shots and completing data dumps.

That said, any help you may provide that would allow me to do data dumps and take screen shots on the pi would be greatly appreciated.

Regards,

Return to “Automation, sensing and robotics”