Coder Social home page Coder Social logo

ircama / hostp2pd Goto Github PK

View Code? Open in Web Editor NEW
24.0 3.0 1.0 502 KB

Wi-Fi Direct Session Manager, implementing a host AP daemon in Wi-Fi Direct mode, including P2P WPS enrolment

License: Other

Python 96.65% Jupyter Notebook 3.35%
wi-fi-direct p2p wpa-supplicant wpa-cli wps enrolment wi-fi ap-mode p2p-device p2p-clients

hostp2pd's Introduction

hostp2pd's People

Contributors

ircama avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

gameboxthing

hostp2pd's Issues

ERROR - Invalid negotiation request from station with address "..."

@Ircama first of all thanks a lot for providing such a in deep description for hostp2pd.
I may be doing something wrong with some configuration but i cannot manage to get hostp2pd working with persistent connection. I am trying to connect an Android tablet to RPI from Android WIFI Direct setting panel. When i click on my DIRECT-xx from android, it asks me for the pin but after entering the pin, its status on Android remain 'invited'.

Here is the error message shows up on my hostp2pd when is I run it from command line:

2021-04-06 10:30:48,299 - root - ERROR - Invalid negotiation request from station with address "96:be:46:9a:77:33".

Some information of my test bed:

  • RPI 3B+ with Raspbian GNU/Linux 10 (buster)
  • wpa_supplicant v2.10-devel-hostap_2_9-2186-g5f082c15 (compiled from git)
  • dhcpd is disabled and using only systemd networking (built in dhcpd + resolv etc)
  • Connection from Android 10

Lunching hostp2pd:

$ sudo hostp2pd -c hostp2pd.yaml
CMD> stats
Statistics:
  <3>P2P:                             = 2
  CTRL-EVENT-SCAN-RESULTS             = 1
  CTRL-EVENT-SCAN-STARTED             = 1444
  E>OK                                = 4
  E>RX-PROBE-REQUEST                  = 4
  OK                                  = 3
  P2P-DEVICE-FOUND                    = 1
  P2P-DEVICE-LOST                     = 1
  P2P-FIND-STOPPED                    = 1
  P2P-GO-NEG-REQUEST                  = 1
  P2P-PROV-DISC-SHOW-PIN              = 1
  last_response_message               = CTRL-EVENT-SCAN-STARTED
  response_messages                   = 1463
Internal parameters:
  Configuration file                  = hostp2pd.yaml
  Interface name                      = p2p-dev-wlan0
  SSID persistent/autonomous group    = DIRECT-RPI
  Active group                        = p2p-wlan0-0
  Group formation technique           = Persistent
  Persistent group number (net id)    = 0
  Activation/deactivation program     = 
  Deactivation program was run        = False
  Thread backend state                = Active
  Pbc is in use                       = False
  Configuration method in use         = keypad
  p2p_connect_time                    = 0
  find_timing_level                   = connect
  Logging level                       = 10
  Number of failures                  = 0
  Stored station name                 = None
  wpa_supplicant errors               = 0
  Number of scan pollings             = 0
  wpa_cli process Pid                 = 780
  Enroller wpa_cli process Pid        = 785

wpa_cli output
I ran the sudo wpa_cli -i p2p-dev-wlan0 in another window to see the events. here are what i see while running my scenario:

<3>CTRL-EVENT-SCAN-STARTED 
<3>CTRL-EVENT-SCAN-STARTED 
<3>P2P-DEVICE-FOUND 96:be:46:9a:77:33 p2p_dev_addr=96:be:46:9a:77:33 pri_dev_type=10-0050F204-5 name='Lenovo Tab M10' config_methods=0x188 dev_capab=0x25 group_capab=0x0 new=1
<3>P2P-PROV-DISC-SHOW-PIN 96:be:46:9a:77:33 66790280 p2p_dev_addr=96:be:46:9a:77:33 pri_dev_type=10-0050F204-5 name='Lenovo Tab M10' config_methods=0x188 dev_capab=0x25 group_capab=0x0
<3>CTRL-EVENT-SCAN-STARTED 
<3>CTRL-EVENT-SCAN-STARTED 
<3>CTRL-EVENT-SCAN-STARTED 
<3>P2P-GO-NEG-REQUEST 96:be:46:9a:77:33 dev_passwd_id=1 go_intent=6
<3>CTRL-EVENT-SCAN-STARTED 

/etc/wpa_supplicant/wpa_supplicant.conf

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
# driver_param=p2p_device=6
update_config=1
device_name=DIRECT-RPI
device_type=6-0050F204-1
config_methods=keypad
p2p_go_intent=15
p2p_go_ht40=1
country=LU

p2p_device_random_mac_addr=2
# p2p_device_persistent_mac_addr=ba:27:eb:ca:de:69
persistent_reconnect=1

network={
	ssid="DIRECT-RPI"
	bssid=ba:27:eb:ca:5e:69
	psk="00000000"
	proto=RSN
	key_mgmt=WPA-PSK
	pairwise=CCMP
	auth_alg=OPEN
	mode=3
	disabled=2
}

hostp2pd.yaml (removed commented line)

##########################################################################
# hostp2pd - The Wi-Fi Direct Session Manager
# wpa_cli controller of Wi-Fi Direct connections handled by wpa_supplicant
# https://github.com/Ircama/hostp2pd
# (C) Ircama 2021 - CC-BY-NC-SA-4.0
##########################################################################
%YAML 1.1
---
hostp2pd: # (remember to indent options)
  pbc_in_use: False # Use method selected in config. (False=keypad, True=pbc, None=wpa_supplicant.conf)
  activate_persistent_group: True # Activate a persistent group at process startup
  activate_autonomous_group: False # Activate an autonomous group at process startup
  dynamic_group: False # allow removing group after a session disconnects
  persistent_network_id: None # persistent group network number (None = first in wpa_supplicant config.)
  pin: "00000000" # pin

# Log file format
# left everything as default!!!

ifconfig

p2p-wlan0-0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.4.1  netmask 255.255.255.0  broadcast 192.168.4.255
        inet6 fe80::b827:ebff:feca:de69  prefixlen 64  scopeid 0x20<link>
        ether ba:27:eb:ca:de:69  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 119  bytes 22500 (21.9 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether b8:27:eb:ca:5e:69  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

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.