Share wifi linux android

Wifi Direct between linux & android

Furthermore, is it even possible to open several connections with different devices, each on a different channel, using the same WiFi chip? Solution: In order to change the channel of the Wifi Direct of your device you need to do the following: Solution: One way of achieving what you want is by assigning a static IP address to one of the devices say the device running Linux for example: (modify to match your own, where p2p-interface is the interface created for p2p communication after running wpa_supplicant, on my device it is p2p-wlan0-0 ) and on the other device, in your case the Android phone, connect to that IP address using your application.

Wifi Direct between linux & android

I’m trying to connect linux and android via Wifi Direct, especially Odroid-C1 and Galaxy S7. By using wpa_supplicant and wpa_cli, I successed make wifi direct connection, So Android shows Wifi Direct Connected as you can see below.(in the red rectangle)

The question is HOW CAN I DO SOMETHING like file transfer, even send PINGs!

In the wifi direct between two linux systems, each IP address can easily set, so I could use FTP or SSH. But the android, it is hard to know it’s IP address, and almost every wifi direct app does not working.

Does anyone have clue about this situation??

One way of achieving what you want is by assigning a static IP address to one of the devices say the device running Linux for example:

ifconfig p2p-interface 192.168.1.5 netmask 255.255.255.0 up

(modify to match your own, where p2p-interface is the interface created for p2p communication after running wpa_supplicant, on my device it is p2p-wlan0-0 )

and on the other device, in your case the Android phone, connect to that IP address using your application.

How to set up a Wifi-Direct connection between Android, It works as expected. When I try it with two Android devices, they can see each other and connect (it appear the Wifi-Direct icon). Now I am trying to connect Android and Linux, but I guess I don’t really understand how wpa_supplicant works. I also saw this question that is very similar to what I … Code sample#!/bin/bashwpa_cli -i wlan0 terminate -Bwpa_cli -i p2p-wlan0-0 terminate -Bcp ./fi.* /usr/share/dbus-1/system-services/service network-manager restartFeedback

Читайте также:  Раздаем wi fi через iphone

How to set up a Wifi-Direct connection between Android

