Wifi direct (P2P) has been implemented in WLAN drivers and wpa_supplicant. I would like to work on 2 machines connected each through wifi direct.

Documentation

Like mentioned in the comments I was only able to bring it to work with openSUSE 12.3. I got two laptops with the wifi card Atheros Communications Inc. AR9485 Wireless Network Adapter (rev 01).

Intel Wireless cards, at least the older ones, doesn't seem to be usable for Wifi Direct [yet].

Howto for 12.3:

All steps need to be run on both machines!

Since Network Manager and its own wpa_supplicant daemon could interfere it should be disabled. Switch in yast2 lan to the traditional network method.

wpa_supplicant (>= 2.0) needs to be compiled with the following options:

CONFIG_DEBUG_FILE=y

CONFIG_DRIVER_NL80211=y

CONFIG_CTRL_IFACE=y

CONFIG_WPS=y

CONFIG_WPS2=y

CONFIG_P2P=y

CONFIG_AP=y

For 12.3 and 13.1 I have created a forked package with these options: https://build.opensuse.org/package/show/homeadd-emojibranchesadd-emoji13.1/wpa_supplicant

A configuration file for wpa_supplicant is required with the following content:

ctrl_interface=/var/run/wpa_supplicant

update_config=1

ap_scan=1

device_name=DEVICE-NAME

device_type=1-0050F204-1

p2p_go_ht40=1

wpa_supplicant has to be started as a daemon: wpa_supplicant -Dnl80211 -c <configuration_file> -f /var/log/wpa_supplicant -i wlan0 -ddt -B

The following commands need to be run in wpa_cli

p2p_find

p2p_stop //run after the opposite client was found

p2p_connect MAC pbc go_intent=1

Last but not least the network device has to be configured with something like: ifconfig p2p-wlan0-0 192.168.1.<number> netmask 255.255.255.0 up

Findings with openSUSE 13.1

  • I have used the same wpa_supplicant package just compiled against 13.1.
  • Finding the p2p device does work but the connect does always fail because it is unable to switch the wireless mode. http://pastebin.suse.de/8001
  • To test if it is just a driver issue/kernel regression I have installed the 12.3 Kernel in 13.1 but the result was the same. So I would suspect that the udev name changes might interfere in the process. I have already informed two udev guys if they have a clue if this might be the reason or how to address the issue.

Future

Matt Chen is planning to integrate the functionality in NetworkManager so it would be much easier to set up a direct connection. This might make it pretty easy to share information between Android and Linux but I haven't tested the Android Wifi Direct functionality yet.

Links

http://processors.wiki.ti.com/index.php/OMAP_Wireless_Connectivity_NLCP_WiFi_Direct_Configuration_Scripts http://wireless.kernel.org/en/developers/p2p/howto

Source git

git://w1.fi/srv/git/hostap.git (wpa_supplicant)

git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-testing.git (wireless testing kernel)

Looking for mad skills in:

Nothing? Add some keywords!

This project is part of:

Hack Week 10

Activity

  • over 2 years ago: thardeck disliked Wifi direct on OpenSUSE
  • over 2 years ago: thardeck disliked Wifi direct on OpenSUSE
  • over 5 years ago: StefanBruens liked Wifi direct on OpenSUSE
  • over 5 years ago: thardeck started Wifi direct on OpenSUSE
  • over 5 years ago: thardeck liked Wifi direct on OpenSUSE
  • Show History

    Comments

    • joeyli
      over 5 years ago by joeyli | Reply

      Video: http://www.flickr.com/photos/104068895@N07/10065131186/in/pool-hackweek

    • thardeck
      over 5 years ago by thardeck | Reply

      The wpa_supplicant in OpenSUSE 12.3 isn't compiled with Wi-Fi Direct support but 13.1 is shipped with it enabled and also the NetworkManager of this version seems to have an option for for this setting (ap-mode?). But according to the NM log my Centrino N-6300 wifi card doesn't support Access Point mode so I don't really have hardware to test it.

    • thardeck
      over 5 years ago by thardeck | Reply

      I have found a laptop with an Atheros chip which seems to support ap mode. The required wpasupplicant build options are there in the wpasupplicant config of 13.1 but they are commented out so the package needs to be rebuild manually. https://build.opensuse.org/package/show/homeadd-emojibranchesadd-emoji13.1/wpa_supplicant

    • thardeck
      over 5 years ago by thardeck | Reply

      So I got it working on 12.3, 13.1 does result in problems probably because of the network device renaming. In 13.1 wpa_supplicant is unable after the p2p negotiation to set the device to master mode.

      For 12.3 wpa_supplicant needs to be updated and there is an issue that ifconfig doesn't show the full device name because of space limitation. The correct name for the p2p device is p2p-wlan0-0, then the ping does work.

    • thardeck
      over 5 years ago by thardeck | Reply

      Copying a file with scp did work but it looks more like a 802.11g instead of an 802.11n connection although I have added p2pgoht40=1 to the wpasupplicant conf which is supposed to enable 802.11n. http://processors.wiki.ti.com/index.php/OMAPWirelessConnectivityNLCPWiFiDirectConfigurationScripts#P2P_usecases The transfer rates where around 1.6 - 1.8 MB/s but stayed quite stable even four rooms away.

      I am using two laptops with a AR9485 Wireless Network Adapter.

    • matt680209
      over 5 years ago by matt680209 | Reply

      I am using AR9462 and with the most recent kernel, v3.12-rc3, to work. I am running openSUSE 12.3 with the latest wpa_supplicant followed the configuration as described. Also apply ip command to set up the P2P interface would work to me and now I am able to ping and ssh login each when 2 machines are connected.

      Next step to add very general functions in NM is my plan.

    Similar Projects

    This project is one of its kind!