Jump to content

[Armbian build PR] - RTL8189FS: Fix P2P-GO advertising


RSS Bot

Recommended Posts

Description

Most of Realtek drivers have a bug: P2P IE not passed to AP beacon. This causes problems, when P2P-GO looks like a regular AP. All P2P capable devices can't see my P2P-GO in the list.

I found a driver where P2P-GO works fine (according to user reviews): https://github.com/aircrack-ng/rtl8812au And found these differences. After I backported these changes my P2P-GO works fine.

Also this changes is totally safe, because affects only P2P-related code

This patch contains my patches to the original driver repo:

  1. jwrdegoede/rtl8189ES_linux#87
  2. jwrdegoede/rtl8189ES_linux#88

But the owner is too busy to review that :(

How Has This Been Tested?

  1. Create /etc/wpa_supplicant/wpa_supplicant-wlan0.conf
ctrl_interface=/var/run/wpa_supplicant
update_config=1
device_name=orangepilite
device_type=1-0050F204-1
config_methods=virtual_push_button
p2p_no_group_iface=1
  1. Setup DHCP for the wlan0: /etc/systemd/network/wlan0.network
[Match]
Name=wlan0

[Network]
Address=10.7.7.7/24
DHCPServer=true
IPMasquerade=ipv4

[DHCPServer]
PoolOffset=100
PoolSize=20
EmitDNS=yes
DNS=1.1.1.1
  1. Setup services
# We don't need NM
sudo systemctl disable NetworkManager
sudo systemctl stop NetworkManager

# For test we need systemd-networkd
sudo systemctl enable systemd-networkd
sudo systemctl start systemd-networkd

# Useless without NM
sudo systemctl stop wpa_supplicant
sudo systemctl disable wpa_supplicant

# Enable wpa_supplicant for wlan0
sudo systemctl enable wpa_supplicant@wlan0
sudo systemctl start wpa_supplicant@wlan0
  1. Now create P2P-GO:
sudo wpa_cli p2p_group_add
  1. Open on android "Wifi Direct" section in settings. Now you can see "orangepilite" device in the list. Just click it!

  2. Accept join req from your phone to P2P-GO

sudo wpa_cli wps_pbc

In wpa_supplicant logs you can see something like that:

<3>P2P-DEVICE-FOUND xx:xx:xx:xx:xx:xx p2p_dev_addr=xx:xx:xx:xx:xx:xx pri_dev_type=10-0050F204-5 name='Android_6d7f' config_methods=0x188 dev_capab=0x25 group_capab=0x0 new=1
<3>P2P-PROV-DISC-PBC-REQ xx:xx:xx:xx:xx:xx p2p_dev_addr=xx:xx:xx:xx:xx:xx pri_dev_type=10-0050F204-5 name='Android_6d7f' config_methods=0x188 dev_capab=0x25 group_capab=0x0
<3>WPS-PBC-ACTIVE 
<3>P2P-PROV-DISC-PBC-REQ xx:xx:xx:xx:xx:xx p2p_dev_addr=xx:xx:xx:xx:xx:xx pri_dev_type=10-0050F204-5 name='Android_6d7f' config_methods=0x188 dev_capab=0x25 group_capab=0x0
<3>CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
<3>CTRL-EVENT-EAP-STARTED xx:xx:xx:xx:xx:xx
<3>CTRL-EVENT-EAP-PROPOSED-METHOD vendor=0 method=1
<3>CTRL-EVENT-EAP-PROPOSED-METHOD vendor=14122 method=254
<3>WPS-REG-SUCCESS xx:xx:xx:xx:xx:xx xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
<3>WPS-PBC-DISABLE 
<3>WPS-SUCCESS 
<3>CTRL-EVENT-EAP-FAILURE xx:xx:xx:xx:xx:xx
<3>CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
<3>AP-STA-CONNECTED xx:xx:xx:xx:xx:xx p2p_dev_addr=xx:xx:xx:xx:xx:xx
<3>EAPOL-4WAY-HS-COMPLETED xx:xx:xx:xx:xx:xx

That's successful connection.

Checklist:

  • [x] My code follows the style guidelines of this project
  • [x] I have performed a self-review of my own code
  • [x] I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • [x] My changes generate no new warnings
  • [x] Any dependent changes have been merged and published in downstream modules

View the full article

Link to comment
Share on other sites

Armbian & Khadas are rewarding contributors

×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines