I have a Pi 2 B, kernel 3.18.7-v7+ (Wheezy). I have the edimax EW-7811UN (reportedly with the realtek hardware). I cloned the GitHub, ran the install, ran the P2P_UI and it worked. I ran the commands e, then 1 and right then my android was found and listed in the lower box of the UI. I continued with the commands a, m, but it told me to select the number, not the mac address (Please insert the number in the scan list:), so I entered 01 (and I've also tried just 1) as that's the only device in the list. I then typed p and then 1 and immediately my android prompted me with "Invitation to connect, Connect with RTL8192CU in xx seconds (counting down from 30), Type the required PIN:" and counts down until it times out, but then starts back up again asking for the PIN.
Meanwhile on the Pi the P2P_UI keeps refreshing over and over changing the Status= line between "UI unkown failed, P2P_STATE_FIND_PHASE_SEARCH, P2P_STATE_LISTEN, P2P_STATE_FIND_PHASE_LISTEN, P2P_STATE_NONE". Your instructions didn't say anything about the P2P_UI refreshing over and over so I don't know if that's a problem or if it's expected.
On my Pi, I enter the PIN shown on the P2P_UI screen "12345670", the android finally said it was Connected. I would have thought that was all that was needed and I could go about using the connection.
Then I exited the P2P_UI and it dropped my WifiDirect connection. I've reconnected several times and even been able to ssh into the Pi from an android ssh client. But it didn't last and eventually I got dropped. I wondered if like the Pi, the WifiDirect page on the android had to remain showing like P2P_UI? Does P2P_UI have to remain running for WifiDirect to stay connected? Is there something more I need to do once connected so that I can exit P2P_UI? It seems that something isn't quite right to feel like this is working correctly.
Sorry for not getting back to you as quickly as I would have liked. Here are the commands I used in order to test on a brand new raspbian build:
sudo apt-get update && sudo apt-get upgrade && sudo apt-get install firmware-realtek
git clone https://github.com/bass0324/rtl8192cu.git
chmod 777 ./install.sh
sudo ./P2P_UI wlan0
This then brings up a GUI in which these commands were run in order to connect to another device:
- Select the mac address of the device you wish to connect to (should be named same as android device)
On the wifi direct device (android in my case) type in the password
Once this is complete, you should now have a completed Wifi Direct interface between your Android device and the Raspberry Pi. In order to implement this in other ways, there is C code in the same folder the ./P2P_UI code is run which contains all of the commands used by the GUI in order to create the connection. These commands can be manipulated in other code in order to do what you need them to do. Let me know if there is any other questions you guys may have.