Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
apaikan opened this issue Apr 6, 2021 · 1 comment
Open

Comments

@apaikan
Copy link

apaikan commented Apr 6, 2021

@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
@Ircama
Copy link
Owner

Ircama commented Apr 6, 2021

This should not be a problem of hostp2pd, but related to the wpa_supplicant interaction with the Android device. After hostp2pd creates a persistent group (p2p-wlan0-0 in your example), it just manages the enrolment to this group (P2P-GO events, which are unrelated to the P2P-GO-NEG-REQUEST event of the P2P-Device).

On the Android device, please try touching your item stuck in the Invited status, then removing it through the related popup; redo the enrolment operation more times on Android, to verify whether this problem is always occurring.

From wpa_supplicant / hostapd, P2P-GO-NEG-REQUEST describes the following:

P2P_EVENT_GO_NEG_REQUEST: A P2P device requested GO negotiation, but we were not ready to start the negotiation.

It looks like your Android device does not realize that a persistent group is already available on the Raspberry Pi system (wpa_supplicant should be beaconing this to the Wi-Fi network) and opts for the group formation technique, trying to negotiate the GO instead of joining the already existent persistent group.

If you always happen to verify the problem, please share the hostp2pd logs with loglevel 10. You should also check the events of sudo wpa_cli -i p2p-wlan0-0.

Try also the Negotiated on demand group formation technique.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants