adampalmer
Posts: 3
Joined: Tue Jun 07, 2016 9:35 pm

Pi3 WiFi WPA2 ad-hoc mode?

Tue Jun 07, 2016 9:40 pm

Hey guys,

Banging my head against a wall with the built in wifi chipset on the Pi 3.

Using raspbian jessie, 4.4.12-v7+. Using standard brcmfmac driver. I can't get ad-hoc mode working in any mode other than plaintext:

Code: Select all

network={
    ssid="adhoc"
    key_mgmt=WPA-PSK
    proto=RSN
    psk="12345678"
    mode=1
    frequency=2412
    pairwise=CCMP
    group=CCMP
}

Code: Select all

wpa_supplicant -c wpa.conf -Dnl80211 -i wlan0
Successfully initialized wpa_supplicant
wlan0: Trying to associate with SSID 'adhoc'
wlan0: Associated with 7e:39:bc:fe:f8:40
wlan0: CTRL-EVENT-CONNECTED - Connection to 7e:39:bc:fe:f8:40 completed [id=0 id_str=]
wlan0: IBSS-RSN-COMPLETED 04:f0:21:14:c5:33
wlan0: WPA: Failed to set GTK to the driver (alg=3 keylen=16 keyidx=1)
wlan0: RSN: Failed to configure GTK
wlan0: CTRL-EVENT-EAP-FAILURE EAP authentication failed
Is plaintext or WEP really my only option in adhoc mode with this chip/driver?

The intention is to set up a mesh network of Pi 3s. The driver doesn't support 802.11s mesh mode so trying to fall back on adhoc, but going plaintext won't work out.

Any ideas? TIA
Last edited by adampalmer on Wed Jun 08, 2016 7:52 am, edited 1 time in total.

User avatar
DougieLawson
Posts: 39304
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Pi3 WiFi WPA2 ad-hoc mode?

Wed Jun 08, 2016 7:21 am

adampalmer wrote:

Code: Select all

network={
    ssid="adhoc"
    key_mgmt=WPA-PSK
    proto=RSN
    psk="12345678"
    mode=1
    frequency=2412
    pairwise=CCMP
    group=CCMP
}
Get rid of most of the junk in your network block.

Code: Select all

network={
    ssid="MySSID"
    psk="12345678"
}
Use this stuff to your hostapd.conf

Code: Select all

interface=wlan0
driver=nl80211
ssid=MySSID
hw_mode=g
channel=9
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_key_mgmt=WPA-PSK
wpa_passphrase=12345678
rsn_pairwise=CCMP
BTW, you're not making an ad-hoc network, it's an infrastructure network.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

adampalmer
Posts: 3
Joined: Tue Jun 07, 2016 9:35 pm

Re: Pi3 WiFi WPA2 ad-hoc mode?

Wed Jun 08, 2016 7:47 am

Intention is to make an adhoc network, not an infrastructure network.

The 'mode=1' in my wpa_supplicant.conf specifies ad-hoc mode. The example is taken straight from the wpa_supplicant.conf howto and works on other chipsets to create a WPA2 encrypted adhoc network.

User avatar
DougieLawson
Posts: 39304
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Pi3 WiFi WPA2 ad-hoc mode?

Wed Jun 08, 2016 7:58 am

Try my hostapd.conf I think you'll be amazed when it "just works".

Most WiFi adapters for RPis do NOT support ad-hoc networks, because that stuff isn't in their drivers.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

adampalmer
Posts: 3
Joined: Tue Jun 07, 2016 9:35 pm

Re: Pi3 WiFi WPA2 ad-hoc mode?

Wed Jun 08, 2016 8:19 am

DougieLawson wrote:Try my hostapd.conf I think you'll be amazed when it "just works".

Most WiFi adapters for RPis do NOT support ad-hoc networks, because that stuff isn't in their drivers.
Hey, I believe you :-) But your config sets up an Infrastructure (AP + Clients) WPA2 network. I'm not trying to set up an infrastructure network. I'm specifically trying to set up an adhoc network and then implement BATMAN/babel/oslr on top to form a decentralized mesh network.

The whole thing works fine with plaintext adhoc, but no WPA or WPA2 options. Is it really that the brcmfmac in the Pi3 only supports plaintext adhoc mode?

alphacake
Posts: 3
Joined: Fri Jun 17, 2016 9:29 pm

Re: Pi3 WiFi WPA2 ad-hoc mode?

Sat Jun 18, 2016 11:43 pm

Can somebody please answer this? Some engineer member who might answer on how to achieve encrypted ad-hoc with pi3?

I would also like to do the same. Tomorrow I will post what I've accomplished, I don't have the pi3 at hand now.

PaulA720
Posts: 2
Joined: Wed Jun 22, 2016 4:21 am

Re: Pi3 WiFi WPA2 ad-hoc mode?

Wed Jun 22, 2016 4:29 am

DougieLawson wrote:
adampalmer wrote:

Code: Select all

network={
    ssid="adhoc"
    key_mgmt=WPA-PSK
    proto=RSN
    psk="12345678"
    mode=1
    frequency=2412
    pairwise=CCMP
    group=CCMP
}
Get rid of most of the junk in your network block.

Code: Select all

network={
    ssid="MySSID"
    psk="12345678"
}
Use this stuff to your hostapd.conf

Code: Select all

interface=wlan0
driver=nl80211
ssid=MySSID
hw_mode=g
channel=9
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_key_mgmt=WPA-PSK
wpa_passphrase=12345678
rsn_pairwise=CCMP
BTW, you're not making an ad-hoc network, it's an infrastructure network.
Hey Dougie, I'm new and I want to ask a quick question.

I have a raspberry pi3 with motion on it and it's working great. I want it separate from my home network. I want to it to be a stand alone device and I'd like it to broadcast as an access point or I guess what you were describing as an infrastructure network. I'd like to log into it with a laptop and see the camera stream instead of having it connected to my main network. From your earlier answer this isn't quite the same as an ad-hoc set up. How would I do this, would I need to install the necessary dhcp software and then configure the hostapd file? I'd be extremely grateful if you could help me or point me to a current tutorial for jessie. I can use the on-board wireless chip but I also have a TP-LINK TL-WN722N that I can use, thanks.

User avatar
DougieLawson
Posts: 39304
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Pi3 WiFi WPA2 ad-hoc mode?

Wed Jun 22, 2016 5:54 pm

Try this: https://frillip.com/using-your-raspberr ... h-hostapd/

You should be able to connect to your RPi's webserver at http://172.24.1.1 if you get that running.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

alphacake
Posts: 3
Joined: Fri Jun 17, 2016 9:29 pm

Re: Pi3 WiFi WPA2 ad-hoc mode?

Wed Jun 22, 2016 6:29 pm

DougieLawson wrote:Try this: https://frillip.com/using-your-raspberr ... h-hostapd/

You should be able to connect to your RPi's webserver at http://172.24.1.1 if you get that running.
You can follow that tutorial but in the case you do not want internet in the thing that connects to the PI Acess Point network you are creating, you can skip most of the dnsmasq thing. And, for it to work with pi3 wifi antenna, DO NOT DEFINE driver=nl80211 in the hostpad.conf (not quite sure why, just dont define a driver there). Please guys correct me if I am wrong.

So you could have something in the interfaces file

Code: Select all

allow-hotplug wlan0
iface wlan0 inet-static
    address 10.0.0.1 
    netmask 255.255.255.0
(that will only work if you set the deny command in dhcpcd.conf for Raspbian Jessie as in the tutorial)

In the hostpad.conf everything like the tut except remove driver

In the dnsmasq.conf

Code: Select all

interface=wlan0
dhcp-range=10.0.0.2,10.0.0.4,255.255.255.0,infinite 
With that ip range you would only be able to connect 3 things and get one of those 3 ips to each.


If you are not interested in using wpa, I guess all this could be simpler and directly put into the interfaces. (after the denying)

gregster
Posts: 1
Joined: Wed Oct 05, 2016 4:23 pm

Re: Pi3 WiFi WPA2 ad-hoc mode?

Wed Oct 05, 2016 4:29 pm

@adampalmer, Did you manage to get anywhere with this?
I pretty much gave up.
I've had a little success with the following configuration:

Code: Select all

trl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
ap_scan=2
network={
        ssid="FooBar"
        key_mgmt=WPA-NONE
        psk="FOOBAR"
        mode=1
        proto=WPN
        group=TKIP
        pairwise=NONE
        frequency=2462
}
With this config the 2 nodes I was testing it on was able to connect, however, I had to fire up wpa_supplicant almost at the same time on both nodes (5-10 sec. apart).

Return to “Advanced users”