Tool/software: Linux
I try to establish Wi-Fi direct connection between Android and Beagle Bone Black Wireless running Debian 9.2 2017-10-10 4GB SD IoT image.
Sometimes it works but sometimes I get P2P-GO-NEG-FAILURE status=-1. Below I describe steps to reproduce my problem.
Firstly when I still have Internet I upgrade system and install additional dependencies which will be required later
sudo apt update && sudo apt upgrade
sudo apt install python3-pip
pip3 install --user pydbus
and I copy using scp script wifi_direct.py from here gist.github.com/.../691cdb76c68ad699b48e131490b5119d to BeagleBone.
By default BeagleBone debian configures SoftAp which conflicts with Wi-Fi direct. I disable this by setting TETHER_ENABLED=no in /etc/default/bb-wl18xx.
Note that after that DHCP server will stop running on Ethernet-over-USB interface github.com/.../32 so on the host machine we will need to assign IP addresses manually to our Ethernet-over-USB interfaces
ifconfig eth1 192.168.6.1; ifconfig eth0 192.168.7.1
then we can ssh to BeagleBone using ssh debian@192.168.6.2 or ssh debian@192.168.7.2.
I add /etc/wpa_supplicant/wpa_supplicant.conf configuration file with content
device_name=BeagleBone
device_type=1-0050F204-5
config_methods=pbc
and edit ExecStart line in /lib/systemd/system/wpa_supplicant.service to look like
ExecStart=/sbin/wpa_supplicant -u -s -O /run/wpa_supplicant -c /etc/wpa_supplicant/wpa_supplicant.conf
so this configuration file will be picked up.
Now to narrow scope of the issue I try to reproduce it using only wpa_supplicant on fresh boot.
So I boot system and make sure that after boot no wpa_supplicant is running.
$ ps aux|grep wpa_supplicant
Then I stop connman and lanuch wpa_supplicant
# systemctl stop connman
# systemctl start wpa_supplicant
After that I run attached {{wifi_direct.py}} script
python3 wifi_direct.py
It works according to following simple algorithm
1. Run P2P find.
2. Accept whatever P2P connection.
3. When other side disconnects remove P2P group.
4. Go to step 1.
From my Android phone I scan for P2P devices, try to connect to BeagleBone, then disconnect and then repeat this steps.
For some reasons after 5-15 retries I get P2P-GO-NEG-FAILURE status=-1 on BeagleBone side. Journal logs are attached. Could you please suggest what I might be doing wrongly?
Please find journal log gist.github.com/.../5740d17b211d5991a33b53ad35c22d3c and prints of my script gist.github.com/.../edd68fe87435576a6d8eca633b4822b9