How to set up a Wifi-Direct connection between Android and Linux — Android [ Glasses to protect eyes while coding : https://amzn.to/3N1ISWI ] …

Wpa_supplicant wifi-direct connection between Linux

wpa_supplicant wifi — direct connection between Linux and AndroidHelpful? Please support me on Patreon: https://www.patreon.com/roelvandepaarWith thanks & pra

Connect Android with Computer Via Wifi Direct

Connecting Android Device with Computer via Wifi Direct with Easy Steps and free. No USB needed in this operation because you will use it without USB. Get W

Wpa_supplicant wifi-direct connection between Linux and Android

I’m trying to make wifi-direct connection between Android and Linux. I’m using rtl8188au.

I found some tips about wifi direct by using wpa_supplicant, so I get wpa_supplicant v2.0. and this is what I did for wifi-direct.

1.Compiled rtl8288au driver, activated nl80211. 2.Compiled wpa_supplicant and wpa_cli for nl80211. 3.Run wpa_supplicant on linux, with option -Dnl80211. success. 4.Set ip address for wlan0. 5.Run wpa_cli, and try to connect to android device. 

The connection can made success at once, but disconnected soon.

wpa_cli -p /var/run/wpa_supplicant

> p2p_find OK P2P-DEVICE-FOUND e6:fa:ed:8a:5e:e8 p2p_dev_addr=e6:fa:ed:8a:5e:e8 pri_dev_type=10-0050F204-5 name='[Phone] Kulong' config_methods=0x188 dev_capab=0x25 group_capab=0x0 > > > p2p_connect e6:fa:ed:8a:5e:e8 pbc OK P2P-FIND-STOPPED P2P-DEVICE-FOUND e6:fa:ed:8a:5e:e8 p2p_dev_addr=e6:fa:ed:8a:5e:e8 pri_dev_type=10-0050F204-5 name='[Phone] Kulong' config_methods=0x80 dev_capab=0x25 group_capab=0x8 P2P-GO-NEG-SUCCESS CTRL-EVENT-STATE-CHANGE state=3 BSSID=00:00:00:00:00:00 SSID= CTRL-EVENT-CONNECTED - Connection to 38:1d:d9:d4:db:70 completed (auth) [id=0 id_str=] CTRL-EVENT-STATE-CHANGE state=9 BSSID=38:1d:d9:d4:db:70 SSID=DIRECT-4J CTRL-EVENT-EAP-STARTED e6:fa:ed:8a:de:e8 CTRL-EVENT-EAP-PROPOSED-METHOD vendor=0 method=1 CTRL-EVENT-EAP-PROPOSED-METHOD vendor=14122 method=254 WPS-REG-SUCCESS e6:fa:ed:8a:de:e8 2d96823c-8a30-5dd0-a267-e3adae8b1564 P2P-GROUP-FORMATION-SUCCESS P2P-GROUP-STARTED wlan0 GO ssid="DIRECT-4J" freq=2412 passphrase="xZbKV6sF" go_dev_addr=38:1d:d9:d4:db:70 WPS-SUCCESS CTRL-EVENT-EAP-FAILURE e6:fa:ed:8a:de:e8 AP-STA-CONNECTED e6:fa:ed:8a:de:e8 p2p_dev_addr=e6:fa:ed:8a:5e:e8 AP-STA-DISCONNECTED e6:fa:ed:8a:de:e8 p2p_dev_addr=e6:fa:ed:8a:5e:e8 P2P-DEVICE-LOST p2p_dev_addr=e6:fa:ed:8a:5e:e8 

If so, what should I do for complete wifi-direct connection?

It needs not only wpa_supplicant but also iwpriv, hostapd, dhcpd.

here is what I did for wifi-direct connect.

Device Mode ( Linux requests connection to Android)

ifconfig wlan0 192.168.1.15 up iwpriv wlan0 p2p_set enable=0 iwpriv wlan0 p2p_get status iwpriv wlan0 p2p_get role iwpriv wlan0 p2p_set enable=1 iwpriv wlan0 p2p_set intent=1 iwpriv wlan0 p2p_get status iwpriv wlan0 p2p_set op_ch=6 iwpriv wlan0 p2p_set ssid=DIRECT-RT iwpriv wlan0 p2p_set setDN="RTL8192CU" iwlist wlan0 scan iwpriv wlan0 p2p_get2 wpsCM= iwpriv wlan0 p2p_get2 devN= iwpriv wlan0 p2p_set prov_disc= iwpriv wlan0 p2p_set got_wpsinfo=3 iwpriv wlan0 p2p_set nego= wpa_supplicant -i wlan0 -c ./wpa_0_8.conf -B wpa_cli wps_pbc

GO Mode ( Android requests connection to Linux)

iwpriv wlan0 p2p_set enable=3 iwpriv wlan0 p2p_get status iwpriv wlan0 p2p_get role iwpriv wlan0 p2p_set intent=1 iwpriv wlan0 p2p_set op_ch=6 iwpriv wlan0 p2p_set ssid=DIRECT-RT ./hostapd -B ./p2p_hostapd.conf >>> iwpriv wlan0 p2p_get peer_deva iwpriv wlan0 p2p_get req_cm iwpriv wlan0 p2p_set got_wpsinfo=3 iwpriv wlan0 p2p_get peer_ifa ./hostapd_cli wps_pbc any ifconfig wlan0 192.168.1.254 dhcpd 

But there’s some necessary conditions for wifi-direct connection.

  1. Your wireless driver should support nl80211.
  2. Configure ‘nl80211’ option when MAKE wpa_supplicant, hostapd.
  3. dhcpd configuration files.(dhcpd.conf, dhcpd.lease)
  4. wpa_supplicant, hostapd configurations( conf files )
Читайте также:  Кнопочный телефон который раздает вай фай

I hope this article may be useful for who wants wifi-direct between Linux and Android.

How to set up a Wifi-Direct connection between Android, How to set up a Wifi-Direct connection between Android and Linux — Android [ Glasses to protect eyes while coding : https://amzn.to/3N1ISWI ] …

How to p2p_connect to device with WiFi Direct without MAC Address? (Raspberry Pi and Android)

I have an Android tablet and A Raspberry Pi and I want to established a connection between them automatically when the tablet sends a request to the Pi.

I followed an Android application example here and start discovering any nearby devices. (https://www.youtube.com/watch?v=qnY97iBxp30)

At the same time i run sudo wpa_cli and p2p_find 20. The Android application detects the Pi, and I try to establish connection with the Pi which will display

P2P-GO-NEG-REQUEST TABLET_MAC_ADDRESS dev_passwd_id=4

Normally I would just p2p_connect TABLET_MAC_ADDRESS pbc to successfully connect them together but I find it inefficient if I were to swap to another mobile device.

Are there any other ways to connect the tablet without writing the tablet mac address? For example connecting to that specific device ssid when they send a P2P-GO-NEG-REQUEST to the pi?

TL;DR Nope.
If we look at the OSI ISO 7 layer model for network communication we can see that the Media Access Control (MAC) address is vital for identifying which device is which within a wifi network. You could try setting up a bluetooth connection or a token-ring, but I suspect that would be more effort than you are looking for. With IPv6 your devices could use neighbour discovery to automate past the MAC entry to the Internet Protocol, and its possible to connect between devices using their link-local address (fe80::some:thing)

Wifi carries packets of data, that have addresses. By analogy, if I tell you which town I live in, but don’t write my building address on the packet, you are going to have a hard time delivering it.

C — Wi-Fi Direct between android and Linux, Click Connection : code :44779443 Connection to: 00:e0:4c:61:0f:d0 2 Connection failed ifconfig on my Linux :HWaddr 00:e0:4c:61:0f:d0. I am new with Android, I don’t know if can’t print a «errno» coresponding to my failure code. And I dont see in the class WifiP2pManager an interface for a callback function failure …

How can I connect one Android phone to multiple other Android phones, using WiFi direct, with each on a separate channel?

It does not look like there is an API to do this within the app, so let us assume the phone is rooted. I don’t have any experience working with rooted phones, but here’s what I’ve come up with so far:

Читайте также:  Вай фай работает рывками

The wpa_supplicant.conf file seems to be able to handle what I need. There is a parameter that can be included there, called p2p_oper_channel , which can be set to 1/6/11/whatever that forces the channel to be that, when wpa_supplicant is run.

I also found the p2p_connect command, which takes as a parameter the frequency of the channel.

Currently, the application I have is all built using the ADK and supports sending/receiving a text using multicast, to several phones, using WiFi direct. But they’re all on the same channel.

Can anyone tell me how I can use one/both of the above 2 points to set up one Android phone (master) to deliver a message to the others (slaves) on WiFi Direct, with each connected to the master on a different channel? (I assume we would do this using the fact that the phone is rooted but I’m not sure as I have no experience with this). I’m using multicast. The reason I want each on a channel is to minimize interference.

Furthermore, is it even possible to open several connections with different devices, each on a different channel, using the same WiFi chip?

In order to change the channel of the Wifi Direct of your device you need to do the following: 1- Root your phone 2- Download any File manager App: Such as ES File Explorer 3- On ES File Explorer, go to Tools, then turn ON the Root Explorer and click on it then mount RW 4- Using ES File Explorer, go to Device -> Data -> Misc -> Wifi -> p2p_supplicant.conf and change the p2p_oper_channel to whatever channel you want. 5- Turn OFF the Wifi of your phone then turn it ON in order for the change to take place.

You should note that in order for the Wifi direct channel to be the one you did set, the phone needs not to be connected to any Access point when the wifi direct connection starts. Also, usually when phone A connects to phone B via wifi direct, the connection is operating on phone B’s channel.

Wifi Direct between linux & android, One way of achieving what you want is by assigning a static IP address to one of the devices say the device running Linux for example: ifconfig p2p-interface 192.168.1.5 netmask 255.255.255.0 up. (modify to match your own, where p2p-interface is the interface created for p2p communication after running …

Источник

Оцените статью
Adblock
detector