Giter Club home page Giter Club logo

Comments (3)

NaniteFactory avatar NaniteFactory commented on July 26, 2024

If you've run the script successfully on the Linux side (which I suppose would be the server), you'll get an interface named something like p2p-wlan0-0, then it will start listening for a connection from the other client trying to connect to it.

For the Android client I simply used this sample application by Google. It comes with all the basic features for the Wifi Direct connection, like discover, requesting connections, etc.
https://android.googlesource.com/platform/development/+/master/samples/WiFiDirectDemo
The app can show you a list of all nearby Wifi Direct devices, what they call peers. The list may include the server on which you've run the script. Just tap on it, click on the connect button then it should do the work.
It's as easy as that so play around with it a bit and if you have further questions please let me know I'll try to answer as much as I know.

I hope this helped :)

from wifi-direct-on-linux.

safeeulbashir avatar safeeulbashir commented on July 26, 2024

Thank you. I am actually trying to establish an wifi direct channel between two raspberry pie for file transfer. I am not sure how I can use this to do that. I would appreciate if you could enlighten me about that.

from wifi-direct-on-linux.

NaniteFactory avatar NaniteFactory commented on July 26, 2024

@safeeulbashir

For that case, the process is well described here: http://processors.wiki.ti.com/index.php/OMAP_Wireless_Connectivity_NLCP_WiFi_Direct_Configuration_Scripts#Connect_in_pbc_.28Push_button_Control.29_where_EVM_.231_is_defined_as_the_group_owner

I think this would probably work but I'm not sure because I haven't really tried it...

After that you run the script on the server, in the client use these commands in the order (I presume that wlan1 is your interface and that it does support Wifi Direct) :

$ sudo wpa_cli -i wlan1 terminate -B
$ sudo wpa_cli -i p2p-wlan1-0 terminate -B

$ sudo wpa_supplicant -d -Dnl80211 -c /etc/wpa_supplicant.conf -i wlan1 -B # wpa_supplicant.conf should be put in /etc/ before this
$ sudo wpa_cli -i p2p-wlan1-0

p2p_find # enter the connection process. if this returns fail, it means that your device does not support wifi direct.
p2p_peers # shows the mac address of your peer(server).
p2p_connect xx:xx:xx:xx:xx:xx pbc join p2p_go_intent=0 # (please replace xx:xx:xx:xx:xx:xx with your server's mac address.)

+)
/etc/wpa_supplicant.conf of the client device be like

ctrl_interface=/var/run/wpa_supplicant
update_config=1

ap_scan=1

device_name=somedevice
device_type=1-0050F204-1

# optional, can be useful for monitoring, forces
# wpa_supplicant to use only channel 1 rather than
# 1, 6 and 11:
p2p_listen_reg_class=81
p2p_listen_channel=1
p2p_oper_reg_class=81
p2p_oper_channel=1

from wifi-direct-on-linux.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.